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