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