1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.tags.service.base;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.bean.InitializingBean;
28  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
29  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
30  
31  import com.liferay.portlet.tags.model.TagsSource;
32  import com.liferay.portlet.tags.service.TagsAssetLocalService;
33  import com.liferay.portlet.tags.service.TagsAssetService;
34  import com.liferay.portlet.tags.service.TagsEntryLocalService;
35  import com.liferay.portlet.tags.service.TagsEntryService;
36  import com.liferay.portlet.tags.service.TagsPropertyLocalService;
37  import com.liferay.portlet.tags.service.TagsPropertyService;
38  import com.liferay.portlet.tags.service.TagsSourceLocalService;
39  import com.liferay.portlet.tags.service.persistence.TagsAssetFinder;
40  import com.liferay.portlet.tags.service.persistence.TagsAssetPersistence;
41  import com.liferay.portlet.tags.service.persistence.TagsEntryFinder;
42  import com.liferay.portlet.tags.service.persistence.TagsEntryPersistence;
43  import com.liferay.portlet.tags.service.persistence.TagsPropertyFinder;
44  import com.liferay.portlet.tags.service.persistence.TagsPropertyKeyFinder;
45  import com.liferay.portlet.tags.service.persistence.TagsPropertyPersistence;
46  import com.liferay.portlet.tags.service.persistence.TagsSourcePersistence;
47  
48  import java.util.List;
49  
50  /**
51   * <a href="TagsSourceLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
52   *
53   * @author Brian Wing Shun Chan
54   *
55   */
56  public abstract class TagsSourceLocalServiceBaseImpl
57      implements TagsSourceLocalService, InitializingBean {
58      public TagsSource addTagsSource(TagsSource tagsSource)
59          throws SystemException {
60          tagsSource.setNew(true);
61  
62          return tagsSourcePersistence.update(tagsSource, false);
63      }
64  
65      public void deleteTagsSource(long sourceId)
66          throws PortalException, SystemException {
67          tagsSourcePersistence.remove(sourceId);
68      }
69  
70      public void deleteTagsSource(TagsSource tagsSource)
71          throws SystemException {
72          tagsSourcePersistence.remove(tagsSource);
73      }
74  
75      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
76          throws SystemException {
77          return tagsSourcePersistence.findWithDynamicQuery(dynamicQuery);
78      }
79  
80      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
81          int end) throws SystemException {
82          return tagsSourcePersistence.findWithDynamicQuery(dynamicQuery, start,
83              end);
84      }
85  
86      public TagsSource getTagsSource(long sourceId)
87          throws PortalException, SystemException {
88          return tagsSourcePersistence.findByPrimaryKey(sourceId);
89      }
90  
91      public List<TagsSource> getTagsSources(int start, int end)
92          throws SystemException {
93          return tagsSourcePersistence.findAll(start, end);
94      }
95  
96      public int getTagsSourcesCount() throws SystemException {
97          return tagsSourcePersistence.countAll();
98      }
99  
100     public TagsSource updateTagsSource(TagsSource tagsSource)
101         throws SystemException {
102         tagsSource.setNew(false);
103 
104         return tagsSourcePersistence.update(tagsSource, true);
105     }
106 
107     public TagsAssetLocalService getTagsAssetLocalService() {
108         return tagsAssetLocalService;
109     }
110 
111     public void setTagsAssetLocalService(
112         TagsAssetLocalService tagsAssetLocalService) {
113         this.tagsAssetLocalService = tagsAssetLocalService;
114     }
115 
116     public TagsAssetService getTagsAssetService() {
117         return tagsAssetService;
118     }
119 
120     public void setTagsAssetService(TagsAssetService tagsAssetService) {
121         this.tagsAssetService = tagsAssetService;
122     }
123 
124     public TagsAssetPersistence getTagsAssetPersistence() {
125         return tagsAssetPersistence;
126     }
127 
128     public void setTagsAssetPersistence(
129         TagsAssetPersistence tagsAssetPersistence) {
130         this.tagsAssetPersistence = tagsAssetPersistence;
131     }
132 
133     public TagsAssetFinder getTagsAssetFinder() {
134         return tagsAssetFinder;
135     }
136 
137     public void setTagsAssetFinder(TagsAssetFinder tagsAssetFinder) {
138         this.tagsAssetFinder = tagsAssetFinder;
139     }
140 
141     public TagsEntryLocalService getTagsEntryLocalService() {
142         return tagsEntryLocalService;
143     }
144 
145     public void setTagsEntryLocalService(
146         TagsEntryLocalService tagsEntryLocalService) {
147         this.tagsEntryLocalService = tagsEntryLocalService;
148     }
149 
150     public TagsEntryService getTagsEntryService() {
151         return tagsEntryService;
152     }
153 
154     public void setTagsEntryService(TagsEntryService tagsEntryService) {
155         this.tagsEntryService = tagsEntryService;
156     }
157 
158     public TagsEntryPersistence getTagsEntryPersistence() {
159         return tagsEntryPersistence;
160     }
161 
162     public void setTagsEntryPersistence(
163         TagsEntryPersistence tagsEntryPersistence) {
164         this.tagsEntryPersistence = tagsEntryPersistence;
165     }
166 
167     public TagsEntryFinder getTagsEntryFinder() {
168         return tagsEntryFinder;
169     }
170 
171     public void setTagsEntryFinder(TagsEntryFinder tagsEntryFinder) {
172         this.tagsEntryFinder = tagsEntryFinder;
173     }
174 
175     public TagsPropertyLocalService getTagsPropertyLocalService() {
176         return tagsPropertyLocalService;
177     }
178 
179     public void setTagsPropertyLocalService(
180         TagsPropertyLocalService tagsPropertyLocalService) {
181         this.tagsPropertyLocalService = tagsPropertyLocalService;
182     }
183 
184     public TagsPropertyService getTagsPropertyService() {
185         return tagsPropertyService;
186     }
187 
188     public void setTagsPropertyService(TagsPropertyService tagsPropertyService) {
189         this.tagsPropertyService = tagsPropertyService;
190     }
191 
192     public TagsPropertyPersistence getTagsPropertyPersistence() {
193         return tagsPropertyPersistence;
194     }
195 
196     public void setTagsPropertyPersistence(
197         TagsPropertyPersistence tagsPropertyPersistence) {
198         this.tagsPropertyPersistence = tagsPropertyPersistence;
199     }
200 
201     public TagsPropertyFinder getTagsPropertyFinder() {
202         return tagsPropertyFinder;
203     }
204 
205     public void setTagsPropertyFinder(TagsPropertyFinder tagsPropertyFinder) {
206         this.tagsPropertyFinder = tagsPropertyFinder;
207     }
208 
209     public TagsPropertyKeyFinder getTagsPropertyKeyFinder() {
210         return tagsPropertyKeyFinder;
211     }
212 
213     public void setTagsPropertyKeyFinder(
214         TagsPropertyKeyFinder tagsPropertyKeyFinder) {
215         this.tagsPropertyKeyFinder = tagsPropertyKeyFinder;
216     }
217 
218     public TagsSourcePersistence getTagsSourcePersistence() {
219         return tagsSourcePersistence;
220     }
221 
222     public void setTagsSourcePersistence(
223         TagsSourcePersistence tagsSourcePersistence) {
224         this.tagsSourcePersistence = tagsSourcePersistence;
225     }
226 
227     public void afterPropertiesSet() {
228         if (tagsAssetLocalService == null) {
229             tagsAssetLocalService = (TagsAssetLocalService)PortalBeanLocatorUtil.locate(TagsAssetLocalService.class.getName() +
230                     ".impl");
231         }
232 
233         if (tagsAssetService == null) {
234             tagsAssetService = (TagsAssetService)PortalBeanLocatorUtil.locate(TagsAssetService.class.getName() +
235                     ".impl");
236         }
237 
238         if (tagsAssetPersistence == null) {
239             tagsAssetPersistence = (TagsAssetPersistence)PortalBeanLocatorUtil.locate(TagsAssetPersistence.class.getName() +
240                     ".impl");
241         }
242 
243         if (tagsAssetFinder == null) {
244             tagsAssetFinder = (TagsAssetFinder)PortalBeanLocatorUtil.locate(TagsAssetFinder.class.getName() +
245                     ".impl");
246         }
247 
248         if (tagsEntryLocalService == null) {
249             tagsEntryLocalService = (TagsEntryLocalService)PortalBeanLocatorUtil.locate(TagsEntryLocalService.class.getName() +
250                     ".impl");
251         }
252 
253         if (tagsEntryService == null) {
254             tagsEntryService = (TagsEntryService)PortalBeanLocatorUtil.locate(TagsEntryService.class.getName() +
255                     ".impl");
256         }
257 
258         if (tagsEntryPersistence == null) {
259             tagsEntryPersistence = (TagsEntryPersistence)PortalBeanLocatorUtil.locate(TagsEntryPersistence.class.getName() +
260                     ".impl");
261         }
262 
263         if (tagsEntryFinder == null) {
264             tagsEntryFinder = (TagsEntryFinder)PortalBeanLocatorUtil.locate(TagsEntryFinder.class.getName() +
265                     ".impl");
266         }
267 
268         if (tagsPropertyLocalService == null) {
269             tagsPropertyLocalService = (TagsPropertyLocalService)PortalBeanLocatorUtil.locate(TagsPropertyLocalService.class.getName() +
270                     ".impl");
271         }
272 
273         if (tagsPropertyService == null) {
274             tagsPropertyService = (TagsPropertyService)PortalBeanLocatorUtil.locate(TagsPropertyService.class.getName() +
275                     ".impl");
276         }
277 
278         if (tagsPropertyPersistence == null) {
279             tagsPropertyPersistence = (TagsPropertyPersistence)PortalBeanLocatorUtil.locate(TagsPropertyPersistence.class.getName() +
280                     ".impl");
281         }
282 
283         if (tagsPropertyFinder == null) {
284             tagsPropertyFinder = (TagsPropertyFinder)PortalBeanLocatorUtil.locate(TagsPropertyFinder.class.getName() +
285                     ".impl");
286         }
287 
288         if (tagsPropertyKeyFinder == null) {
289             tagsPropertyKeyFinder = (TagsPropertyKeyFinder)PortalBeanLocatorUtil.locate(TagsPropertyKeyFinder.class.getName() +
290                     ".impl");
291         }
292 
293         if (tagsSourcePersistence == null) {
294             tagsSourcePersistence = (TagsSourcePersistence)PortalBeanLocatorUtil.locate(TagsSourcePersistence.class.getName() +
295                     ".impl");
296         }
297     }
298 
299     protected TagsAssetLocalService tagsAssetLocalService;
300     protected TagsAssetService tagsAssetService;
301     protected TagsAssetPersistence tagsAssetPersistence;
302     protected TagsAssetFinder tagsAssetFinder;
303     protected TagsEntryLocalService tagsEntryLocalService;
304     protected TagsEntryService tagsEntryService;
305     protected TagsEntryPersistence tagsEntryPersistence;
306     protected TagsEntryFinder tagsEntryFinder;
307     protected TagsPropertyLocalService tagsPropertyLocalService;
308     protected TagsPropertyService tagsPropertyService;
309     protected TagsPropertyPersistence tagsPropertyPersistence;
310     protected TagsPropertyFinder tagsPropertyFinder;
311     protected TagsPropertyKeyFinder tagsPropertyKeyFinder;
312     protected TagsSourcePersistence tagsSourcePersistence;
313 }