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.journal.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.ImageLocalService;
027    import com.liferay.portal.service.ImageService;
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.ImagePersistence;
033    import com.liferay.portal.service.persistence.ResourceFinder;
034    import com.liferay.portal.service.persistence.ResourcePersistence;
035    import com.liferay.portal.service.persistence.UserFinder;
036    import com.liferay.portal.service.persistence.UserPersistence;
037    
038    import com.liferay.portlet.journal.model.JournalArticleImage;
039    import com.liferay.portlet.journal.service.JournalArticleImageLocalService;
040    import com.liferay.portlet.journal.service.JournalArticleLocalService;
041    import com.liferay.portlet.journal.service.JournalArticleResourceLocalService;
042    import com.liferay.portlet.journal.service.JournalArticleService;
043    import com.liferay.portlet.journal.service.JournalContentSearchLocalService;
044    import com.liferay.portlet.journal.service.JournalFeedLocalService;
045    import com.liferay.portlet.journal.service.JournalFeedService;
046    import com.liferay.portlet.journal.service.JournalStructureLocalService;
047    import com.liferay.portlet.journal.service.JournalStructureService;
048    import com.liferay.portlet.journal.service.JournalTemplateLocalService;
049    import com.liferay.portlet.journal.service.JournalTemplateService;
050    import com.liferay.portlet.journal.service.persistence.JournalArticleFinder;
051    import com.liferay.portlet.journal.service.persistence.JournalArticleImagePersistence;
052    import com.liferay.portlet.journal.service.persistence.JournalArticlePersistence;
053    import com.liferay.portlet.journal.service.persistence.JournalArticleResourcePersistence;
054    import com.liferay.portlet.journal.service.persistence.JournalContentSearchPersistence;
055    import com.liferay.portlet.journal.service.persistence.JournalFeedFinder;
056    import com.liferay.portlet.journal.service.persistence.JournalFeedPersistence;
057    import com.liferay.portlet.journal.service.persistence.JournalStructureFinder;
058    import com.liferay.portlet.journal.service.persistence.JournalStructurePersistence;
059    import com.liferay.portlet.journal.service.persistence.JournalTemplateFinder;
060    import com.liferay.portlet.journal.service.persistence.JournalTemplatePersistence;
061    
062    import java.util.List;
063    
064    import javax.sql.DataSource;
065    
066    /**
067     * @author Brian Wing Shun Chan
068     */
069    public abstract class JournalArticleImageLocalServiceBaseImpl
070            implements JournalArticleImageLocalService {
071            public JournalArticleImage addJournalArticleImage(
072                    JournalArticleImage journalArticleImage) throws SystemException {
073                    journalArticleImage.setNew(true);
074    
075                    return journalArticleImagePersistence.update(journalArticleImage, false);
076            }
077    
078            public JournalArticleImage createJournalArticleImage(long articleImageId) {
079                    return journalArticleImagePersistence.create(articleImageId);
080            }
081    
082            public void deleteJournalArticleImage(long articleImageId)
083                    throws PortalException, SystemException {
084                    journalArticleImagePersistence.remove(articleImageId);
085            }
086    
087            public void deleteJournalArticleImage(
088                    JournalArticleImage journalArticleImage) throws SystemException {
089                    journalArticleImagePersistence.remove(journalArticleImage);
090            }
091    
092            @SuppressWarnings("unchecked")
093            public List dynamicQuery(DynamicQuery dynamicQuery)
094                    throws SystemException {
095                    return journalArticleImagePersistence.findWithDynamicQuery(dynamicQuery);
096            }
097    
098            @SuppressWarnings("unchecked")
099            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
100                    throws SystemException {
101                    return journalArticleImagePersistence.findWithDynamicQuery(dynamicQuery,
102                            start, end);
103            }
104    
105            @SuppressWarnings("unchecked")
106            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
107                    OrderByComparator orderByComparator) throws SystemException {
108                    return journalArticleImagePersistence.findWithDynamicQuery(dynamicQuery,
109                            start, end, orderByComparator);
110            }
111    
112            public long dynamicQueryCount(DynamicQuery dynamicQuery)
113                    throws SystemException {
114                    return journalArticleImagePersistence.countWithDynamicQuery(dynamicQuery);
115            }
116    
117            public JournalArticleImage getJournalArticleImage(long articleImageId)
118                    throws PortalException, SystemException {
119                    return journalArticleImagePersistence.findByPrimaryKey(articleImageId);
120            }
121    
122            public List<JournalArticleImage> getJournalArticleImages(int start, int end)
123                    throws SystemException {
124                    return journalArticleImagePersistence.findAll(start, end);
125            }
126    
127            public int getJournalArticleImagesCount() throws SystemException {
128                    return journalArticleImagePersistence.countAll();
129            }
130    
131            public JournalArticleImage updateJournalArticleImage(
132                    JournalArticleImage journalArticleImage) throws SystemException {
133                    journalArticleImage.setNew(false);
134    
135                    return journalArticleImagePersistence.update(journalArticleImage, true);
136            }
137    
138            public JournalArticleImage updateJournalArticleImage(
139                    JournalArticleImage journalArticleImage, boolean merge)
140                    throws SystemException {
141                    journalArticleImage.setNew(false);
142    
143                    return journalArticleImagePersistence.update(journalArticleImage, merge);
144            }
145    
146            public JournalArticleLocalService getJournalArticleLocalService() {
147                    return journalArticleLocalService;
148            }
149    
150            public void setJournalArticleLocalService(
151                    JournalArticleLocalService journalArticleLocalService) {
152                    this.journalArticleLocalService = journalArticleLocalService;
153            }
154    
155            public JournalArticleService getJournalArticleService() {
156                    return journalArticleService;
157            }
158    
159            public void setJournalArticleService(
160                    JournalArticleService journalArticleService) {
161                    this.journalArticleService = journalArticleService;
162            }
163    
164            public JournalArticlePersistence getJournalArticlePersistence() {
165                    return journalArticlePersistence;
166            }
167    
168            public void setJournalArticlePersistence(
169                    JournalArticlePersistence journalArticlePersistence) {
170                    this.journalArticlePersistence = journalArticlePersistence;
171            }
172    
173            public JournalArticleFinder getJournalArticleFinder() {
174                    return journalArticleFinder;
175            }
176    
177            public void setJournalArticleFinder(
178                    JournalArticleFinder journalArticleFinder) {
179                    this.journalArticleFinder = journalArticleFinder;
180            }
181    
182            public JournalArticleImageLocalService getJournalArticleImageLocalService() {
183                    return journalArticleImageLocalService;
184            }
185    
186            public void setJournalArticleImageLocalService(
187                    JournalArticleImageLocalService journalArticleImageLocalService) {
188                    this.journalArticleImageLocalService = journalArticleImageLocalService;
189            }
190    
191            public JournalArticleImagePersistence getJournalArticleImagePersistence() {
192                    return journalArticleImagePersistence;
193            }
194    
195            public void setJournalArticleImagePersistence(
196                    JournalArticleImagePersistence journalArticleImagePersistence) {
197                    this.journalArticleImagePersistence = journalArticleImagePersistence;
198            }
199    
200            public JournalArticleResourceLocalService getJournalArticleResourceLocalService() {
201                    return journalArticleResourceLocalService;
202            }
203    
204            public void setJournalArticleResourceLocalService(
205                    JournalArticleResourceLocalService journalArticleResourceLocalService) {
206                    this.journalArticleResourceLocalService = journalArticleResourceLocalService;
207            }
208    
209            public JournalArticleResourcePersistence getJournalArticleResourcePersistence() {
210                    return journalArticleResourcePersistence;
211            }
212    
213            public void setJournalArticleResourcePersistence(
214                    JournalArticleResourcePersistence journalArticleResourcePersistence) {
215                    this.journalArticleResourcePersistence = journalArticleResourcePersistence;
216            }
217    
218            public JournalContentSearchLocalService getJournalContentSearchLocalService() {
219                    return journalContentSearchLocalService;
220            }
221    
222            public void setJournalContentSearchLocalService(
223                    JournalContentSearchLocalService journalContentSearchLocalService) {
224                    this.journalContentSearchLocalService = journalContentSearchLocalService;
225            }
226    
227            public JournalContentSearchPersistence getJournalContentSearchPersistence() {
228                    return journalContentSearchPersistence;
229            }
230    
231            public void setJournalContentSearchPersistence(
232                    JournalContentSearchPersistence journalContentSearchPersistence) {
233                    this.journalContentSearchPersistence = journalContentSearchPersistence;
234            }
235    
236            public JournalFeedLocalService getJournalFeedLocalService() {
237                    return journalFeedLocalService;
238            }
239    
240            public void setJournalFeedLocalService(
241                    JournalFeedLocalService journalFeedLocalService) {
242                    this.journalFeedLocalService = journalFeedLocalService;
243            }
244    
245            public JournalFeedService getJournalFeedService() {
246                    return journalFeedService;
247            }
248    
249            public void setJournalFeedService(JournalFeedService journalFeedService) {
250                    this.journalFeedService = journalFeedService;
251            }
252    
253            public JournalFeedPersistence getJournalFeedPersistence() {
254                    return journalFeedPersistence;
255            }
256    
257            public void setJournalFeedPersistence(
258                    JournalFeedPersistence journalFeedPersistence) {
259                    this.journalFeedPersistence = journalFeedPersistence;
260            }
261    
262            public JournalFeedFinder getJournalFeedFinder() {
263                    return journalFeedFinder;
264            }
265    
266            public void setJournalFeedFinder(JournalFeedFinder journalFeedFinder) {
267                    this.journalFeedFinder = journalFeedFinder;
268            }
269    
270            public JournalStructureLocalService getJournalStructureLocalService() {
271                    return journalStructureLocalService;
272            }
273    
274            public void setJournalStructureLocalService(
275                    JournalStructureLocalService journalStructureLocalService) {
276                    this.journalStructureLocalService = journalStructureLocalService;
277            }
278    
279            public JournalStructureService getJournalStructureService() {
280                    return journalStructureService;
281            }
282    
283            public void setJournalStructureService(
284                    JournalStructureService journalStructureService) {
285                    this.journalStructureService = journalStructureService;
286            }
287    
288            public JournalStructurePersistence getJournalStructurePersistence() {
289                    return journalStructurePersistence;
290            }
291    
292            public void setJournalStructurePersistence(
293                    JournalStructurePersistence journalStructurePersistence) {
294                    this.journalStructurePersistence = journalStructurePersistence;
295            }
296    
297            public JournalStructureFinder getJournalStructureFinder() {
298                    return journalStructureFinder;
299            }
300    
301            public void setJournalStructureFinder(
302                    JournalStructureFinder journalStructureFinder) {
303                    this.journalStructureFinder = journalStructureFinder;
304            }
305    
306            public JournalTemplateLocalService getJournalTemplateLocalService() {
307                    return journalTemplateLocalService;
308            }
309    
310            public void setJournalTemplateLocalService(
311                    JournalTemplateLocalService journalTemplateLocalService) {
312                    this.journalTemplateLocalService = journalTemplateLocalService;
313            }
314    
315            public JournalTemplateService getJournalTemplateService() {
316                    return journalTemplateService;
317            }
318    
319            public void setJournalTemplateService(
320                    JournalTemplateService journalTemplateService) {
321                    this.journalTemplateService = journalTemplateService;
322            }
323    
324            public JournalTemplatePersistence getJournalTemplatePersistence() {
325                    return journalTemplatePersistence;
326            }
327    
328            public void setJournalTemplatePersistence(
329                    JournalTemplatePersistence journalTemplatePersistence) {
330                    this.journalTemplatePersistence = journalTemplatePersistence;
331            }
332    
333            public JournalTemplateFinder getJournalTemplateFinder() {
334                    return journalTemplateFinder;
335            }
336    
337            public void setJournalTemplateFinder(
338                    JournalTemplateFinder journalTemplateFinder) {
339                    this.journalTemplateFinder = journalTemplateFinder;
340            }
341    
342            public CounterLocalService getCounterLocalService() {
343                    return counterLocalService;
344            }
345    
346            public void setCounterLocalService(CounterLocalService counterLocalService) {
347                    this.counterLocalService = counterLocalService;
348            }
349    
350            public ImageLocalService getImageLocalService() {
351                    return imageLocalService;
352            }
353    
354            public void setImageLocalService(ImageLocalService imageLocalService) {
355                    this.imageLocalService = imageLocalService;
356            }
357    
358            public ImageService getImageService() {
359                    return imageService;
360            }
361    
362            public void setImageService(ImageService imageService) {
363                    this.imageService = imageService;
364            }
365    
366            public ImagePersistence getImagePersistence() {
367                    return imagePersistence;
368            }
369    
370            public void setImagePersistence(ImagePersistence imagePersistence) {
371                    this.imagePersistence = imagePersistence;
372            }
373    
374            public ResourceLocalService getResourceLocalService() {
375                    return resourceLocalService;
376            }
377    
378            public void setResourceLocalService(
379                    ResourceLocalService resourceLocalService) {
380                    this.resourceLocalService = resourceLocalService;
381            }
382    
383            public ResourceService getResourceService() {
384                    return resourceService;
385            }
386    
387            public void setResourceService(ResourceService resourceService) {
388                    this.resourceService = resourceService;
389            }
390    
391            public ResourcePersistence getResourcePersistence() {
392                    return resourcePersistence;
393            }
394    
395            public void setResourcePersistence(ResourcePersistence resourcePersistence) {
396                    this.resourcePersistence = resourcePersistence;
397            }
398    
399            public ResourceFinder getResourceFinder() {
400                    return resourceFinder;
401            }
402    
403            public void setResourceFinder(ResourceFinder resourceFinder) {
404                    this.resourceFinder = resourceFinder;
405            }
406    
407            public UserLocalService getUserLocalService() {
408                    return userLocalService;
409            }
410    
411            public void setUserLocalService(UserLocalService userLocalService) {
412                    this.userLocalService = userLocalService;
413            }
414    
415            public UserService getUserService() {
416                    return userService;
417            }
418    
419            public void setUserService(UserService userService) {
420                    this.userService = userService;
421            }
422    
423            public UserPersistence getUserPersistence() {
424                    return userPersistence;
425            }
426    
427            public void setUserPersistence(UserPersistence userPersistence) {
428                    this.userPersistence = userPersistence;
429            }
430    
431            public UserFinder getUserFinder() {
432                    return userFinder;
433            }
434    
435            public void setUserFinder(UserFinder userFinder) {
436                    this.userFinder = userFinder;
437            }
438    
439            protected void runSQL(String sql) throws SystemException {
440                    try {
441                            DataSource dataSource = journalArticleImagePersistence.getDataSource();
442    
443                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
444                                            sql, new int[0]);
445    
446                            sqlUpdate.update();
447                    }
448                    catch (Exception e) {
449                            throw new SystemException(e);
450                    }
451            }
452    
453            @BeanReference(type = JournalArticleLocalService.class)
454            protected JournalArticleLocalService journalArticleLocalService;
455            @BeanReference(type = JournalArticleService.class)
456            protected JournalArticleService journalArticleService;
457            @BeanReference(type = JournalArticlePersistence.class)
458            protected JournalArticlePersistence journalArticlePersistence;
459            @BeanReference(type = JournalArticleFinder.class)
460            protected JournalArticleFinder journalArticleFinder;
461            @BeanReference(type = JournalArticleImageLocalService.class)
462            protected JournalArticleImageLocalService journalArticleImageLocalService;
463            @BeanReference(type = JournalArticleImagePersistence.class)
464            protected JournalArticleImagePersistence journalArticleImagePersistence;
465            @BeanReference(type = JournalArticleResourceLocalService.class)
466            protected JournalArticleResourceLocalService journalArticleResourceLocalService;
467            @BeanReference(type = JournalArticleResourcePersistence.class)
468            protected JournalArticleResourcePersistence journalArticleResourcePersistence;
469            @BeanReference(type = JournalContentSearchLocalService.class)
470            protected JournalContentSearchLocalService journalContentSearchLocalService;
471            @BeanReference(type = JournalContentSearchPersistence.class)
472            protected JournalContentSearchPersistence journalContentSearchPersistence;
473            @BeanReference(type = JournalFeedLocalService.class)
474            protected JournalFeedLocalService journalFeedLocalService;
475            @BeanReference(type = JournalFeedService.class)
476            protected JournalFeedService journalFeedService;
477            @BeanReference(type = JournalFeedPersistence.class)
478            protected JournalFeedPersistence journalFeedPersistence;
479            @BeanReference(type = JournalFeedFinder.class)
480            protected JournalFeedFinder journalFeedFinder;
481            @BeanReference(type = JournalStructureLocalService.class)
482            protected JournalStructureLocalService journalStructureLocalService;
483            @BeanReference(type = JournalStructureService.class)
484            protected JournalStructureService journalStructureService;
485            @BeanReference(type = JournalStructurePersistence.class)
486            protected JournalStructurePersistence journalStructurePersistence;
487            @BeanReference(type = JournalStructureFinder.class)
488            protected JournalStructureFinder journalStructureFinder;
489            @BeanReference(type = JournalTemplateLocalService.class)
490            protected JournalTemplateLocalService journalTemplateLocalService;
491            @BeanReference(type = JournalTemplateService.class)
492            protected JournalTemplateService journalTemplateService;
493            @BeanReference(type = JournalTemplatePersistence.class)
494            protected JournalTemplatePersistence journalTemplatePersistence;
495            @BeanReference(type = JournalTemplateFinder.class)
496            protected JournalTemplateFinder journalTemplateFinder;
497            @BeanReference(type = CounterLocalService.class)
498            protected CounterLocalService counterLocalService;
499            @BeanReference(type = ImageLocalService.class)
500            protected ImageLocalService imageLocalService;
501            @BeanReference(type = ImageService.class)
502            protected ImageService imageService;
503            @BeanReference(type = ImagePersistence.class)
504            protected ImagePersistence imagePersistence;
505            @BeanReference(type = ResourceLocalService.class)
506            protected ResourceLocalService resourceLocalService;
507            @BeanReference(type = ResourceService.class)
508            protected ResourceService resourceService;
509            @BeanReference(type = ResourcePersistence.class)
510            protected ResourcePersistence resourcePersistence;
511            @BeanReference(type = ResourceFinder.class)
512            protected ResourceFinder resourceFinder;
513            @BeanReference(type = UserLocalService.class)
514            protected UserLocalService userLocalService;
515            @BeanReference(type = UserService.class)
516            protected UserService userService;
517            @BeanReference(type = UserPersistence.class)
518            protected UserPersistence userPersistence;
519            @BeanReference(type = UserFinder.class)
520            protected UserFinder userFinder;
521    }