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