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