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         return tagsEntryPersistence.update(model, true);
114     }
115 
116     public TagsAssetLocalService getTagsAssetLocalService() {
117         return tagsAssetLocalService;
118     }
119 
120     public void setTagsAssetLocalService(
121         TagsAssetLocalService tagsAssetLocalService) {
122         this.tagsAssetLocalService = tagsAssetLocalService;
123     }
124 
125     public TagsAssetService getTagsAssetService() {
126         return tagsAssetService;
127     }
128 
129     public void setTagsAssetService(TagsAssetService tagsAssetService) {
130         this.tagsAssetService = tagsAssetService;
131     }
132 
133     public TagsAssetPersistence getTagsAssetPersistence() {
134         return tagsAssetPersistence;
135     }
136 
137     public void setTagsAssetPersistence(
138         TagsAssetPersistence tagsAssetPersistence) {
139         this.tagsAssetPersistence = tagsAssetPersistence;
140     }
141 
142     public TagsAssetFinder getTagsAssetFinder() {
143         return tagsAssetFinder;
144     }
145 
146     public void setTagsAssetFinder(TagsAssetFinder tagsAssetFinder) {
147         this.tagsAssetFinder = tagsAssetFinder;
148     }
149 
150     public TagsEntryPersistence getTagsEntryPersistence() {
151         return tagsEntryPersistence;
152     }
153 
154     public void setTagsEntryPersistence(
155         TagsEntryPersistence tagsEntryPersistence) {
156         this.tagsEntryPersistence = tagsEntryPersistence;
157     }
158 
159     public TagsEntryFinder getTagsEntryFinder() {
160         return tagsEntryFinder;
161     }
162 
163     public void setTagsEntryFinder(TagsEntryFinder tagsEntryFinder) {
164         this.tagsEntryFinder = tagsEntryFinder;
165     }
166 
167     public TagsPropertyLocalService getTagsPropertyLocalService() {
168         return tagsPropertyLocalService;
169     }
170 
171     public void setTagsPropertyLocalService(
172         TagsPropertyLocalService tagsPropertyLocalService) {
173         this.tagsPropertyLocalService = tagsPropertyLocalService;
174     }
175 
176     public TagsPropertyService getTagsPropertyService() {
177         return tagsPropertyService;
178     }
179 
180     public void setTagsPropertyService(TagsPropertyService tagsPropertyService) {
181         this.tagsPropertyService = tagsPropertyService;
182     }
183 
184     public TagsPropertyPersistence getTagsPropertyPersistence() {
185         return tagsPropertyPersistence;
186     }
187 
188     public void setTagsPropertyPersistence(
189         TagsPropertyPersistence tagsPropertyPersistence) {
190         this.tagsPropertyPersistence = tagsPropertyPersistence;
191     }
192 
193     public TagsPropertyFinder getTagsPropertyFinder() {
194         return tagsPropertyFinder;
195     }
196 
197     public void setTagsPropertyFinder(TagsPropertyFinder tagsPropertyFinder) {
198         this.tagsPropertyFinder = tagsPropertyFinder;
199     }
200 
201     public TagsPropertyKeyFinder getTagsPropertyKeyFinder() {
202         return tagsPropertyKeyFinder;
203     }
204 
205     public void setTagsPropertyKeyFinder(
206         TagsPropertyKeyFinder tagsPropertyKeyFinder) {
207         this.tagsPropertyKeyFinder = tagsPropertyKeyFinder;
208     }
209 
210     public TagsSourceLocalService getTagsSourceLocalService() {
211         return tagsSourceLocalService;
212     }
213 
214     public void setTagsSourceLocalService(
215         TagsSourceLocalService tagsSourceLocalService) {
216         this.tagsSourceLocalService = tagsSourceLocalService;
217     }
218 
219     public TagsSourceService getTagsSourceService() {
220         return tagsSourceService;
221     }
222 
223     public void setTagsSourceService(TagsSourceService tagsSourceService) {
224         this.tagsSourceService = tagsSourceService;
225     }
226 
227     public TagsSourcePersistence getTagsSourcePersistence() {
228         return tagsSourcePersistence;
229     }
230 
231     public void setTagsSourcePersistence(
232         TagsSourcePersistence tagsSourcePersistence) {
233         this.tagsSourcePersistence = tagsSourcePersistence;
234     }
235 
236     public CounterLocalService getCounterLocalService() {
237         return counterLocalService;
238     }
239 
240     public void setCounterLocalService(CounterLocalService counterLocalService) {
241         this.counterLocalService = counterLocalService;
242     }
243 
244     public CounterService getCounterService() {
245         return counterService;
246     }
247 
248     public void setCounterService(CounterService counterService) {
249         this.counterService = counterService;
250     }
251 
252     public UserLocalService getUserLocalService() {
253         return userLocalService;
254     }
255 
256     public void setUserLocalService(UserLocalService userLocalService) {
257         this.userLocalService = userLocalService;
258     }
259 
260     public UserService getUserService() {
261         return userService;
262     }
263 
264     public void setUserService(UserService userService) {
265         this.userService = userService;
266     }
267 
268     public UserPersistence getUserPersistence() {
269         return userPersistence;
270     }
271 
272     public void setUserPersistence(UserPersistence userPersistence) {
273         this.userPersistence = userPersistence;
274     }
275 
276     public UserFinder getUserFinder() {
277         return userFinder;
278     }
279 
280     public void setUserFinder(UserFinder userFinder) {
281         this.userFinder = userFinder;
282     }
283 
284     public void afterPropertiesSet() {
285         if (tagsAssetLocalService == null) {
286             tagsAssetLocalService = TagsAssetLocalServiceFactory.getImpl();
287         }
288 
289         if (tagsAssetService == null) {
290             tagsAssetService = TagsAssetServiceFactory.getImpl();
291         }
292 
293         if (tagsAssetPersistence == null) {
294             tagsAssetPersistence = TagsAssetUtil.getPersistence();
295         }
296 
297         if (tagsAssetFinder == null) {
298             tagsAssetFinder = TagsAssetFinderUtil.getFinder();
299         }
300 
301         if (tagsEntryPersistence == null) {
302             tagsEntryPersistence = TagsEntryUtil.getPersistence();
303         }
304 
305         if (tagsEntryFinder == null) {
306             tagsEntryFinder = TagsEntryFinderUtil.getFinder();
307         }
308 
309         if (tagsPropertyLocalService == null) {
310             tagsPropertyLocalService = TagsPropertyLocalServiceFactory.getImpl();
311         }
312 
313         if (tagsPropertyService == null) {
314             tagsPropertyService = TagsPropertyServiceFactory.getImpl();
315         }
316 
317         if (tagsPropertyPersistence == null) {
318             tagsPropertyPersistence = TagsPropertyUtil.getPersistence();
319         }
320 
321         if (tagsPropertyFinder == null) {
322             tagsPropertyFinder = TagsPropertyFinderUtil.getFinder();
323         }
324 
325         if (tagsPropertyKeyFinder == null) {
326             tagsPropertyKeyFinder = TagsPropertyKeyFinderUtil.getFinder();
327         }
328 
329         if (tagsSourceLocalService == null) {
330             tagsSourceLocalService = TagsSourceLocalServiceFactory.getImpl();
331         }
332 
333         if (tagsSourceService == null) {
334             tagsSourceService = TagsSourceServiceFactory.getImpl();
335         }
336 
337         if (tagsSourcePersistence == null) {
338             tagsSourcePersistence = TagsSourceUtil.getPersistence();
339         }
340 
341         if (counterLocalService == null) {
342             counterLocalService = CounterLocalServiceFactory.getImpl();
343         }
344 
345         if (counterService == null) {
346             counterService = CounterServiceFactory.getImpl();
347         }
348 
349         if (userLocalService == null) {
350             userLocalService = UserLocalServiceFactory.getImpl();
351         }
352 
353         if (userService == null) {
354             userService = UserServiceFactory.getImpl();
355         }
356 
357         if (userPersistence == null) {
358             userPersistence = UserUtil.getPersistence();
359         }
360 
361         if (userFinder == null) {
362             userFinder = UserFinderUtil.getFinder();
363         }
364     }
365 
366     protected TagsAssetLocalService tagsAssetLocalService;
367     protected TagsAssetService tagsAssetService;
368     protected TagsAssetPersistence tagsAssetPersistence;
369     protected TagsAssetFinder tagsAssetFinder;
370     protected TagsEntryPersistence tagsEntryPersistence;
371     protected TagsEntryFinder tagsEntryFinder;
372     protected TagsPropertyLocalService tagsPropertyLocalService;
373     protected TagsPropertyService tagsPropertyService;
374     protected TagsPropertyPersistence tagsPropertyPersistence;
375     protected TagsPropertyFinder tagsPropertyFinder;
376     protected TagsPropertyKeyFinder tagsPropertyKeyFinder;
377     protected TagsSourceLocalService tagsSourceLocalService;
378     protected TagsSourceService tagsSourceService;
379     protected TagsSourcePersistence tagsSourcePersistence;
380     protected CounterLocalService counterLocalService;
381     protected CounterService counterService;
382     protected UserLocalService userLocalService;
383     protected UserService userService;
384     protected UserPersistence userPersistence;
385     protected UserFinder userFinder;
386 }