1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.asset.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  
19  import com.liferay.portal.kernel.annotation.BeanReference;
20  import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
21  import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
22  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
23  import com.liferay.portal.kernel.exception.PortalException;
24  import com.liferay.portal.kernel.exception.SystemException;
25  import com.liferay.portal.kernel.util.OrderByComparator;
26  import com.liferay.portal.service.GroupLocalService;
27  import com.liferay.portal.service.GroupService;
28  import com.liferay.portal.service.ResourceLocalService;
29  import com.liferay.portal.service.ResourceService;
30  import com.liferay.portal.service.UserLocalService;
31  import com.liferay.portal.service.UserService;
32  import com.liferay.portal.service.persistence.GroupFinder;
33  import com.liferay.portal.service.persistence.GroupPersistence;
34  import com.liferay.portal.service.persistence.ResourceFinder;
35  import com.liferay.portal.service.persistence.ResourcePersistence;
36  import com.liferay.portal.service.persistence.UserFinder;
37  import com.liferay.portal.service.persistence.UserPersistence;
38  
39  import com.liferay.portlet.asset.model.AssetVocabulary;
40  import com.liferay.portlet.asset.service.AssetCategoryLocalService;
41  import com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService;
42  import com.liferay.portlet.asset.service.AssetCategoryPropertyService;
43  import com.liferay.portlet.asset.service.AssetCategoryService;
44  import com.liferay.portlet.asset.service.AssetEntryLocalService;
45  import com.liferay.portlet.asset.service.AssetEntryService;
46  import com.liferay.portlet.asset.service.AssetLinkLocalService;
47  import com.liferay.portlet.asset.service.AssetTagLocalService;
48  import com.liferay.portlet.asset.service.AssetTagPropertyLocalService;
49  import com.liferay.portlet.asset.service.AssetTagPropertyService;
50  import com.liferay.portlet.asset.service.AssetTagService;
51  import com.liferay.portlet.asset.service.AssetTagStatsLocalService;
52  import com.liferay.portlet.asset.service.AssetVocabularyLocalService;
53  import com.liferay.portlet.asset.service.AssetVocabularyService;
54  import com.liferay.portlet.asset.service.persistence.AssetCategoryFinder;
55  import com.liferay.portlet.asset.service.persistence.AssetCategoryPersistence;
56  import com.liferay.portlet.asset.service.persistence.AssetCategoryPropertyFinder;
57  import com.liferay.portlet.asset.service.persistence.AssetCategoryPropertyPersistence;
58  import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
59  import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
60  import com.liferay.portlet.asset.service.persistence.AssetLinkPersistence;
61  import com.liferay.portlet.asset.service.persistence.AssetTagFinder;
62  import com.liferay.portlet.asset.service.persistence.AssetTagPersistence;
63  import com.liferay.portlet.asset.service.persistence.AssetTagPropertyFinder;
64  import com.liferay.portlet.asset.service.persistence.AssetTagPropertyKeyFinder;
65  import com.liferay.portlet.asset.service.persistence.AssetTagPropertyPersistence;
66  import com.liferay.portlet.asset.service.persistence.AssetTagStatsPersistence;
67  import com.liferay.portlet.asset.service.persistence.AssetVocabularyPersistence;
68  
69  import java.util.List;
70  
71  import javax.sql.DataSource;
72  
73  /**
74   * <a href="AssetVocabularyLocalServiceBaseImpl.java.html"><b><i>View Source</i>
75   * </b></a>
76   *
77   * @author Brian Wing Shun Chan
78   */
79  public abstract class AssetVocabularyLocalServiceBaseImpl
80      implements AssetVocabularyLocalService {
81      public AssetVocabulary addAssetVocabulary(AssetVocabulary assetVocabulary)
82          throws SystemException {
83          assetVocabulary.setNew(true);
84  
85          return assetVocabularyPersistence.update(assetVocabulary, false);
86      }
87  
88      public AssetVocabulary createAssetVocabulary(long vocabularyId) {
89          return assetVocabularyPersistence.create(vocabularyId);
90      }
91  
92      public void deleteAssetVocabulary(long vocabularyId)
93          throws PortalException, SystemException {
94          assetVocabularyPersistence.remove(vocabularyId);
95      }
96  
97      public void deleteAssetVocabulary(AssetVocabulary assetVocabulary)
98          throws SystemException {
99          assetVocabularyPersistence.remove(assetVocabulary);
100     }
101 
102     @SuppressWarnings("unchecked")
103     public List dynamicQuery(DynamicQuery dynamicQuery)
104         throws SystemException {
105         return assetVocabularyPersistence.findWithDynamicQuery(dynamicQuery);
106     }
107 
108     @SuppressWarnings("unchecked")
109     public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
110         throws SystemException {
111         return assetVocabularyPersistence.findWithDynamicQuery(dynamicQuery,
112             start, end);
113     }
114 
115     @SuppressWarnings("unchecked")
116     public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
117         OrderByComparator orderByComparator) throws SystemException {
118         return assetVocabularyPersistence.findWithDynamicQuery(dynamicQuery,
119             start, end, orderByComparator);
120     }
121 
122     public long dynamicQueryCount(DynamicQuery dynamicQuery)
123         throws SystemException {
124         return assetVocabularyPersistence.countWithDynamicQuery(dynamicQuery);
125     }
126 
127     public AssetVocabulary getAssetVocabulary(long vocabularyId)
128         throws PortalException, SystemException {
129         return assetVocabularyPersistence.findByPrimaryKey(vocabularyId);
130     }
131 
132     public AssetVocabulary getAssetVocabularyByUuidAndGroupId(String uuid,
133         long groupId) throws PortalException, SystemException {
134         return assetVocabularyPersistence.findByUUID_G(uuid, groupId);
135     }
136 
137     public List<AssetVocabulary> getAssetVocabularies(int start, int end)
138         throws SystemException {
139         return assetVocabularyPersistence.findAll(start, end);
140     }
141 
142     public int getAssetVocabulariesCount() throws SystemException {
143         return assetVocabularyPersistence.countAll();
144     }
145 
146     public AssetVocabulary updateAssetVocabulary(
147         AssetVocabulary assetVocabulary) throws SystemException {
148         assetVocabulary.setNew(false);
149 
150         return assetVocabularyPersistence.update(assetVocabulary, true);
151     }
152 
153     public AssetVocabulary updateAssetVocabulary(
154         AssetVocabulary assetVocabulary, boolean merge)
155         throws SystemException {
156         assetVocabulary.setNew(false);
157 
158         return assetVocabularyPersistence.update(assetVocabulary, merge);
159     }
160 
161     public AssetCategoryLocalService getAssetCategoryLocalService() {
162         return assetCategoryLocalService;
163     }
164 
165     public void setAssetCategoryLocalService(
166         AssetCategoryLocalService assetCategoryLocalService) {
167         this.assetCategoryLocalService = assetCategoryLocalService;
168     }
169 
170     public AssetCategoryService getAssetCategoryService() {
171         return assetCategoryService;
172     }
173 
174     public void setAssetCategoryService(
175         AssetCategoryService assetCategoryService) {
176         this.assetCategoryService = assetCategoryService;
177     }
178 
179     public AssetCategoryPersistence getAssetCategoryPersistence() {
180         return assetCategoryPersistence;
181     }
182 
183     public void setAssetCategoryPersistence(
184         AssetCategoryPersistence assetCategoryPersistence) {
185         this.assetCategoryPersistence = assetCategoryPersistence;
186     }
187 
188     public AssetCategoryFinder getAssetCategoryFinder() {
189         return assetCategoryFinder;
190     }
191 
192     public void setAssetCategoryFinder(AssetCategoryFinder assetCategoryFinder) {
193         this.assetCategoryFinder = assetCategoryFinder;
194     }
195 
196     public AssetCategoryPropertyLocalService getAssetCategoryPropertyLocalService() {
197         return assetCategoryPropertyLocalService;
198     }
199 
200     public void setAssetCategoryPropertyLocalService(
201         AssetCategoryPropertyLocalService assetCategoryPropertyLocalService) {
202         this.assetCategoryPropertyLocalService = assetCategoryPropertyLocalService;
203     }
204 
205     public AssetCategoryPropertyService getAssetCategoryPropertyService() {
206         return assetCategoryPropertyService;
207     }
208 
209     public void setAssetCategoryPropertyService(
210         AssetCategoryPropertyService assetCategoryPropertyService) {
211         this.assetCategoryPropertyService = assetCategoryPropertyService;
212     }
213 
214     public AssetCategoryPropertyPersistence getAssetCategoryPropertyPersistence() {
215         return assetCategoryPropertyPersistence;
216     }
217 
218     public void setAssetCategoryPropertyPersistence(
219         AssetCategoryPropertyPersistence assetCategoryPropertyPersistence) {
220         this.assetCategoryPropertyPersistence = assetCategoryPropertyPersistence;
221     }
222 
223     public AssetCategoryPropertyFinder getAssetCategoryPropertyFinder() {
224         return assetCategoryPropertyFinder;
225     }
226 
227     public void setAssetCategoryPropertyFinder(
228         AssetCategoryPropertyFinder assetCategoryPropertyFinder) {
229         this.assetCategoryPropertyFinder = assetCategoryPropertyFinder;
230     }
231 
232     public AssetEntryLocalService getAssetEntryLocalService() {
233         return assetEntryLocalService;
234     }
235 
236     public void setAssetEntryLocalService(
237         AssetEntryLocalService assetEntryLocalService) {
238         this.assetEntryLocalService = assetEntryLocalService;
239     }
240 
241     public AssetEntryService getAssetEntryService() {
242         return assetEntryService;
243     }
244 
245     public void setAssetEntryService(AssetEntryService assetEntryService) {
246         this.assetEntryService = assetEntryService;
247     }
248 
249     public AssetEntryPersistence getAssetEntryPersistence() {
250         return assetEntryPersistence;
251     }
252 
253     public void setAssetEntryPersistence(
254         AssetEntryPersistence assetEntryPersistence) {
255         this.assetEntryPersistence = assetEntryPersistence;
256     }
257 
258     public AssetEntryFinder getAssetEntryFinder() {
259         return assetEntryFinder;
260     }
261 
262     public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
263         this.assetEntryFinder = assetEntryFinder;
264     }
265 
266     public AssetLinkLocalService getAssetLinkLocalService() {
267         return assetLinkLocalService;
268     }
269 
270     public void setAssetLinkLocalService(
271         AssetLinkLocalService assetLinkLocalService) {
272         this.assetLinkLocalService = assetLinkLocalService;
273     }
274 
275     public AssetLinkPersistence getAssetLinkPersistence() {
276         return assetLinkPersistence;
277     }
278 
279     public void setAssetLinkPersistence(
280         AssetLinkPersistence assetLinkPersistence) {
281         this.assetLinkPersistence = assetLinkPersistence;
282     }
283 
284     public AssetTagLocalService getAssetTagLocalService() {
285         return assetTagLocalService;
286     }
287 
288     public void setAssetTagLocalService(
289         AssetTagLocalService assetTagLocalService) {
290         this.assetTagLocalService = assetTagLocalService;
291     }
292 
293     public AssetTagService getAssetTagService() {
294         return assetTagService;
295     }
296 
297     public void setAssetTagService(AssetTagService assetTagService) {
298         this.assetTagService = assetTagService;
299     }
300 
301     public AssetTagPersistence getAssetTagPersistence() {
302         return assetTagPersistence;
303     }
304 
305     public void setAssetTagPersistence(AssetTagPersistence assetTagPersistence) {
306         this.assetTagPersistence = assetTagPersistence;
307     }
308 
309     public AssetTagFinder getAssetTagFinder() {
310         return assetTagFinder;
311     }
312 
313     public void setAssetTagFinder(AssetTagFinder assetTagFinder) {
314         this.assetTagFinder = assetTagFinder;
315     }
316 
317     public AssetTagPropertyLocalService getAssetTagPropertyLocalService() {
318         return assetTagPropertyLocalService;
319     }
320 
321     public void setAssetTagPropertyLocalService(
322         AssetTagPropertyLocalService assetTagPropertyLocalService) {
323         this.assetTagPropertyLocalService = assetTagPropertyLocalService;
324     }
325 
326     public AssetTagPropertyService getAssetTagPropertyService() {
327         return assetTagPropertyService;
328     }
329 
330     public void setAssetTagPropertyService(
331         AssetTagPropertyService assetTagPropertyService) {
332         this.assetTagPropertyService = assetTagPropertyService;
333     }
334 
335     public AssetTagPropertyPersistence getAssetTagPropertyPersistence() {
336         return assetTagPropertyPersistence;
337     }
338 
339     public void setAssetTagPropertyPersistence(
340         AssetTagPropertyPersistence assetTagPropertyPersistence) {
341         this.assetTagPropertyPersistence = assetTagPropertyPersistence;
342     }
343 
344     public AssetTagPropertyFinder getAssetTagPropertyFinder() {
345         return assetTagPropertyFinder;
346     }
347 
348     public void setAssetTagPropertyFinder(
349         AssetTagPropertyFinder assetTagPropertyFinder) {
350         this.assetTagPropertyFinder = assetTagPropertyFinder;
351     }
352 
353     public AssetTagPropertyKeyFinder getAssetTagPropertyKeyFinder() {
354         return assetTagPropertyKeyFinder;
355     }
356 
357     public void setAssetTagPropertyKeyFinder(
358         AssetTagPropertyKeyFinder assetTagPropertyKeyFinder) {
359         this.assetTagPropertyKeyFinder = assetTagPropertyKeyFinder;
360     }
361 
362     public AssetTagStatsLocalService getAssetTagStatsLocalService() {
363         return assetTagStatsLocalService;
364     }
365 
366     public void setAssetTagStatsLocalService(
367         AssetTagStatsLocalService assetTagStatsLocalService) {
368         this.assetTagStatsLocalService = assetTagStatsLocalService;
369     }
370 
371     public AssetTagStatsPersistence getAssetTagStatsPersistence() {
372         return assetTagStatsPersistence;
373     }
374 
375     public void setAssetTagStatsPersistence(
376         AssetTagStatsPersistence assetTagStatsPersistence) {
377         this.assetTagStatsPersistence = assetTagStatsPersistence;
378     }
379 
380     public AssetVocabularyLocalService getAssetVocabularyLocalService() {
381         return assetVocabularyLocalService;
382     }
383 
384     public void setAssetVocabularyLocalService(
385         AssetVocabularyLocalService assetVocabularyLocalService) {
386         this.assetVocabularyLocalService = assetVocabularyLocalService;
387     }
388 
389     public AssetVocabularyService getAssetVocabularyService() {
390         return assetVocabularyService;
391     }
392 
393     public void setAssetVocabularyService(
394         AssetVocabularyService assetVocabularyService) {
395         this.assetVocabularyService = assetVocabularyService;
396     }
397 
398     public AssetVocabularyPersistence getAssetVocabularyPersistence() {
399         return assetVocabularyPersistence;
400     }
401 
402     public void setAssetVocabularyPersistence(
403         AssetVocabularyPersistence assetVocabularyPersistence) {
404         this.assetVocabularyPersistence = assetVocabularyPersistence;
405     }
406 
407     public CounterLocalService getCounterLocalService() {
408         return counterLocalService;
409     }
410 
411     public void setCounterLocalService(CounterLocalService counterLocalService) {
412         this.counterLocalService = counterLocalService;
413     }
414 
415     public GroupLocalService getGroupLocalService() {
416         return groupLocalService;
417     }
418 
419     public void setGroupLocalService(GroupLocalService groupLocalService) {
420         this.groupLocalService = groupLocalService;
421     }
422 
423     public GroupService getGroupService() {
424         return groupService;
425     }
426 
427     public void setGroupService(GroupService groupService) {
428         this.groupService = groupService;
429     }
430 
431     public GroupPersistence getGroupPersistence() {
432         return groupPersistence;
433     }
434 
435     public void setGroupPersistence(GroupPersistence groupPersistence) {
436         this.groupPersistence = groupPersistence;
437     }
438 
439     public GroupFinder getGroupFinder() {
440         return groupFinder;
441     }
442 
443     public void setGroupFinder(GroupFinder groupFinder) {
444         this.groupFinder = groupFinder;
445     }
446 
447     public ResourceLocalService getResourceLocalService() {
448         return resourceLocalService;
449     }
450 
451     public void setResourceLocalService(
452         ResourceLocalService resourceLocalService) {
453         this.resourceLocalService = resourceLocalService;
454     }
455 
456     public ResourceService getResourceService() {
457         return resourceService;
458     }
459 
460     public void setResourceService(ResourceService resourceService) {
461         this.resourceService = resourceService;
462     }
463 
464     public ResourcePersistence getResourcePersistence() {
465         return resourcePersistence;
466     }
467 
468     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
469         this.resourcePersistence = resourcePersistence;
470     }
471 
472     public ResourceFinder getResourceFinder() {
473         return resourceFinder;
474     }
475 
476     public void setResourceFinder(ResourceFinder resourceFinder) {
477         this.resourceFinder = resourceFinder;
478     }
479 
480     public UserLocalService getUserLocalService() {
481         return userLocalService;
482     }
483 
484     public void setUserLocalService(UserLocalService userLocalService) {
485         this.userLocalService = userLocalService;
486     }
487 
488     public UserService getUserService() {
489         return userService;
490     }
491 
492     public void setUserService(UserService userService) {
493         this.userService = userService;
494     }
495 
496     public UserPersistence getUserPersistence() {
497         return userPersistence;
498     }
499 
500     public void setUserPersistence(UserPersistence userPersistence) {
501         this.userPersistence = userPersistence;
502     }
503 
504     public UserFinder getUserFinder() {
505         return userFinder;
506     }
507 
508     public void setUserFinder(UserFinder userFinder) {
509         this.userFinder = userFinder;
510     }
511 
512     protected void runSQL(String sql) throws SystemException {
513         try {
514             DataSource dataSource = assetVocabularyPersistence.getDataSource();
515 
516             SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
517                     sql, new int[0]);
518 
519             sqlUpdate.update();
520         }
521         catch (Exception e) {
522             throw new SystemException(e);
523         }
524     }
525 
526     @BeanReference(type = AssetCategoryLocalService.class)
527     protected AssetCategoryLocalService assetCategoryLocalService;
528     @BeanReference(type = AssetCategoryService.class)
529     protected AssetCategoryService assetCategoryService;
530     @BeanReference(type = AssetCategoryPersistence.class)
531     protected AssetCategoryPersistence assetCategoryPersistence;
532     @BeanReference(type = AssetCategoryFinder.class)
533     protected AssetCategoryFinder assetCategoryFinder;
534     @BeanReference(type = AssetCategoryPropertyLocalService.class)
535     protected AssetCategoryPropertyLocalService assetCategoryPropertyLocalService;
536     @BeanReference(type = AssetCategoryPropertyService.class)
537     protected AssetCategoryPropertyService assetCategoryPropertyService;
538     @BeanReference(type = AssetCategoryPropertyPersistence.class)
539     protected AssetCategoryPropertyPersistence assetCategoryPropertyPersistence;
540     @BeanReference(type = AssetCategoryPropertyFinder.class)
541     protected AssetCategoryPropertyFinder assetCategoryPropertyFinder;
542     @BeanReference(type = AssetEntryLocalService.class)
543     protected AssetEntryLocalService assetEntryLocalService;
544     @BeanReference(type = AssetEntryService.class)
545     protected AssetEntryService assetEntryService;
546     @BeanReference(type = AssetEntryPersistence.class)
547     protected AssetEntryPersistence assetEntryPersistence;
548     @BeanReference(type = AssetEntryFinder.class)
549     protected AssetEntryFinder assetEntryFinder;
550     @BeanReference(type = AssetLinkLocalService.class)
551     protected AssetLinkLocalService assetLinkLocalService;
552     @BeanReference(type = AssetLinkPersistence.class)
553     protected AssetLinkPersistence assetLinkPersistence;
554     @BeanReference(type = AssetTagLocalService.class)
555     protected AssetTagLocalService assetTagLocalService;
556     @BeanReference(type = AssetTagService.class)
557     protected AssetTagService assetTagService;
558     @BeanReference(type = AssetTagPersistence.class)
559     protected AssetTagPersistence assetTagPersistence;
560     @BeanReference(type = AssetTagFinder.class)
561     protected AssetTagFinder assetTagFinder;
562     @BeanReference(type = AssetTagPropertyLocalService.class)
563     protected AssetTagPropertyLocalService assetTagPropertyLocalService;
564     @BeanReference(type = AssetTagPropertyService.class)
565     protected AssetTagPropertyService assetTagPropertyService;
566     @BeanReference(type = AssetTagPropertyPersistence.class)
567     protected AssetTagPropertyPersistence assetTagPropertyPersistence;
568     @BeanReference(type = AssetTagPropertyFinder.class)
569     protected AssetTagPropertyFinder assetTagPropertyFinder;
570     @BeanReference(type = AssetTagPropertyKeyFinder.class)
571     protected AssetTagPropertyKeyFinder assetTagPropertyKeyFinder;
572     @BeanReference(type = AssetTagStatsLocalService.class)
573     protected AssetTagStatsLocalService assetTagStatsLocalService;
574     @BeanReference(type = AssetTagStatsPersistence.class)
575     protected AssetTagStatsPersistence assetTagStatsPersistence;
576     @BeanReference(type = AssetVocabularyLocalService.class)
577     protected AssetVocabularyLocalService assetVocabularyLocalService;
578     @BeanReference(type = AssetVocabularyService.class)
579     protected AssetVocabularyService assetVocabularyService;
580     @BeanReference(type = AssetVocabularyPersistence.class)
581     protected AssetVocabularyPersistence assetVocabularyPersistence;
582     @BeanReference(type = CounterLocalService.class)
583     protected CounterLocalService counterLocalService;
584     @BeanReference(type = GroupLocalService.class)
585     protected GroupLocalService groupLocalService;
586     @BeanReference(type = GroupService.class)
587     protected GroupService groupService;
588     @BeanReference(type = GroupPersistence.class)
589     protected GroupPersistence groupPersistence;
590     @BeanReference(type = GroupFinder.class)
591     protected GroupFinder groupFinder;
592     @BeanReference(type = ResourceLocalService.class)
593     protected ResourceLocalService resourceLocalService;
594     @BeanReference(type = ResourceService.class)
595     protected ResourceService resourceService;
596     @BeanReference(type = ResourcePersistence.class)
597     protected ResourcePersistence resourcePersistence;
598     @BeanReference(type = ResourceFinder.class)
599     protected ResourceFinder resourceFinder;
600     @BeanReference(type = UserLocalService.class)
601     protected UserLocalService userLocalService;
602     @BeanReference(type = UserService.class)
603     protected UserService userService;
604     @BeanReference(type = UserPersistence.class)
605     protected UserPersistence userPersistence;
606     @BeanReference(type = UserFinder.class)
607     protected UserFinder userFinder;
608 }