1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.journal.service.base;
24  
25  import com.liferay.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterService;
27  
28  import com.liferay.portal.PortalException;
29  import com.liferay.portal.SystemException;
30  import com.liferay.portal.kernel.bean.InitializingBean;
31  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
32  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
33  import com.liferay.portal.service.ImageLocalService;
34  import com.liferay.portal.service.persistence.ImagePersistence;
35  
36  import com.liferay.portlet.journal.model.JournalArticleImage;
37  import com.liferay.portlet.journal.service.JournalArticleImageLocalService;
38  import com.liferay.portlet.journal.service.JournalArticleLocalService;
39  import com.liferay.portlet.journal.service.JournalArticleResourceLocalService;
40  import com.liferay.portlet.journal.service.JournalArticleService;
41  import com.liferay.portlet.journal.service.JournalContentSearchLocalService;
42  import com.liferay.portlet.journal.service.JournalFeedLocalService;
43  import com.liferay.portlet.journal.service.JournalFeedService;
44  import com.liferay.portlet.journal.service.JournalStructureLocalService;
45  import com.liferay.portlet.journal.service.JournalStructureService;
46  import com.liferay.portlet.journal.service.JournalTemplateLocalService;
47  import com.liferay.portlet.journal.service.JournalTemplateService;
48  import com.liferay.portlet.journal.service.persistence.JournalArticleFinder;
49  import com.liferay.portlet.journal.service.persistence.JournalArticleImagePersistence;
50  import com.liferay.portlet.journal.service.persistence.JournalArticlePersistence;
51  import com.liferay.portlet.journal.service.persistence.JournalArticleResourcePersistence;
52  import com.liferay.portlet.journal.service.persistence.JournalContentSearchPersistence;
53  import com.liferay.portlet.journal.service.persistence.JournalFeedFinder;
54  import com.liferay.portlet.journal.service.persistence.JournalFeedPersistence;
55  import com.liferay.portlet.journal.service.persistence.JournalStructureFinder;
56  import com.liferay.portlet.journal.service.persistence.JournalStructurePersistence;
57  import com.liferay.portlet.journal.service.persistence.JournalTemplateFinder;
58  import com.liferay.portlet.journal.service.persistence.JournalTemplatePersistence;
59  
60  import java.util.List;
61  
62  /**
63   * <a href="JournalArticleImageLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
64   *
65   * @author Brian Wing Shun Chan
66   *
67   */
68  public abstract class JournalArticleImageLocalServiceBaseImpl
69      implements JournalArticleImageLocalService, InitializingBean {
70      public JournalArticleImage addJournalArticleImage(
71          JournalArticleImage journalArticleImage) throws SystemException {
72          journalArticleImage.setNew(true);
73  
74          return journalArticleImagePersistence.update(journalArticleImage, false);
75      }
76  
77      public void deleteJournalArticleImage(long articleImageId)
78          throws PortalException, SystemException {
79          journalArticleImagePersistence.remove(articleImageId);
80      }
81  
82      public void deleteJournalArticleImage(
83          JournalArticleImage journalArticleImage) throws SystemException {
84          journalArticleImagePersistence.remove(journalArticleImage);
85      }
86  
87      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
88          throws SystemException {
89          return journalArticleImagePersistence.findWithDynamicQuery(dynamicQuery);
90      }
91  
92      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
93          int end) throws SystemException {
94          return journalArticleImagePersistence.findWithDynamicQuery(dynamicQuery,
95              start, end);
96      }
97  
98      public JournalArticleImage getJournalArticleImage(long articleImageId)
99          throws PortalException, SystemException {
100         return journalArticleImagePersistence.findByPrimaryKey(articleImageId);
101     }
102 
103     public List<JournalArticleImage> getJournalArticleImages(int start, int end)
104         throws SystemException {
105         return journalArticleImagePersistence.findAll(start, end);
106     }
107 
108     public int getJournalArticleImagesCount() throws SystemException {
109         return journalArticleImagePersistence.countAll();
110     }
111 
112     public JournalArticleImage updateJournalArticleImage(
113         JournalArticleImage journalArticleImage) throws SystemException {
114         journalArticleImage.setNew(false);
115 
116         return journalArticleImagePersistence.update(journalArticleImage, true);
117     }
118 
119     public JournalArticleLocalService getJournalArticleLocalService() {
120         return journalArticleLocalService;
121     }
122 
123     public void setJournalArticleLocalService(
124         JournalArticleLocalService journalArticleLocalService) {
125         this.journalArticleLocalService = journalArticleLocalService;
126     }
127 
128     public JournalArticleService getJournalArticleService() {
129         return journalArticleService;
130     }
131 
132     public void setJournalArticleService(
133         JournalArticleService journalArticleService) {
134         this.journalArticleService = journalArticleService;
135     }
136 
137     public JournalArticlePersistence getJournalArticlePersistence() {
138         return journalArticlePersistence;
139     }
140 
141     public void setJournalArticlePersistence(
142         JournalArticlePersistence journalArticlePersistence) {
143         this.journalArticlePersistence = journalArticlePersistence;
144     }
145 
146     public JournalArticleFinder getJournalArticleFinder() {
147         return journalArticleFinder;
148     }
149 
150     public void setJournalArticleFinder(
151         JournalArticleFinder journalArticleFinder) {
152         this.journalArticleFinder = journalArticleFinder;
153     }
154 
155     public JournalArticleImagePersistence getJournalArticleImagePersistence() {
156         return journalArticleImagePersistence;
157     }
158 
159     public void setJournalArticleImagePersistence(
160         JournalArticleImagePersistence journalArticleImagePersistence) {
161         this.journalArticleImagePersistence = journalArticleImagePersistence;
162     }
163 
164     public JournalArticleResourceLocalService getJournalArticleResourceLocalService() {
165         return journalArticleResourceLocalService;
166     }
167 
168     public void setJournalArticleResourceLocalService(
169         JournalArticleResourceLocalService journalArticleResourceLocalService) {
170         this.journalArticleResourceLocalService = journalArticleResourceLocalService;
171     }
172 
173     public JournalArticleResourcePersistence getJournalArticleResourcePersistence() {
174         return journalArticleResourcePersistence;
175     }
176 
177     public void setJournalArticleResourcePersistence(
178         JournalArticleResourcePersistence journalArticleResourcePersistence) {
179         this.journalArticleResourcePersistence = journalArticleResourcePersistence;
180     }
181 
182     public JournalContentSearchLocalService getJournalContentSearchLocalService() {
183         return journalContentSearchLocalService;
184     }
185 
186     public void setJournalContentSearchLocalService(
187         JournalContentSearchLocalService journalContentSearchLocalService) {
188         this.journalContentSearchLocalService = journalContentSearchLocalService;
189     }
190 
191     public JournalContentSearchPersistence getJournalContentSearchPersistence() {
192         return journalContentSearchPersistence;
193     }
194 
195     public void setJournalContentSearchPersistence(
196         JournalContentSearchPersistence journalContentSearchPersistence) {
197         this.journalContentSearchPersistence = journalContentSearchPersistence;
198     }
199 
200     public JournalFeedLocalService getJournalFeedLocalService() {
201         return journalFeedLocalService;
202     }
203 
204     public void setJournalFeedLocalService(
205         JournalFeedLocalService journalFeedLocalService) {
206         this.journalFeedLocalService = journalFeedLocalService;
207     }
208 
209     public JournalFeedService getJournalFeedService() {
210         return journalFeedService;
211     }
212 
213     public void setJournalFeedService(JournalFeedService journalFeedService) {
214         this.journalFeedService = journalFeedService;
215     }
216 
217     public JournalFeedPersistence getJournalFeedPersistence() {
218         return journalFeedPersistence;
219     }
220 
221     public void setJournalFeedPersistence(
222         JournalFeedPersistence journalFeedPersistence) {
223         this.journalFeedPersistence = journalFeedPersistence;
224     }
225 
226     public JournalFeedFinder getJournalFeedFinder() {
227         return journalFeedFinder;
228     }
229 
230     public void setJournalFeedFinder(JournalFeedFinder journalFeedFinder) {
231         this.journalFeedFinder = journalFeedFinder;
232     }
233 
234     public JournalStructureLocalService getJournalStructureLocalService() {
235         return journalStructureLocalService;
236     }
237 
238     public void setJournalStructureLocalService(
239         JournalStructureLocalService journalStructureLocalService) {
240         this.journalStructureLocalService = journalStructureLocalService;
241     }
242 
243     public JournalStructureService getJournalStructureService() {
244         return journalStructureService;
245     }
246 
247     public void setJournalStructureService(
248         JournalStructureService journalStructureService) {
249         this.journalStructureService = journalStructureService;
250     }
251 
252     public JournalStructurePersistence getJournalStructurePersistence() {
253         return journalStructurePersistence;
254     }
255 
256     public void setJournalStructurePersistence(
257         JournalStructurePersistence journalStructurePersistence) {
258         this.journalStructurePersistence = journalStructurePersistence;
259     }
260 
261     public JournalStructureFinder getJournalStructureFinder() {
262         return journalStructureFinder;
263     }
264 
265     public void setJournalStructureFinder(
266         JournalStructureFinder journalStructureFinder) {
267         this.journalStructureFinder = journalStructureFinder;
268     }
269 
270     public JournalTemplateLocalService getJournalTemplateLocalService() {
271         return journalTemplateLocalService;
272     }
273 
274     public void setJournalTemplateLocalService(
275         JournalTemplateLocalService journalTemplateLocalService) {
276         this.journalTemplateLocalService = journalTemplateLocalService;
277     }
278 
279     public JournalTemplateService getJournalTemplateService() {
280         return journalTemplateService;
281     }
282 
283     public void setJournalTemplateService(
284         JournalTemplateService journalTemplateService) {
285         this.journalTemplateService = journalTemplateService;
286     }
287 
288     public JournalTemplatePersistence getJournalTemplatePersistence() {
289         return journalTemplatePersistence;
290     }
291 
292     public void setJournalTemplatePersistence(
293         JournalTemplatePersistence journalTemplatePersistence) {
294         this.journalTemplatePersistence = journalTemplatePersistence;
295     }
296 
297     public JournalTemplateFinder getJournalTemplateFinder() {
298         return journalTemplateFinder;
299     }
300 
301     public void setJournalTemplateFinder(
302         JournalTemplateFinder journalTemplateFinder) {
303         this.journalTemplateFinder = journalTemplateFinder;
304     }
305 
306     public CounterLocalService getCounterLocalService() {
307         return counterLocalService;
308     }
309 
310     public void setCounterLocalService(CounterLocalService counterLocalService) {
311         this.counterLocalService = counterLocalService;
312     }
313 
314     public CounterService getCounterService() {
315         return counterService;
316     }
317 
318     public void setCounterService(CounterService counterService) {
319         this.counterService = counterService;
320     }
321 
322     public ImageLocalService getImageLocalService() {
323         return imageLocalService;
324     }
325 
326     public void setImageLocalService(ImageLocalService imageLocalService) {
327         this.imageLocalService = imageLocalService;
328     }
329 
330     public ImagePersistence getImagePersistence() {
331         return imagePersistence;
332     }
333 
334     public void setImagePersistence(ImagePersistence imagePersistence) {
335         this.imagePersistence = imagePersistence;
336     }
337 
338     public void afterPropertiesSet() {
339         if (journalArticleLocalService == null) {
340             journalArticleLocalService = (JournalArticleLocalService)PortalBeanLocatorUtil.locate(JournalArticleLocalService.class.getName() +
341                     ".impl");
342         }
343 
344         if (journalArticleService == null) {
345             journalArticleService = (JournalArticleService)PortalBeanLocatorUtil.locate(JournalArticleService.class.getName() +
346                     ".impl");
347         }
348 
349         if (journalArticlePersistence == null) {
350             journalArticlePersistence = (JournalArticlePersistence)PortalBeanLocatorUtil.locate(JournalArticlePersistence.class.getName() +
351                     ".impl");
352         }
353 
354         if (journalArticleFinder == null) {
355             journalArticleFinder = (JournalArticleFinder)PortalBeanLocatorUtil.locate(JournalArticleFinder.class.getName() +
356                     ".impl");
357         }
358 
359         if (journalArticleImagePersistence == null) {
360             journalArticleImagePersistence = (JournalArticleImagePersistence)PortalBeanLocatorUtil.locate(JournalArticleImagePersistence.class.getName() +
361                     ".impl");
362         }
363 
364         if (journalArticleResourceLocalService == null) {
365             journalArticleResourceLocalService = (JournalArticleResourceLocalService)PortalBeanLocatorUtil.locate(JournalArticleResourceLocalService.class.getName() +
366                     ".impl");
367         }
368 
369         if (journalArticleResourcePersistence == null) {
370             journalArticleResourcePersistence = (JournalArticleResourcePersistence)PortalBeanLocatorUtil.locate(JournalArticleResourcePersistence.class.getName() +
371                     ".impl");
372         }
373 
374         if (journalContentSearchLocalService == null) {
375             journalContentSearchLocalService = (JournalContentSearchLocalService)PortalBeanLocatorUtil.locate(JournalContentSearchLocalService.class.getName() +
376                     ".impl");
377         }
378 
379         if (journalContentSearchPersistence == null) {
380             journalContentSearchPersistence = (JournalContentSearchPersistence)PortalBeanLocatorUtil.locate(JournalContentSearchPersistence.class.getName() +
381                     ".impl");
382         }
383 
384         if (journalFeedLocalService == null) {
385             journalFeedLocalService = (JournalFeedLocalService)PortalBeanLocatorUtil.locate(JournalFeedLocalService.class.getName() +
386                     ".impl");
387         }
388 
389         if (journalFeedService == null) {
390             journalFeedService = (JournalFeedService)PortalBeanLocatorUtil.locate(JournalFeedService.class.getName() +
391                     ".impl");
392         }
393 
394         if (journalFeedPersistence == null) {
395             journalFeedPersistence = (JournalFeedPersistence)PortalBeanLocatorUtil.locate(JournalFeedPersistence.class.getName() +
396                     ".impl");
397         }
398 
399         if (journalFeedFinder == null) {
400             journalFeedFinder = (JournalFeedFinder)PortalBeanLocatorUtil.locate(JournalFeedFinder.class.getName() +
401                     ".impl");
402         }
403 
404         if (journalStructureLocalService == null) {
405             journalStructureLocalService = (JournalStructureLocalService)PortalBeanLocatorUtil.locate(JournalStructureLocalService.class.getName() +
406                     ".impl");
407         }
408 
409         if (journalStructureService == null) {
410             journalStructureService = (JournalStructureService)PortalBeanLocatorUtil.locate(JournalStructureService.class.getName() +
411                     ".impl");
412         }
413 
414         if (journalStructurePersistence == null) {
415             journalStructurePersistence = (JournalStructurePersistence)PortalBeanLocatorUtil.locate(JournalStructurePersistence.class.getName() +
416                     ".impl");
417         }
418 
419         if (journalStructureFinder == null) {
420             journalStructureFinder = (JournalStructureFinder)PortalBeanLocatorUtil.locate(JournalStructureFinder.class.getName() +
421                     ".impl");
422         }
423 
424         if (journalTemplateLocalService == null) {
425             journalTemplateLocalService = (JournalTemplateLocalService)PortalBeanLocatorUtil.locate(JournalTemplateLocalService.class.getName() +
426                     ".impl");
427         }
428 
429         if (journalTemplateService == null) {
430             journalTemplateService = (JournalTemplateService)PortalBeanLocatorUtil.locate(JournalTemplateService.class.getName() +
431                     ".impl");
432         }
433 
434         if (journalTemplatePersistence == null) {
435             journalTemplatePersistence = (JournalTemplatePersistence)PortalBeanLocatorUtil.locate(JournalTemplatePersistence.class.getName() +
436                     ".impl");
437         }
438 
439         if (journalTemplateFinder == null) {
440             journalTemplateFinder = (JournalTemplateFinder)PortalBeanLocatorUtil.locate(JournalTemplateFinder.class.getName() +
441                     ".impl");
442         }
443 
444         if (counterLocalService == null) {
445             counterLocalService = (CounterLocalService)PortalBeanLocatorUtil.locate(CounterLocalService.class.getName() +
446                     ".impl");
447         }
448 
449         if (counterService == null) {
450             counterService = (CounterService)PortalBeanLocatorUtil.locate(CounterService.class.getName() +
451                     ".impl");
452         }
453 
454         if (imageLocalService == null) {
455             imageLocalService = (ImageLocalService)PortalBeanLocatorUtil.locate(ImageLocalService.class.getName() +
456                     ".impl");
457         }
458 
459         if (imagePersistence == null) {
460             imagePersistence = (ImagePersistence)PortalBeanLocatorUtil.locate(ImagePersistence.class.getName() +
461                     ".impl");
462         }
463     }
464 
465     protected JournalArticleLocalService journalArticleLocalService;
466     protected JournalArticleService journalArticleService;
467     protected JournalArticlePersistence journalArticlePersistence;
468     protected JournalArticleFinder journalArticleFinder;
469     protected JournalArticleImagePersistence journalArticleImagePersistence;
470     protected JournalArticleResourceLocalService journalArticleResourceLocalService;
471     protected JournalArticleResourcePersistence journalArticleResourcePersistence;
472     protected JournalContentSearchLocalService journalContentSearchLocalService;
473     protected JournalContentSearchPersistence journalContentSearchPersistence;
474     protected JournalFeedLocalService journalFeedLocalService;
475     protected JournalFeedService journalFeedService;
476     protected JournalFeedPersistence journalFeedPersistence;
477     protected JournalFeedFinder journalFeedFinder;
478     protected JournalStructureLocalService journalStructureLocalService;
479     protected JournalStructureService journalStructureService;
480     protected JournalStructurePersistence journalStructurePersistence;
481     protected JournalStructureFinder journalStructureFinder;
482     protected JournalTemplateLocalService journalTemplateLocalService;
483     protected JournalTemplateService journalTemplateService;
484     protected JournalTemplatePersistence journalTemplatePersistence;
485     protected JournalTemplateFinder journalTemplateFinder;
486     protected CounterLocalService counterLocalService;
487     protected CounterService counterService;
488     protected ImageLocalService imageLocalService;
489     protected ImagePersistence imagePersistence;
490 }