1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.tags.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  import com.liferay.counter.service.CounterService;
19  
20  import com.liferay.portal.PortalException;
21  import com.liferay.portal.SystemException;
22  import com.liferay.portal.kernel.annotation.BeanReference;
23  import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
24  import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
25  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
26  import com.liferay.portal.kernel.util.OrderByComparator;
27  import com.liferay.portal.service.ResourceLocalService;
28  import com.liferay.portal.service.ResourceService;
29  import com.liferay.portal.service.UserLocalService;
30  import com.liferay.portal.service.UserService;
31  import com.liferay.portal.service.persistence.ResourceFinder;
32  import com.liferay.portal.service.persistence.ResourcePersistence;
33  import com.liferay.portal.service.persistence.UserFinder;
34  import com.liferay.portal.service.persistence.UserPersistence;
35  
36  import com.liferay.portlet.tags.model.TagsEntry;
37  import com.liferay.portlet.tags.service.TagsAssetLocalService;
38  import com.liferay.portlet.tags.service.TagsAssetService;
39  import com.liferay.portlet.tags.service.TagsEntryLocalService;
40  import com.liferay.portlet.tags.service.TagsEntryService;
41  import com.liferay.portlet.tags.service.TagsPropertyLocalService;
42  import com.liferay.portlet.tags.service.TagsPropertyService;
43  import com.liferay.portlet.tags.service.TagsSourceLocalService;
44  import com.liferay.portlet.tags.service.TagsSourceService;
45  import com.liferay.portlet.tags.service.TagsVocabularyLocalService;
46  import com.liferay.portlet.tags.service.TagsVocabularyService;
47  import com.liferay.portlet.tags.service.persistence.TagsAssetFinder;
48  import com.liferay.portlet.tags.service.persistence.TagsAssetPersistence;
49  import com.liferay.portlet.tags.service.persistence.TagsEntryFinder;
50  import com.liferay.portlet.tags.service.persistence.TagsEntryPersistence;
51  import com.liferay.portlet.tags.service.persistence.TagsPropertyFinder;
52  import com.liferay.portlet.tags.service.persistence.TagsPropertyKeyFinder;
53  import com.liferay.portlet.tags.service.persistence.TagsPropertyPersistence;
54  import com.liferay.portlet.tags.service.persistence.TagsSourcePersistence;
55  import com.liferay.portlet.tags.service.persistence.TagsVocabularyPersistence;
56  
57  import java.util.List;
58  
59  import javax.sql.DataSource;
60  
61  /**
62   * <a href="TagsEntryLocalServiceBaseImpl.java.html"><b><i>View Source</i></b>
63   * </a>
64   *
65   * @author Brian Wing Shun Chan
66   */
67  public abstract class TagsEntryLocalServiceBaseImpl
68      implements TagsEntryLocalService {
69      public TagsEntry addTagsEntry(TagsEntry tagsEntry)
70          throws SystemException {
71          tagsEntry.setNew(true);
72  
73          return tagsEntryPersistence.update(tagsEntry, false);
74      }
75  
76      public TagsEntry createTagsEntry(long entryId) {
77          return tagsEntryPersistence.create(entryId);
78      }
79  
80      public void deleteTagsEntry(long entryId)
81          throws PortalException, SystemException {
82          tagsEntryPersistence.remove(entryId);
83      }
84  
85      public void deleteTagsEntry(TagsEntry tagsEntry) throws SystemException {
86          tagsEntryPersistence.remove(tagsEntry);
87      }
88  
89      @SuppressWarnings("rawtypes")
90      public List dynamicQuery(DynamicQuery dynamicQuery)
91          throws SystemException {
92          return tagsEntryPersistence.findWithDynamicQuery(dynamicQuery);
93      }
94  
95      @SuppressWarnings("rawtypes")
96      public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
97          throws SystemException {
98          return tagsEntryPersistence.findWithDynamicQuery(dynamicQuery, start,
99              end);
100     }
101 
102     @SuppressWarnings("rawtypes")
103     public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
104         OrderByComparator orderByComparator) throws SystemException {
105         return tagsEntryPersistence.findWithDynamicQuery(dynamicQuery, start,
106             end, orderByComparator);
107     }
108 
109     public int dynamicQueryCount(DynamicQuery dynamicQuery)
110         throws SystemException {
111         return tagsEntryPersistence.countWithDynamicQuery(dynamicQuery);
112     }
113 
114     public TagsEntry getTagsEntry(long entryId)
115         throws PortalException, SystemException {
116         return tagsEntryPersistence.findByPrimaryKey(entryId);
117     }
118 
119     public List<TagsEntry> getTagsEntries(int start, int end)
120         throws SystemException {
121         return tagsEntryPersistence.findAll(start, end);
122     }
123 
124     public int getTagsEntriesCount() throws SystemException {
125         return tagsEntryPersistence.countAll();
126     }
127 
128     public TagsEntry updateTagsEntry(TagsEntry tagsEntry)
129         throws SystemException {
130         tagsEntry.setNew(false);
131 
132         return tagsEntryPersistence.update(tagsEntry, true);
133     }
134 
135     public TagsEntry updateTagsEntry(TagsEntry tagsEntry, boolean merge)
136         throws SystemException {
137         tagsEntry.setNew(false);
138 
139         return tagsEntryPersistence.update(tagsEntry, merge);
140     }
141 
142     public TagsAssetLocalService getTagsAssetLocalService() {
143         return tagsAssetLocalService;
144     }
145 
146     public void setTagsAssetLocalService(
147         TagsAssetLocalService tagsAssetLocalService) {
148         this.tagsAssetLocalService = tagsAssetLocalService;
149     }
150 
151     public TagsAssetService getTagsAssetService() {
152         return tagsAssetService;
153     }
154 
155     public void setTagsAssetService(TagsAssetService tagsAssetService) {
156         this.tagsAssetService = tagsAssetService;
157     }
158 
159     public TagsAssetPersistence getTagsAssetPersistence() {
160         return tagsAssetPersistence;
161     }
162 
163     public void setTagsAssetPersistence(
164         TagsAssetPersistence tagsAssetPersistence) {
165         this.tagsAssetPersistence = tagsAssetPersistence;
166     }
167 
168     public TagsAssetFinder getTagsAssetFinder() {
169         return tagsAssetFinder;
170     }
171 
172     public void setTagsAssetFinder(TagsAssetFinder tagsAssetFinder) {
173         this.tagsAssetFinder = tagsAssetFinder;
174     }
175 
176     public TagsEntryLocalService getTagsEntryLocalService() {
177         return tagsEntryLocalService;
178     }
179 
180     public void setTagsEntryLocalService(
181         TagsEntryLocalService tagsEntryLocalService) {
182         this.tagsEntryLocalService = tagsEntryLocalService;
183     }
184 
185     public TagsEntryService getTagsEntryService() {
186         return tagsEntryService;
187     }
188 
189     public void setTagsEntryService(TagsEntryService tagsEntryService) {
190         this.tagsEntryService = tagsEntryService;
191     }
192 
193     public TagsEntryPersistence getTagsEntryPersistence() {
194         return tagsEntryPersistence;
195     }
196 
197     public void setTagsEntryPersistence(
198         TagsEntryPersistence tagsEntryPersistence) {
199         this.tagsEntryPersistence = tagsEntryPersistence;
200     }
201 
202     public TagsEntryFinder getTagsEntryFinder() {
203         return tagsEntryFinder;
204     }
205 
206     public void setTagsEntryFinder(TagsEntryFinder tagsEntryFinder) {
207         this.tagsEntryFinder = tagsEntryFinder;
208     }
209 
210     public TagsPropertyLocalService getTagsPropertyLocalService() {
211         return tagsPropertyLocalService;
212     }
213 
214     public void setTagsPropertyLocalService(
215         TagsPropertyLocalService tagsPropertyLocalService) {
216         this.tagsPropertyLocalService = tagsPropertyLocalService;
217     }
218 
219     public TagsPropertyService getTagsPropertyService() {
220         return tagsPropertyService;
221     }
222 
223     public void setTagsPropertyService(TagsPropertyService tagsPropertyService) {
224         this.tagsPropertyService = tagsPropertyService;
225     }
226 
227     public TagsPropertyPersistence getTagsPropertyPersistence() {
228         return tagsPropertyPersistence;
229     }
230 
231     public void setTagsPropertyPersistence(
232         TagsPropertyPersistence tagsPropertyPersistence) {
233         this.tagsPropertyPersistence = tagsPropertyPersistence;
234     }
235 
236     public TagsPropertyFinder getTagsPropertyFinder() {
237         return tagsPropertyFinder;
238     }
239 
240     public void setTagsPropertyFinder(TagsPropertyFinder tagsPropertyFinder) {
241         this.tagsPropertyFinder = tagsPropertyFinder;
242     }
243 
244     public TagsPropertyKeyFinder getTagsPropertyKeyFinder() {
245         return tagsPropertyKeyFinder;
246     }
247 
248     public void setTagsPropertyKeyFinder(
249         TagsPropertyKeyFinder tagsPropertyKeyFinder) {
250         this.tagsPropertyKeyFinder = tagsPropertyKeyFinder;
251     }
252 
253     public TagsSourceLocalService getTagsSourceLocalService() {
254         return tagsSourceLocalService;
255     }
256 
257     public void setTagsSourceLocalService(
258         TagsSourceLocalService tagsSourceLocalService) {
259         this.tagsSourceLocalService = tagsSourceLocalService;
260     }
261 
262     public TagsSourceService getTagsSourceService() {
263         return tagsSourceService;
264     }
265 
266     public void setTagsSourceService(TagsSourceService tagsSourceService) {
267         this.tagsSourceService = tagsSourceService;
268     }
269 
270     public TagsSourcePersistence getTagsSourcePersistence() {
271         return tagsSourcePersistence;
272     }
273 
274     public void setTagsSourcePersistence(
275         TagsSourcePersistence tagsSourcePersistence) {
276         this.tagsSourcePersistence = tagsSourcePersistence;
277     }
278 
279     public TagsVocabularyLocalService getTagsVocabularyLocalService() {
280         return tagsVocabularyLocalService;
281     }
282 
283     public void setTagsVocabularyLocalService(
284         TagsVocabularyLocalService tagsVocabularyLocalService) {
285         this.tagsVocabularyLocalService = tagsVocabularyLocalService;
286     }
287 
288     public TagsVocabularyService getTagsVocabularyService() {
289         return tagsVocabularyService;
290     }
291 
292     public void setTagsVocabularyService(
293         TagsVocabularyService tagsVocabularyService) {
294         this.tagsVocabularyService = tagsVocabularyService;
295     }
296 
297     public TagsVocabularyPersistence getTagsVocabularyPersistence() {
298         return tagsVocabularyPersistence;
299     }
300 
301     public void setTagsVocabularyPersistence(
302         TagsVocabularyPersistence tagsVocabularyPersistence) {
303         this.tagsVocabularyPersistence = tagsVocabularyPersistence;
304     }
305 
306     public CounterLocalService getCounterLocalService() {
307         return counterLocalService;
308     }
309 
310     public void setCounterLocalService(CounterLocalService counterLocalService) {
311         this.counterLocalService = counterLocalService;
312     }
313 
314     public CounterService getCounterService() {
315         return counterService;
316     }
317 
318     public void setCounterService(CounterService counterService) {
319         this.counterService = counterService;
320     }
321 
322     public ResourceLocalService getResourceLocalService() {
323         return resourceLocalService;
324     }
325 
326     public void setResourceLocalService(
327         ResourceLocalService resourceLocalService) {
328         this.resourceLocalService = resourceLocalService;
329     }
330 
331     public ResourceService getResourceService() {
332         return resourceService;
333     }
334 
335     public void setResourceService(ResourceService resourceService) {
336         this.resourceService = resourceService;
337     }
338 
339     public ResourcePersistence getResourcePersistence() {
340         return resourcePersistence;
341     }
342 
343     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
344         this.resourcePersistence = resourcePersistence;
345     }
346 
347     public ResourceFinder getResourceFinder() {
348         return resourceFinder;
349     }
350 
351     public void setResourceFinder(ResourceFinder resourceFinder) {
352         this.resourceFinder = resourceFinder;
353     }
354 
355     public UserLocalService getUserLocalService() {
356         return userLocalService;
357     }
358 
359     public void setUserLocalService(UserLocalService userLocalService) {
360         this.userLocalService = userLocalService;
361     }
362 
363     public UserService getUserService() {
364         return userService;
365     }
366 
367     public void setUserService(UserService userService) {
368         this.userService = userService;
369     }
370 
371     public UserPersistence getUserPersistence() {
372         return userPersistence;
373     }
374 
375     public void setUserPersistence(UserPersistence userPersistence) {
376         this.userPersistence = userPersistence;
377     }
378 
379     public UserFinder getUserFinder() {
380         return userFinder;
381     }
382 
383     public void setUserFinder(UserFinder userFinder) {
384         this.userFinder = userFinder;
385     }
386 
387     protected void runSQL(String sql) throws SystemException {
388         try {
389             DataSource dataSource = tagsEntryPersistence.getDataSource();
390 
391             SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
392                     sql, new int[0]);
393 
394             sqlUpdate.update(new Object[0]);
395         }
396         catch (Exception e) {
397             throw new SystemException(e);
398         }
399     }
400 
401     @BeanReference(type = TagsAssetLocalService.class)
402     protected TagsAssetLocalService tagsAssetLocalService;
403     @BeanReference(type = TagsAssetService.class)
404     protected TagsAssetService tagsAssetService;
405     @BeanReference(type = TagsAssetPersistence.class)
406     protected TagsAssetPersistence tagsAssetPersistence;
407     @BeanReference(type = TagsAssetFinder.class)
408     protected TagsAssetFinder tagsAssetFinder;
409     @BeanReference(type = TagsEntryLocalService.class)
410     protected TagsEntryLocalService tagsEntryLocalService;
411     @BeanReference(type = TagsEntryService.class)
412     protected TagsEntryService tagsEntryService;
413     @BeanReference(type = TagsEntryPersistence.class)
414     protected TagsEntryPersistence tagsEntryPersistence;
415     @BeanReference(type = TagsEntryFinder.class)
416     protected TagsEntryFinder tagsEntryFinder;
417     @BeanReference(type = TagsPropertyLocalService.class)
418     protected TagsPropertyLocalService tagsPropertyLocalService;
419     @BeanReference(type = TagsPropertyService.class)
420     protected TagsPropertyService tagsPropertyService;
421     @BeanReference(type = TagsPropertyPersistence.class)
422     protected TagsPropertyPersistence tagsPropertyPersistence;
423     @BeanReference(type = TagsPropertyFinder.class)
424     protected TagsPropertyFinder tagsPropertyFinder;
425     @BeanReference(type = TagsPropertyKeyFinder.class)
426     protected TagsPropertyKeyFinder tagsPropertyKeyFinder;
427     @BeanReference(type = TagsSourceLocalService.class)
428     protected TagsSourceLocalService tagsSourceLocalService;
429     @BeanReference(type = TagsSourceService.class)
430     protected TagsSourceService tagsSourceService;
431     @BeanReference(type = TagsSourcePersistence.class)
432     protected TagsSourcePersistence tagsSourcePersistence;
433     @BeanReference(type = TagsVocabularyLocalService.class)
434     protected TagsVocabularyLocalService tagsVocabularyLocalService;
435     @BeanReference(type = TagsVocabularyService.class)
436     protected TagsVocabularyService tagsVocabularyService;
437     @BeanReference(type = TagsVocabularyPersistence.class)
438     protected TagsVocabularyPersistence tagsVocabularyPersistence;
439     @BeanReference(type = CounterLocalService.class)
440     protected CounterLocalService counterLocalService;
441     @BeanReference(type = CounterService.class)
442     protected CounterService counterService;
443     @BeanReference(type = ResourceLocalService.class)
444     protected ResourceLocalService resourceLocalService;
445     @BeanReference(type = ResourceService.class)
446     protected ResourceService resourceService;
447     @BeanReference(type = ResourcePersistence.class)
448     protected ResourcePersistence resourcePersistence;
449     @BeanReference(type = ResourceFinder.class)
450     protected ResourceFinder resourceFinder;
451     @BeanReference(type = UserLocalService.class)
452     protected UserLocalService userLocalService;
453     @BeanReference(type = UserService.class)
454     protected UserService userService;
455     @BeanReference(type = UserPersistence.class)
456     protected UserPersistence userPersistence;
457     @BeanReference(type = UserFinder.class)
458     protected UserFinder userFinder;
459 }