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