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.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterService;
27  
28  import com.liferay.portal.PortalException;
29  import com.liferay.portal.SystemException;
30  import com.liferay.portal.kernel.bean.InitializingBean;
31  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
32  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
33  import com.liferay.portal.service.UserLocalService;
34  import com.liferay.portal.service.UserService;
35  import com.liferay.portal.service.persistence.UserFinder;
36  import com.liferay.portal.service.persistence.UserPersistence;
37  
38  import com.liferay.portlet.tags.model.TagsProperty;
39  import com.liferay.portlet.tags.service.TagsAssetLocalService;
40  import com.liferay.portlet.tags.service.TagsAssetService;
41  import com.liferay.portlet.tags.service.TagsEntryLocalService;
42  import com.liferay.portlet.tags.service.TagsEntryService;
43  import com.liferay.portlet.tags.service.TagsPropertyLocalService;
44  import com.liferay.portlet.tags.service.TagsSourceLocalService;
45  import com.liferay.portlet.tags.service.TagsSourceService;
46  import com.liferay.portlet.tags.service.persistence.TagsAssetFinder;
47  import com.liferay.portlet.tags.service.persistence.TagsAssetPersistence;
48  import com.liferay.portlet.tags.service.persistence.TagsEntryFinder;
49  import com.liferay.portlet.tags.service.persistence.TagsEntryPersistence;
50  import com.liferay.portlet.tags.service.persistence.TagsPropertyFinder;
51  import com.liferay.portlet.tags.service.persistence.TagsPropertyKeyFinder;
52  import com.liferay.portlet.tags.service.persistence.TagsPropertyPersistence;
53  import com.liferay.portlet.tags.service.persistence.TagsSourcePersistence;
54  
55  import java.util.List;
56  
57  /**
58   * <a href="TagsPropertyLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
59   *
60   * @author Brian Wing Shun Chan
61   *
62   */
63  public abstract class TagsPropertyLocalServiceBaseImpl
64      implements TagsPropertyLocalService, InitializingBean {
65      public TagsProperty addTagsProperty(TagsProperty tagsProperty)
66          throws SystemException {
67          tagsProperty.setNew(true);
68  
69          return tagsPropertyPersistence.update(tagsProperty, false);
70      }
71  
72      public void deleteTagsProperty(long propertyId)
73          throws PortalException, SystemException {
74          tagsPropertyPersistence.remove(propertyId);
75      }
76  
77      public void deleteTagsProperty(TagsProperty tagsProperty)
78          throws SystemException {
79          tagsPropertyPersistence.remove(tagsProperty);
80      }
81  
82      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
83          throws SystemException {
84          return tagsPropertyPersistence.findWithDynamicQuery(dynamicQuery);
85      }
86  
87      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
88          int end) throws SystemException {
89          return tagsPropertyPersistence.findWithDynamicQuery(dynamicQuery,
90              start, end);
91      }
92  
93      public TagsProperty getTagsProperty(long propertyId)
94          throws PortalException, SystemException {
95          return tagsPropertyPersistence.findByPrimaryKey(propertyId);
96      }
97  
98      public List<TagsProperty> getTagsProperties(int start, int end)
99          throws SystemException {
100         return tagsPropertyPersistence.findAll(start, end);
101     }
102 
103     public int getTagsPropertiesCount() throws SystemException {
104         return tagsPropertyPersistence.countAll();
105     }
106 
107     public TagsProperty updateTagsProperty(TagsProperty tagsProperty)
108         throws SystemException {
109         tagsProperty.setNew(false);
110 
111         return tagsPropertyPersistence.update(tagsProperty, true);
112     }
113 
114     public TagsAssetLocalService getTagsAssetLocalService() {
115         return tagsAssetLocalService;
116     }
117 
118     public void setTagsAssetLocalService(
119         TagsAssetLocalService tagsAssetLocalService) {
120         this.tagsAssetLocalService = tagsAssetLocalService;
121     }
122 
123     public TagsAssetService getTagsAssetService() {
124         return tagsAssetService;
125     }
126 
127     public void setTagsAssetService(TagsAssetService tagsAssetService) {
128         this.tagsAssetService = tagsAssetService;
129     }
130 
131     public TagsAssetPersistence getTagsAssetPersistence() {
132         return tagsAssetPersistence;
133     }
134 
135     public void setTagsAssetPersistence(
136         TagsAssetPersistence tagsAssetPersistence) {
137         this.tagsAssetPersistence = tagsAssetPersistence;
138     }
139 
140     public TagsAssetFinder getTagsAssetFinder() {
141         return tagsAssetFinder;
142     }
143 
144     public void setTagsAssetFinder(TagsAssetFinder tagsAssetFinder) {
145         this.tagsAssetFinder = tagsAssetFinder;
146     }
147 
148     public TagsEntryLocalService getTagsEntryLocalService() {
149         return tagsEntryLocalService;
150     }
151 
152     public void setTagsEntryLocalService(
153         TagsEntryLocalService tagsEntryLocalService) {
154         this.tagsEntryLocalService = tagsEntryLocalService;
155     }
156 
157     public TagsEntryService getTagsEntryService() {
158         return tagsEntryService;
159     }
160 
161     public void setTagsEntryService(TagsEntryService tagsEntryService) {
162         this.tagsEntryService = tagsEntryService;
163     }
164 
165     public TagsEntryPersistence getTagsEntryPersistence() {
166         return tagsEntryPersistence;
167     }
168 
169     public void setTagsEntryPersistence(
170         TagsEntryPersistence tagsEntryPersistence) {
171         this.tagsEntryPersistence = tagsEntryPersistence;
172     }
173 
174     public TagsEntryFinder getTagsEntryFinder() {
175         return tagsEntryFinder;
176     }
177 
178     public void setTagsEntryFinder(TagsEntryFinder tagsEntryFinder) {
179         this.tagsEntryFinder = tagsEntryFinder;
180     }
181 
182     public TagsPropertyPersistence getTagsPropertyPersistence() {
183         return tagsPropertyPersistence;
184     }
185 
186     public void setTagsPropertyPersistence(
187         TagsPropertyPersistence tagsPropertyPersistence) {
188         this.tagsPropertyPersistence = tagsPropertyPersistence;
189     }
190 
191     public TagsPropertyFinder getTagsPropertyFinder() {
192         return tagsPropertyFinder;
193     }
194 
195     public void setTagsPropertyFinder(TagsPropertyFinder tagsPropertyFinder) {
196         this.tagsPropertyFinder = tagsPropertyFinder;
197     }
198 
199     public TagsPropertyKeyFinder getTagsPropertyKeyFinder() {
200         return tagsPropertyKeyFinder;
201     }
202 
203     public void setTagsPropertyKeyFinder(
204         TagsPropertyKeyFinder tagsPropertyKeyFinder) {
205         this.tagsPropertyKeyFinder = tagsPropertyKeyFinder;
206     }
207 
208     public TagsSourceLocalService getTagsSourceLocalService() {
209         return tagsSourceLocalService;
210     }
211 
212     public void setTagsSourceLocalService(
213         TagsSourceLocalService tagsSourceLocalService) {
214         this.tagsSourceLocalService = tagsSourceLocalService;
215     }
216 
217     public TagsSourceService getTagsSourceService() {
218         return tagsSourceService;
219     }
220 
221     public void setTagsSourceService(TagsSourceService tagsSourceService) {
222         this.tagsSourceService = tagsSourceService;
223     }
224 
225     public TagsSourcePersistence getTagsSourcePersistence() {
226         return tagsSourcePersistence;
227     }
228 
229     public void setTagsSourcePersistence(
230         TagsSourcePersistence tagsSourcePersistence) {
231         this.tagsSourcePersistence = tagsSourcePersistence;
232     }
233 
234     public CounterLocalService getCounterLocalService() {
235         return counterLocalService;
236     }
237 
238     public void setCounterLocalService(CounterLocalService counterLocalService) {
239         this.counterLocalService = counterLocalService;
240     }
241 
242     public CounterService getCounterService() {
243         return counterService;
244     }
245 
246     public void setCounterService(CounterService counterService) {
247         this.counterService = counterService;
248     }
249 
250     public UserLocalService getUserLocalService() {
251         return userLocalService;
252     }
253 
254     public void setUserLocalService(UserLocalService userLocalService) {
255         this.userLocalService = userLocalService;
256     }
257 
258     public UserService getUserService() {
259         return userService;
260     }
261 
262     public void setUserService(UserService userService) {
263         this.userService = userService;
264     }
265 
266     public UserPersistence getUserPersistence() {
267         return userPersistence;
268     }
269 
270     public void setUserPersistence(UserPersistence userPersistence) {
271         this.userPersistence = userPersistence;
272     }
273 
274     public UserFinder getUserFinder() {
275         return userFinder;
276     }
277 
278     public void setUserFinder(UserFinder userFinder) {
279         this.userFinder = userFinder;
280     }
281 
282     public void afterPropertiesSet() {
283         if (tagsAssetLocalService == null) {
284             tagsAssetLocalService = (TagsAssetLocalService)PortalBeanLocatorUtil.locate(TagsAssetLocalService.class.getName() +
285                     ".impl");
286         }
287 
288         if (tagsAssetService == null) {
289             tagsAssetService = (TagsAssetService)PortalBeanLocatorUtil.locate(TagsAssetService.class.getName() +
290                     ".impl");
291         }
292 
293         if (tagsAssetPersistence == null) {
294             tagsAssetPersistence = (TagsAssetPersistence)PortalBeanLocatorUtil.locate(TagsAssetPersistence.class.getName() +
295                     ".impl");
296         }
297 
298         if (tagsAssetFinder == null) {
299             tagsAssetFinder = (TagsAssetFinder)PortalBeanLocatorUtil.locate(TagsAssetFinder.class.getName() +
300                     ".impl");
301         }
302 
303         if (tagsEntryLocalService == null) {
304             tagsEntryLocalService = (TagsEntryLocalService)PortalBeanLocatorUtil.locate(TagsEntryLocalService.class.getName() +
305                     ".impl");
306         }
307 
308         if (tagsEntryService == null) {
309             tagsEntryService = (TagsEntryService)PortalBeanLocatorUtil.locate(TagsEntryService.class.getName() +
310                     ".impl");
311         }
312 
313         if (tagsEntryPersistence == null) {
314             tagsEntryPersistence = (TagsEntryPersistence)PortalBeanLocatorUtil.locate(TagsEntryPersistence.class.getName() +
315                     ".impl");
316         }
317 
318         if (tagsEntryFinder == null) {
319             tagsEntryFinder = (TagsEntryFinder)PortalBeanLocatorUtil.locate(TagsEntryFinder.class.getName() +
320                     ".impl");
321         }
322 
323         if (tagsPropertyPersistence == null) {
324             tagsPropertyPersistence = (TagsPropertyPersistence)PortalBeanLocatorUtil.locate(TagsPropertyPersistence.class.getName() +
325                     ".impl");
326         }
327 
328         if (tagsPropertyFinder == null) {
329             tagsPropertyFinder = (TagsPropertyFinder)PortalBeanLocatorUtil.locate(TagsPropertyFinder.class.getName() +
330                     ".impl");
331         }
332 
333         if (tagsPropertyKeyFinder == null) {
334             tagsPropertyKeyFinder = (TagsPropertyKeyFinder)PortalBeanLocatorUtil.locate(TagsPropertyKeyFinder.class.getName() +
335                     ".impl");
336         }
337 
338         if (tagsSourceLocalService == null) {
339             tagsSourceLocalService = (TagsSourceLocalService)PortalBeanLocatorUtil.locate(TagsSourceLocalService.class.getName() +
340                     ".impl");
341         }
342 
343         if (tagsSourceService == null) {
344             tagsSourceService = (TagsSourceService)PortalBeanLocatorUtil.locate(TagsSourceService.class.getName() +
345                     ".impl");
346         }
347 
348         if (tagsSourcePersistence == null) {
349             tagsSourcePersistence = (TagsSourcePersistence)PortalBeanLocatorUtil.locate(TagsSourcePersistence.class.getName() +
350                     ".impl");
351         }
352 
353         if (counterLocalService == null) {
354             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
355                     ".impl");
356         }
357 
358         if (counterService == null) {
359             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
360                     ".impl");
361         }
362 
363         if (userLocalService == null) {
364             userLocalService = (UserLocalService)PortalBeanLocatorUtil.locate(UserLocalService.class.getName() +
365                     ".impl");
366         }
367 
368         if (userService == null) {
369             userService = (UserService)PortalBeanLocatorUtil.locate(UserService.class.getName() +
370                     ".impl");
371         }
372 
373         if (userPersistence == null) {
374             userPersistence = (UserPersistence)PortalBeanLocatorUtil.locate(UserPersistence.class.getName() +
375                     ".impl");
376         }
377 
378         if (userFinder == null) {
379             userFinder = (UserFinder)PortalBeanLocatorUtil.locate(UserFinder.class.getName() +
380                     ".impl");
381         }
382     }
383 
384     protected TagsAssetLocalService tagsAssetLocalService;
385     protected TagsAssetService tagsAssetService;
386     protected TagsAssetPersistence tagsAssetPersistence;
387     protected TagsAssetFinder tagsAssetFinder;
388     protected TagsEntryLocalService tagsEntryLocalService;
389     protected TagsEntryService tagsEntryService;
390     protected TagsEntryPersistence tagsEntryPersistence;
391     protected TagsEntryFinder tagsEntryFinder;
392     protected TagsPropertyPersistence tagsPropertyPersistence;
393     protected TagsPropertyFinder tagsPropertyFinder;
394     protected TagsPropertyKeyFinder tagsPropertyKeyFinder;
395     protected TagsSourceLocalService tagsSourceLocalService;
396     protected TagsSourceService tagsSourceService;
397     protected TagsSourcePersistence tagsSourcePersistence;
398     protected CounterLocalService counterLocalService;
399     protected CounterService counterService;
400     protected UserLocalService userLocalService;
401     protected UserService userService;
402     protected UserPersistence userPersistence;
403     protected UserFinder userFinder;
404 }