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.ResourceLocalService;
027    import com.liferay.portal.service.ResourceService;
028    import com.liferay.portal.service.UserLocalService;
029    import com.liferay.portal.service.UserService;
030    import com.liferay.portal.service.persistence.ResourceFinder;
031    import com.liferay.portal.service.persistence.ResourcePersistence;
032    import com.liferay.portal.service.persistence.UserFinder;
033    import com.liferay.portal.service.persistence.UserPersistence;
034    
035    import com.liferay.portlet.asset.model.AssetTag;
036    import com.liferay.portlet.asset.service.AssetCategoryLocalService;
037    import com.liferay.portlet.asset.service.AssetCategoryPropertyLocalService;
038    import com.liferay.portlet.asset.service.AssetCategoryPropertyService;
039    import com.liferay.portlet.asset.service.AssetCategoryService;
040    import com.liferay.portlet.asset.service.AssetEntryLocalService;
041    import com.liferay.portlet.asset.service.AssetEntryService;
042    import com.liferay.portlet.asset.service.AssetLinkLocalService;
043    import com.liferay.portlet.asset.service.AssetTagLocalService;
044    import com.liferay.portlet.asset.service.AssetTagPropertyLocalService;
045    import com.liferay.portlet.asset.service.AssetTagPropertyService;
046    import com.liferay.portlet.asset.service.AssetTagService;
047    import com.liferay.portlet.asset.service.AssetTagStatsLocalService;
048    import com.liferay.portlet.asset.service.AssetVocabularyLocalService;
049    import com.liferay.portlet.asset.service.AssetVocabularyService;
050    import com.liferay.portlet.asset.service.persistence.AssetCategoryFinder;
051    import com.liferay.portlet.asset.service.persistence.AssetCategoryPersistence;
052    import com.liferay.portlet.asset.service.persistence.AssetCategoryPropertyFinder;
053    import com.liferay.portlet.asset.service.persistence.AssetCategoryPropertyPersistence;
054    import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
055    import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
056    import com.liferay.portlet.asset.service.persistence.AssetLinkPersistence;
057    import com.liferay.portlet.asset.service.persistence.AssetTagFinder;
058    import com.liferay.portlet.asset.service.persistence.AssetTagPersistence;
059    import com.liferay.portlet.asset.service.persistence.AssetTagPropertyFinder;
060    import com.liferay.portlet.asset.service.persistence.AssetTagPropertyKeyFinder;
061    import com.liferay.portlet.asset.service.persistence.AssetTagPropertyPersistence;
062    import com.liferay.portlet.asset.service.persistence.AssetTagStatsPersistence;
063    import com.liferay.portlet.asset.service.persistence.AssetVocabularyPersistence;
064    
065    import java.util.List;
066    
067    import javax.sql.DataSource;
068    
069    /**
070     * @author Brian Wing Shun Chan
071     */
072    public abstract class AssetTagLocalServiceBaseImpl
073            implements AssetTagLocalService {
074            public AssetTag addAssetTag(AssetTag assetTag) throws SystemException {
075                    assetTag.setNew(true);
076    
077                    return assetTagPersistence.update(assetTag, false);
078            }
079    
080            public AssetTag createAssetTag(long tagId) {
081                    return assetTagPersistence.create(tagId);
082            }
083    
084            public void deleteAssetTag(long tagId)
085                    throws PortalException, SystemException {
086                    assetTagPersistence.remove(tagId);
087            }
088    
089            public void deleteAssetTag(AssetTag assetTag) throws SystemException {
090                    assetTagPersistence.remove(assetTag);
091            }
092    
093            @SuppressWarnings("unchecked")
094            public List dynamicQuery(DynamicQuery dynamicQuery)
095                    throws SystemException {
096                    return assetTagPersistence.findWithDynamicQuery(dynamicQuery);
097            }
098    
099            @SuppressWarnings("unchecked")
100            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
101                    throws SystemException {
102                    return assetTagPersistence.findWithDynamicQuery(dynamicQuery, start, end);
103            }
104    
105            @SuppressWarnings("unchecked")
106            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
107                    OrderByComparator orderByComparator) throws SystemException {
108                    return assetTagPersistence.findWithDynamicQuery(dynamicQuery, start,
109                            end, orderByComparator);
110            }
111    
112            public long dynamicQueryCount(DynamicQuery dynamicQuery)
113                    throws SystemException {
114                    return assetTagPersistence.countWithDynamicQuery(dynamicQuery);
115            }
116    
117            public AssetTag getAssetTag(long tagId)
118                    throws PortalException, SystemException {
119                    return assetTagPersistence.findByPrimaryKey(tagId);
120            }
121    
122            public List<AssetTag> getAssetTags(int start, int end)
123                    throws SystemException {
124                    return assetTagPersistence.findAll(start, end);
125            }
126    
127            public int getAssetTagsCount() throws SystemException {
128                    return assetTagPersistence.countAll();
129            }
130    
131            public AssetTag updateAssetTag(AssetTag assetTag) throws SystemException {
132                    assetTag.setNew(false);
133    
134                    return assetTagPersistence.update(assetTag, true);
135            }
136    
137            public AssetTag updateAssetTag(AssetTag assetTag, boolean merge)
138                    throws SystemException {
139                    assetTag.setNew(false);
140    
141                    return assetTagPersistence.update(assetTag, merge);
142            }
143    
144            public AssetCategoryLocalService getAssetCategoryLocalService() {
145                    return assetCategoryLocalService;
146            }
147    
148            public void setAssetCategoryLocalService(
149                    AssetCategoryLocalService assetCategoryLocalService) {
150                    this.assetCategoryLocalService = assetCategoryLocalService;
151            }
152    
153            public AssetCategoryService getAssetCategoryService() {
154                    return assetCategoryService;
155            }
156    
157            public void setAssetCategoryService(
158                    AssetCategoryService assetCategoryService) {
159                    this.assetCategoryService = assetCategoryService;
160            }
161    
162            public AssetCategoryPersistence getAssetCategoryPersistence() {
163                    return assetCategoryPersistence;
164            }
165    
166            public void setAssetCategoryPersistence(
167                    AssetCategoryPersistence assetCategoryPersistence) {
168                    this.assetCategoryPersistence = assetCategoryPersistence;
169            }
170    
171            public AssetCategoryFinder getAssetCategoryFinder() {
172                    return assetCategoryFinder;
173            }
174    
175            public void setAssetCategoryFinder(AssetCategoryFinder assetCategoryFinder) {
176                    this.assetCategoryFinder = assetCategoryFinder;
177            }
178    
179            public AssetCategoryPropertyLocalService getAssetCategoryPropertyLocalService() {
180                    return assetCategoryPropertyLocalService;
181            }
182    
183            public void setAssetCategoryPropertyLocalService(
184                    AssetCategoryPropertyLocalService assetCategoryPropertyLocalService) {
185                    this.assetCategoryPropertyLocalService = assetCategoryPropertyLocalService;
186            }
187    
188            public AssetCategoryPropertyService getAssetCategoryPropertyService() {
189                    return assetCategoryPropertyService;
190            }
191    
192            public void setAssetCategoryPropertyService(
193                    AssetCategoryPropertyService assetCategoryPropertyService) {
194                    this.assetCategoryPropertyService = assetCategoryPropertyService;
195            }
196    
197            public AssetCategoryPropertyPersistence getAssetCategoryPropertyPersistence() {
198                    return assetCategoryPropertyPersistence;
199            }
200    
201            public void setAssetCategoryPropertyPersistence(
202                    AssetCategoryPropertyPersistence assetCategoryPropertyPersistence) {
203                    this.assetCategoryPropertyPersistence = assetCategoryPropertyPersistence;
204            }
205    
206            public AssetCategoryPropertyFinder getAssetCategoryPropertyFinder() {
207                    return assetCategoryPropertyFinder;
208            }
209    
210            public void setAssetCategoryPropertyFinder(
211                    AssetCategoryPropertyFinder assetCategoryPropertyFinder) {
212                    this.assetCategoryPropertyFinder = assetCategoryPropertyFinder;
213            }
214    
215            public AssetEntryLocalService getAssetEntryLocalService() {
216                    return assetEntryLocalService;
217            }
218    
219            public void setAssetEntryLocalService(
220                    AssetEntryLocalService assetEntryLocalService) {
221                    this.assetEntryLocalService = assetEntryLocalService;
222            }
223    
224            public AssetEntryService getAssetEntryService() {
225                    return assetEntryService;
226            }
227    
228            public void setAssetEntryService(AssetEntryService assetEntryService) {
229                    this.assetEntryService = assetEntryService;
230            }
231    
232            public AssetEntryPersistence getAssetEntryPersistence() {
233                    return assetEntryPersistence;
234            }
235    
236            public void setAssetEntryPersistence(
237                    AssetEntryPersistence assetEntryPersistence) {
238                    this.assetEntryPersistence = assetEntryPersistence;
239            }
240    
241            public AssetEntryFinder getAssetEntryFinder() {
242                    return assetEntryFinder;
243            }
244    
245            public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
246                    this.assetEntryFinder = assetEntryFinder;
247            }
248    
249            public AssetLinkLocalService getAssetLinkLocalService() {
250                    return assetLinkLocalService;
251            }
252    
253            public void setAssetLinkLocalService(
254                    AssetLinkLocalService assetLinkLocalService) {
255                    this.assetLinkLocalService = assetLinkLocalService;
256            }
257    
258            public AssetLinkPersistence getAssetLinkPersistence() {
259                    return assetLinkPersistence;
260            }
261    
262            public void setAssetLinkPersistence(
263                    AssetLinkPersistence assetLinkPersistence) {
264                    this.assetLinkPersistence = assetLinkPersistence;
265            }
266    
267            public AssetTagLocalService getAssetTagLocalService() {
268                    return assetTagLocalService;
269            }
270    
271            public void setAssetTagLocalService(
272                    AssetTagLocalService assetTagLocalService) {
273                    this.assetTagLocalService = assetTagLocalService;
274            }
275    
276            public AssetTagService getAssetTagService() {
277                    return assetTagService;
278            }
279    
280            public void setAssetTagService(AssetTagService assetTagService) {
281                    this.assetTagService = assetTagService;
282            }
283    
284            public AssetTagPersistence getAssetTagPersistence() {
285                    return assetTagPersistence;
286            }
287    
288            public void setAssetTagPersistence(AssetTagPersistence assetTagPersistence) {
289                    this.assetTagPersistence = assetTagPersistence;
290            }
291    
292            public AssetTagFinder getAssetTagFinder() {
293                    return assetTagFinder;
294            }
295    
296            public void setAssetTagFinder(AssetTagFinder assetTagFinder) {
297                    this.assetTagFinder = assetTagFinder;
298            }
299    
300            public AssetTagPropertyLocalService getAssetTagPropertyLocalService() {
301                    return assetTagPropertyLocalService;
302            }
303    
304            public void setAssetTagPropertyLocalService(
305                    AssetTagPropertyLocalService assetTagPropertyLocalService) {
306                    this.assetTagPropertyLocalService = assetTagPropertyLocalService;
307            }
308    
309            public AssetTagPropertyService getAssetTagPropertyService() {
310                    return assetTagPropertyService;
311            }
312    
313            public void setAssetTagPropertyService(
314                    AssetTagPropertyService assetTagPropertyService) {
315                    this.assetTagPropertyService = assetTagPropertyService;
316            }
317    
318            public AssetTagPropertyPersistence getAssetTagPropertyPersistence() {
319                    return assetTagPropertyPersistence;
320            }
321    
322            public void setAssetTagPropertyPersistence(
323                    AssetTagPropertyPersistence assetTagPropertyPersistence) {
324                    this.assetTagPropertyPersistence = assetTagPropertyPersistence;
325            }
326    
327            public AssetTagPropertyFinder getAssetTagPropertyFinder() {
328                    return assetTagPropertyFinder;
329            }
330    
331            public void setAssetTagPropertyFinder(
332                    AssetTagPropertyFinder assetTagPropertyFinder) {
333                    this.assetTagPropertyFinder = assetTagPropertyFinder;
334            }
335    
336            public AssetTagPropertyKeyFinder getAssetTagPropertyKeyFinder() {
337                    return assetTagPropertyKeyFinder;
338            }
339    
340            public void setAssetTagPropertyKeyFinder(
341                    AssetTagPropertyKeyFinder assetTagPropertyKeyFinder) {
342                    this.assetTagPropertyKeyFinder = assetTagPropertyKeyFinder;
343            }
344    
345            public AssetTagStatsLocalService getAssetTagStatsLocalService() {
346                    return assetTagStatsLocalService;
347            }
348    
349            public void setAssetTagStatsLocalService(
350                    AssetTagStatsLocalService assetTagStatsLocalService) {
351                    this.assetTagStatsLocalService = assetTagStatsLocalService;
352            }
353    
354            public AssetTagStatsPersistence getAssetTagStatsPersistence() {
355                    return assetTagStatsPersistence;
356            }
357    
358            public void setAssetTagStatsPersistence(
359                    AssetTagStatsPersistence assetTagStatsPersistence) {
360                    this.assetTagStatsPersistence = assetTagStatsPersistence;
361            }
362    
363            public AssetVocabularyLocalService getAssetVocabularyLocalService() {
364                    return assetVocabularyLocalService;
365            }
366    
367            public void setAssetVocabularyLocalService(
368                    AssetVocabularyLocalService assetVocabularyLocalService) {
369                    this.assetVocabularyLocalService = assetVocabularyLocalService;
370            }
371    
372            public AssetVocabularyService getAssetVocabularyService() {
373                    return assetVocabularyService;
374            }
375    
376            public void setAssetVocabularyService(
377                    AssetVocabularyService assetVocabularyService) {
378                    this.assetVocabularyService = assetVocabularyService;
379            }
380    
381            public AssetVocabularyPersistence getAssetVocabularyPersistence() {
382                    return assetVocabularyPersistence;
383            }
384    
385            public void setAssetVocabularyPersistence(
386                    AssetVocabularyPersistence assetVocabularyPersistence) {
387                    this.assetVocabularyPersistence = assetVocabularyPersistence;
388            }
389    
390            public CounterLocalService getCounterLocalService() {
391                    return counterLocalService;
392            }
393    
394            public void setCounterLocalService(CounterLocalService counterLocalService) {
395                    this.counterLocalService = counterLocalService;
396            }
397    
398            public ResourceLocalService getResourceLocalService() {
399                    return resourceLocalService;
400            }
401    
402            public void setResourceLocalService(
403                    ResourceLocalService resourceLocalService) {
404                    this.resourceLocalService = resourceLocalService;
405            }
406    
407            public ResourceService getResourceService() {
408                    return resourceService;
409            }
410    
411            public void setResourceService(ResourceService resourceService) {
412                    this.resourceService = resourceService;
413            }
414    
415            public ResourcePersistence getResourcePersistence() {
416                    return resourcePersistence;
417            }
418    
419            public void setResourcePersistence(ResourcePersistence resourcePersistence) {
420                    this.resourcePersistence = resourcePersistence;
421            }
422    
423            public ResourceFinder getResourceFinder() {
424                    return resourceFinder;
425            }
426    
427            public void setResourceFinder(ResourceFinder resourceFinder) {
428                    this.resourceFinder = resourceFinder;
429            }
430    
431            public UserLocalService getUserLocalService() {
432                    return userLocalService;
433            }
434    
435            public void setUserLocalService(UserLocalService userLocalService) {
436                    this.userLocalService = userLocalService;
437            }
438    
439            public UserService getUserService() {
440                    return userService;
441            }
442    
443            public void setUserService(UserService userService) {
444                    this.userService = userService;
445            }
446    
447            public UserPersistence getUserPersistence() {
448                    return userPersistence;
449            }
450    
451            public void setUserPersistence(UserPersistence userPersistence) {
452                    this.userPersistence = userPersistence;
453            }
454    
455            public UserFinder getUserFinder() {
456                    return userFinder;
457            }
458    
459            public void setUserFinder(UserFinder userFinder) {
460                    this.userFinder = userFinder;
461            }
462    
463            protected void runSQL(String sql) throws SystemException {
464                    try {
465                            DataSource dataSource = assetTagPersistence.getDataSource();
466    
467                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
468                                            sql, new int[0]);
469    
470                            sqlUpdate.update();
471                    }
472                    catch (Exception e) {
473                            throw new SystemException(e);
474                    }
475            }
476    
477            @BeanReference(type = AssetCategoryLocalService.class)
478            protected AssetCategoryLocalService assetCategoryLocalService;
479            @BeanReference(type = AssetCategoryService.class)
480            protected AssetCategoryService assetCategoryService;
481            @BeanReference(type = AssetCategoryPersistence.class)
482            protected AssetCategoryPersistence assetCategoryPersistence;
483            @BeanReference(type = AssetCategoryFinder.class)
484            protected AssetCategoryFinder assetCategoryFinder;
485            @BeanReference(type = AssetCategoryPropertyLocalService.class)
486            protected AssetCategoryPropertyLocalService assetCategoryPropertyLocalService;
487            @BeanReference(type = AssetCategoryPropertyService.class)
488            protected AssetCategoryPropertyService assetCategoryPropertyService;
489            @BeanReference(type = AssetCategoryPropertyPersistence.class)
490            protected AssetCategoryPropertyPersistence assetCategoryPropertyPersistence;
491            @BeanReference(type = AssetCategoryPropertyFinder.class)
492            protected AssetCategoryPropertyFinder assetCategoryPropertyFinder;
493            @BeanReference(type = AssetEntryLocalService.class)
494            protected AssetEntryLocalService assetEntryLocalService;
495            @BeanReference(type = AssetEntryService.class)
496            protected AssetEntryService assetEntryService;
497            @BeanReference(type = AssetEntryPersistence.class)
498            protected AssetEntryPersistence assetEntryPersistence;
499            @BeanReference(type = AssetEntryFinder.class)
500            protected AssetEntryFinder assetEntryFinder;
501            @BeanReference(type = AssetLinkLocalService.class)
502            protected AssetLinkLocalService assetLinkLocalService;
503            @BeanReference(type = AssetLinkPersistence.class)
504            protected AssetLinkPersistence assetLinkPersistence;
505            @BeanReference(type = AssetTagLocalService.class)
506            protected AssetTagLocalService assetTagLocalService;
507            @BeanReference(type = AssetTagService.class)
508            protected AssetTagService assetTagService;
509            @BeanReference(type = AssetTagPersistence.class)
510            protected AssetTagPersistence assetTagPersistence;
511            @BeanReference(type = AssetTagFinder.class)
512            protected AssetTagFinder assetTagFinder;
513            @BeanReference(type = AssetTagPropertyLocalService.class)
514            protected AssetTagPropertyLocalService assetTagPropertyLocalService;
515            @BeanReference(type = AssetTagPropertyService.class)
516            protected AssetTagPropertyService assetTagPropertyService;
517            @BeanReference(type = AssetTagPropertyPersistence.class)
518            protected AssetTagPropertyPersistence assetTagPropertyPersistence;
519            @BeanReference(type = AssetTagPropertyFinder.class)
520            protected AssetTagPropertyFinder assetTagPropertyFinder;
521            @BeanReference(type = AssetTagPropertyKeyFinder.class)
522            protected AssetTagPropertyKeyFinder assetTagPropertyKeyFinder;
523            @BeanReference(type = AssetTagStatsLocalService.class)
524            protected AssetTagStatsLocalService assetTagStatsLocalService;
525            @BeanReference(type = AssetTagStatsPersistence.class)
526            protected AssetTagStatsPersistence assetTagStatsPersistence;
527            @BeanReference(type = AssetVocabularyLocalService.class)
528            protected AssetVocabularyLocalService assetVocabularyLocalService;
529            @BeanReference(type = AssetVocabularyService.class)
530            protected AssetVocabularyService assetVocabularyService;
531            @BeanReference(type = AssetVocabularyPersistence.class)
532            protected AssetVocabularyPersistence assetVocabularyPersistence;
533            @BeanReference(type = CounterLocalService.class)
534            protected CounterLocalService counterLocalService;
535            @BeanReference(type = ResourceLocalService.class)
536            protected ResourceLocalService resourceLocalService;
537            @BeanReference(type = ResourceService.class)
538            protected ResourceService resourceService;
539            @BeanReference(type = ResourcePersistence.class)
540            protected ResourcePersistence resourcePersistence;
541            @BeanReference(type = ResourceFinder.class)
542            protected ResourceFinder resourceFinder;
543            @BeanReference(type = UserLocalService.class)
544            protected UserLocalService userLocalService;
545            @BeanReference(type = UserService.class)
546            protected UserService userService;
547            @BeanReference(type = UserPersistence.class)
548            protected UserPersistence userPersistence;
549            @BeanReference(type = UserFinder.class)
550            protected UserFinder userFinder;
551    }