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