1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.journal.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  
19  import com.liferay.portal.kernel.annotation.BeanReference;
20  import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
21  import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
22  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
23  import com.liferay.portal.kernel.exception.PortalException;
24  import com.liferay.portal.kernel.exception.SystemException;
25  import com.liferay.portal.kernel.util.OrderByComparator;
26  import com.liferay.portal.service.ImageLocalService;
27  import com.liferay.portal.service.ImageService;
28  import com.liferay.portal.service.ResourceLocalService;
29  import com.liferay.portal.service.ResourceService;
30  import com.liferay.portal.service.UserLocalService;
31  import com.liferay.portal.service.UserService;
32  import com.liferay.portal.service.persistence.ImagePersistence;
33  import com.liferay.portal.service.persistence.ResourceFinder;
34  import com.liferay.portal.service.persistence.ResourcePersistence;
35  import com.liferay.portal.service.persistence.UserFinder;
36  import com.liferay.portal.service.persistence.UserPersistence;
37  
38  import com.liferay.portlet.journal.model.JournalArticleImage;
39  import com.liferay.portlet.journal.service.JournalArticleImageLocalService;
40  import com.liferay.portlet.journal.service.JournalArticleLocalService;
41  import com.liferay.portlet.journal.service.JournalArticleResourceLocalService;
42  import com.liferay.portlet.journal.service.JournalArticleService;
43  import com.liferay.portlet.journal.service.JournalContentSearchLocalService;
44  import com.liferay.portlet.journal.service.JournalFeedLocalService;
45  import com.liferay.portlet.journal.service.JournalFeedService;
46  import com.liferay.portlet.journal.service.JournalStructureLocalService;
47  import com.liferay.portlet.journal.service.JournalStructureService;
48  import com.liferay.portlet.journal.service.JournalTemplateLocalService;
49  import com.liferay.portlet.journal.service.JournalTemplateService;
50  import com.liferay.portlet.journal.service.persistence.JournalArticleFinder;
51  import com.liferay.portlet.journal.service.persistence.JournalArticleImagePersistence;
52  import com.liferay.portlet.journal.service.persistence.JournalArticlePersistence;
53  import com.liferay.portlet.journal.service.persistence.JournalArticleResourcePersistence;
54  import com.liferay.portlet.journal.service.persistence.JournalContentSearchPersistence;
55  import com.liferay.portlet.journal.service.persistence.JournalFeedFinder;
56  import com.liferay.portlet.journal.service.persistence.JournalFeedPersistence;
57  import com.liferay.portlet.journal.service.persistence.JournalStructureFinder;
58  import com.liferay.portlet.journal.service.persistence.JournalStructurePersistence;
59  import com.liferay.portlet.journal.service.persistence.JournalTemplateFinder;
60  import com.liferay.portlet.journal.service.persistence.JournalTemplatePersistence;
61  
62  import java.util.List;
63  
64  import javax.sql.DataSource;
65  
66  /**
67   * <a href="JournalArticleImageLocalServiceBaseImpl.java.html"><b><i>View Source
68   * </i></b></a>
69   *
70   * @author Brian Wing Shun Chan
71   */
72  public abstract class JournalArticleImageLocalServiceBaseImpl
73      implements JournalArticleImageLocalService {
74      public JournalArticleImage addJournalArticleImage(
75          JournalArticleImage journalArticleImage) throws SystemException {
76          journalArticleImage.setNew(true);
77  
78          return journalArticleImagePersistence.update(journalArticleImage, false);
79      }
80  
81      public JournalArticleImage createJournalArticleImage(long articleImageId) {
82          return journalArticleImagePersistence.create(articleImageId);
83      }
84  
85      public void deleteJournalArticleImage(long articleImageId)
86          throws PortalException, SystemException {
87          journalArticleImagePersistence.remove(articleImageId);
88      }
89  
90      public void deleteJournalArticleImage(
91          JournalArticleImage journalArticleImage) throws SystemException {
92          journalArticleImagePersistence.remove(journalArticleImage);
93      }
94  
95      @SuppressWarnings("unchecked")
96      public List dynamicQuery(DynamicQuery dynamicQuery)
97          throws SystemException {
98          return journalArticleImagePersistence.findWithDynamicQuery(dynamicQuery);
99      }
100 
101     @SuppressWarnings("unchecked")
102     public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
103         throws SystemException {
104         return journalArticleImagePersistence.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 journalArticleImagePersistence.findWithDynamicQuery(dynamicQuery,
112             start, end, orderByComparator);
113     }
114 
115     public long dynamicQueryCount(DynamicQuery dynamicQuery)
116         throws SystemException {
117         return journalArticleImagePersistence.countWithDynamicQuery(dynamicQuery);
118     }
119 
120     public JournalArticleImage getJournalArticleImage(long articleImageId)
121         throws PortalException, SystemException {
122         return journalArticleImagePersistence.findByPrimaryKey(articleImageId);
123     }
124 
125     public List<JournalArticleImage> getJournalArticleImages(int start, int end)
126         throws SystemException {
127         return journalArticleImagePersistence.findAll(start, end);
128     }
129 
130     public int getJournalArticleImagesCount() throws SystemException {
131         return journalArticleImagePersistence.countAll();
132     }
133 
134     public JournalArticleImage updateJournalArticleImage(
135         JournalArticleImage journalArticleImage) throws SystemException {
136         journalArticleImage.setNew(false);
137 
138         return journalArticleImagePersistence.update(journalArticleImage, true);
139     }
140 
141     public JournalArticleImage updateJournalArticleImage(
142         JournalArticleImage journalArticleImage, boolean merge)
143         throws SystemException {
144         journalArticleImage.setNew(false);
145 
146         return journalArticleImagePersistence.update(journalArticleImage, merge);
147     }
148 
149     public JournalArticleLocalService getJournalArticleLocalService() {
150         return journalArticleLocalService;
151     }
152 
153     public void setJournalArticleLocalService(
154         JournalArticleLocalService journalArticleLocalService) {
155         this.journalArticleLocalService = journalArticleLocalService;
156     }
157 
158     public JournalArticleService getJournalArticleService() {
159         return journalArticleService;
160     }
161 
162     public void setJournalArticleService(
163         JournalArticleService journalArticleService) {
164         this.journalArticleService = journalArticleService;
165     }
166 
167     public JournalArticlePersistence getJournalArticlePersistence() {
168         return journalArticlePersistence;
169     }
170 
171     public void setJournalArticlePersistence(
172         JournalArticlePersistence journalArticlePersistence) {
173         this.journalArticlePersistence = journalArticlePersistence;
174     }
175 
176     public JournalArticleFinder getJournalArticleFinder() {
177         return journalArticleFinder;
178     }
179 
180     public void setJournalArticleFinder(
181         JournalArticleFinder journalArticleFinder) {
182         this.journalArticleFinder = journalArticleFinder;
183     }
184 
185     public JournalArticleImageLocalService getJournalArticleImageLocalService() {
186         return journalArticleImageLocalService;
187     }
188 
189     public void setJournalArticleImageLocalService(
190         JournalArticleImageLocalService journalArticleImageLocalService) {
191         this.journalArticleImageLocalService = journalArticleImageLocalService;
192     }
193 
194     public JournalArticleImagePersistence getJournalArticleImagePersistence() {
195         return journalArticleImagePersistence;
196     }
197 
198     public void setJournalArticleImagePersistence(
199         JournalArticleImagePersistence journalArticleImagePersistence) {
200         this.journalArticleImagePersistence = journalArticleImagePersistence;
201     }
202 
203     public JournalArticleResourceLocalService getJournalArticleResourceLocalService() {
204         return journalArticleResourceLocalService;
205     }
206 
207     public void setJournalArticleResourceLocalService(
208         JournalArticleResourceLocalService journalArticleResourceLocalService) {
209         this.journalArticleResourceLocalService = journalArticleResourceLocalService;
210     }
211 
212     public JournalArticleResourcePersistence getJournalArticleResourcePersistence() {
213         return journalArticleResourcePersistence;
214     }
215 
216     public void setJournalArticleResourcePersistence(
217         JournalArticleResourcePersistence journalArticleResourcePersistence) {
218         this.journalArticleResourcePersistence = journalArticleResourcePersistence;
219     }
220 
221     public JournalContentSearchLocalService getJournalContentSearchLocalService() {
222         return journalContentSearchLocalService;
223     }
224 
225     public void setJournalContentSearchLocalService(
226         JournalContentSearchLocalService journalContentSearchLocalService) {
227         this.journalContentSearchLocalService = journalContentSearchLocalService;
228     }
229 
230     public JournalContentSearchPersistence getJournalContentSearchPersistence() {
231         return journalContentSearchPersistence;
232     }
233 
234     public void setJournalContentSearchPersistence(
235         JournalContentSearchPersistence journalContentSearchPersistence) {
236         this.journalContentSearchPersistence = journalContentSearchPersistence;
237     }
238 
239     public JournalFeedLocalService getJournalFeedLocalService() {
240         return journalFeedLocalService;
241     }
242 
243     public void setJournalFeedLocalService(
244         JournalFeedLocalService journalFeedLocalService) {
245         this.journalFeedLocalService = journalFeedLocalService;
246     }
247 
248     public JournalFeedService getJournalFeedService() {
249         return journalFeedService;
250     }
251 
252     public void setJournalFeedService(JournalFeedService journalFeedService) {
253         this.journalFeedService = journalFeedService;
254     }
255 
256     public JournalFeedPersistence getJournalFeedPersistence() {
257         return journalFeedPersistence;
258     }
259 
260     public void setJournalFeedPersistence(
261         JournalFeedPersistence journalFeedPersistence) {
262         this.journalFeedPersistence = journalFeedPersistence;
263     }
264 
265     public JournalFeedFinder getJournalFeedFinder() {
266         return journalFeedFinder;
267     }
268 
269     public void setJournalFeedFinder(JournalFeedFinder journalFeedFinder) {
270         this.journalFeedFinder = journalFeedFinder;
271     }
272 
273     public JournalStructureLocalService getJournalStructureLocalService() {
274         return journalStructureLocalService;
275     }
276 
277     public void setJournalStructureLocalService(
278         JournalStructureLocalService journalStructureLocalService) {
279         this.journalStructureLocalService = journalStructureLocalService;
280     }
281 
282     public JournalStructureService getJournalStructureService() {
283         return journalStructureService;
284     }
285 
286     public void setJournalStructureService(
287         JournalStructureService journalStructureService) {
288         this.journalStructureService = journalStructureService;
289     }
290 
291     public JournalStructurePersistence getJournalStructurePersistence() {
292         return journalStructurePersistence;
293     }
294 
295     public void setJournalStructurePersistence(
296         JournalStructurePersistence journalStructurePersistence) {
297         this.journalStructurePersistence = journalStructurePersistence;
298     }
299 
300     public JournalStructureFinder getJournalStructureFinder() {
301         return journalStructureFinder;
302     }
303 
304     public void setJournalStructureFinder(
305         JournalStructureFinder journalStructureFinder) {
306         this.journalStructureFinder = journalStructureFinder;
307     }
308 
309     public JournalTemplateLocalService getJournalTemplateLocalService() {
310         return journalTemplateLocalService;
311     }
312 
313     public void setJournalTemplateLocalService(
314         JournalTemplateLocalService journalTemplateLocalService) {
315         this.journalTemplateLocalService = journalTemplateLocalService;
316     }
317 
318     public JournalTemplateService getJournalTemplateService() {
319         return journalTemplateService;
320     }
321 
322     public void setJournalTemplateService(
323         JournalTemplateService journalTemplateService) {
324         this.journalTemplateService = journalTemplateService;
325     }
326 
327     public JournalTemplatePersistence getJournalTemplatePersistence() {
328         return journalTemplatePersistence;
329     }
330 
331     public void setJournalTemplatePersistence(
332         JournalTemplatePersistence journalTemplatePersistence) {
333         this.journalTemplatePersistence = journalTemplatePersistence;
334     }
335 
336     public JournalTemplateFinder getJournalTemplateFinder() {
337         return journalTemplateFinder;
338     }
339 
340     public void setJournalTemplateFinder(
341         JournalTemplateFinder journalTemplateFinder) {
342         this.journalTemplateFinder = journalTemplateFinder;
343     }
344 
345     public CounterLocalService getCounterLocalService() {
346         return counterLocalService;
347     }
348 
349     public void setCounterLocalService(CounterLocalService counterLocalService) {
350         this.counterLocalService = counterLocalService;
351     }
352 
353     public ImageLocalService getImageLocalService() {
354         return imageLocalService;
355     }
356 
357     public void setImageLocalService(ImageLocalService imageLocalService) {
358         this.imageLocalService = imageLocalService;
359     }
360 
361     public ImageService getImageService() {
362         return imageService;
363     }
364 
365     public void setImageService(ImageService imageService) {
366         this.imageService = imageService;
367     }
368 
369     public ImagePersistence getImagePersistence() {
370         return imagePersistence;
371     }
372 
373     public void setImagePersistence(ImagePersistence imagePersistence) {
374         this.imagePersistence = imagePersistence;
375     }
376 
377     public ResourceLocalService getResourceLocalService() {
378         return resourceLocalService;
379     }
380 
381     public void setResourceLocalService(
382         ResourceLocalService resourceLocalService) {
383         this.resourceLocalService = resourceLocalService;
384     }
385 
386     public ResourceService getResourceService() {
387         return resourceService;
388     }
389 
390     public void setResourceService(ResourceService resourceService) {
391         this.resourceService = resourceService;
392     }
393 
394     public ResourcePersistence getResourcePersistence() {
395         return resourcePersistence;
396     }
397 
398     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
399         this.resourcePersistence = resourcePersistence;
400     }
401 
402     public ResourceFinder getResourceFinder() {
403         return resourceFinder;
404     }
405 
406     public void setResourceFinder(ResourceFinder resourceFinder) {
407         this.resourceFinder = resourceFinder;
408     }
409 
410     public UserLocalService getUserLocalService() {
411         return userLocalService;
412     }
413 
414     public void setUserLocalService(UserLocalService userLocalService) {
415         this.userLocalService = userLocalService;
416     }
417 
418     public UserService getUserService() {
419         return userService;
420     }
421 
422     public void setUserService(UserService userService) {
423         this.userService = userService;
424     }
425 
426     public UserPersistence getUserPersistence() {
427         return userPersistence;
428     }
429 
430     public void setUserPersistence(UserPersistence userPersistence) {
431         this.userPersistence = userPersistence;
432     }
433 
434     public UserFinder getUserFinder() {
435         return userFinder;
436     }
437 
438     public void setUserFinder(UserFinder userFinder) {
439         this.userFinder = userFinder;
440     }
441 
442     protected void runSQL(String sql) throws SystemException {
443         try {
444             DataSource dataSource = journalArticleImagePersistence.getDataSource();
445 
446             SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
447                     sql, new int[0]);
448 
449             sqlUpdate.update();
450         }
451         catch (Exception e) {
452             throw new SystemException(e);
453         }
454     }
455 
456     @BeanReference(type = JournalArticleLocalService.class)
457     protected JournalArticleLocalService journalArticleLocalService;
458     @BeanReference(type = JournalArticleService.class)
459     protected JournalArticleService journalArticleService;
460     @BeanReference(type = JournalArticlePersistence.class)
461     protected JournalArticlePersistence journalArticlePersistence;
462     @BeanReference(type = JournalArticleFinder.class)
463     protected JournalArticleFinder journalArticleFinder;
464     @BeanReference(type = JournalArticleImageLocalService.class)
465     protected JournalArticleImageLocalService journalArticleImageLocalService;
466     @BeanReference(type = JournalArticleImagePersistence.class)
467     protected JournalArticleImagePersistence journalArticleImagePersistence;
468     @BeanReference(type = JournalArticleResourceLocalService.class)
469     protected JournalArticleResourceLocalService journalArticleResourceLocalService;
470     @BeanReference(type = JournalArticleResourcePersistence.class)
471     protected JournalArticleResourcePersistence journalArticleResourcePersistence;
472     @BeanReference(type = JournalContentSearchLocalService.class)
473     protected JournalContentSearchLocalService journalContentSearchLocalService;
474     @BeanReference(type = JournalContentSearchPersistence.class)
475     protected JournalContentSearchPersistence journalContentSearchPersistence;
476     @BeanReference(type = JournalFeedLocalService.class)
477     protected JournalFeedLocalService journalFeedLocalService;
478     @BeanReference(type = JournalFeedService.class)
479     protected JournalFeedService journalFeedService;
480     @BeanReference(type = JournalFeedPersistence.class)
481     protected JournalFeedPersistence journalFeedPersistence;
482     @BeanReference(type = JournalFeedFinder.class)
483     protected JournalFeedFinder journalFeedFinder;
484     @BeanReference(type = JournalStructureLocalService.class)
485     protected JournalStructureLocalService journalStructureLocalService;
486     @BeanReference(type = JournalStructureService.class)
487     protected JournalStructureService journalStructureService;
488     @BeanReference(type = JournalStructurePersistence.class)
489     protected JournalStructurePersistence journalStructurePersistence;
490     @BeanReference(type = JournalStructureFinder.class)
491     protected JournalStructureFinder journalStructureFinder;
492     @BeanReference(type = JournalTemplateLocalService.class)
493     protected JournalTemplateLocalService journalTemplateLocalService;
494     @BeanReference(type = JournalTemplateService.class)
495     protected JournalTemplateService journalTemplateService;
496     @BeanReference(type = JournalTemplatePersistence.class)
497     protected JournalTemplatePersistence journalTemplatePersistence;
498     @BeanReference(type = JournalTemplateFinder.class)
499     protected JournalTemplateFinder journalTemplateFinder;
500     @BeanReference(type = CounterLocalService.class)
501     protected CounterLocalService counterLocalService;
502     @BeanReference(type = ImageLocalService.class)
503     protected ImageLocalService imageLocalService;
504     @BeanReference(type = ImageService.class)
505     protected ImageService imageService;
506     @BeanReference(type = ImagePersistence.class)
507     protected ImagePersistence imagePersistence;
508     @BeanReference(type = ResourceLocalService.class)
509     protected ResourceLocalService resourceLocalService;
510     @BeanReference(type = ResourceService.class)
511     protected ResourceService resourceService;
512     @BeanReference(type = ResourcePersistence.class)
513     protected ResourcePersistence resourcePersistence;
514     @BeanReference(type = ResourceFinder.class)
515     protected ResourceFinder resourceFinder;
516     @BeanReference(type = UserLocalService.class)
517     protected UserLocalService userLocalService;
518     @BeanReference(type = UserService.class)
519     protected UserService userService;
520     @BeanReference(type = UserPersistence.class)
521     protected UserPersistence userPersistence;
522     @BeanReference(type = UserFinder.class)
523     protected UserFinder userFinder;
524 }