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