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.CounterLocalServiceFactory;
27  import com.liferay.counter.service.CounterService;
28  import com.liferay.counter.service.CounterServiceFactory;
29  
30  import com.liferay.portal.PortalException;
31  import com.liferay.portal.SystemException;
32  import com.liferay.portal.kernel.bean.InitializingBean;
33  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
34  import com.liferay.portal.service.ImageLocalService;
35  import com.liferay.portal.service.ImageLocalServiceFactory;
36  import com.liferay.portal.service.persistence.ImagePersistence;
37  import com.liferay.portal.service.persistence.ImageUtil;
38  
39  import com.liferay.portlet.journal.model.JournalArticleImage;
40  import com.liferay.portlet.journal.service.JournalArticleImageLocalService;
41  import com.liferay.portlet.journal.service.JournalArticleLocalService;
42  import com.liferay.portlet.journal.service.JournalArticleLocalServiceFactory;
43  import com.liferay.portlet.journal.service.JournalArticleResourceLocalService;
44  import com.liferay.portlet.journal.service.JournalArticleResourceLocalServiceFactory;
45  import com.liferay.portlet.journal.service.JournalArticleService;
46  import com.liferay.portlet.journal.service.JournalArticleServiceFactory;
47  import com.liferay.portlet.journal.service.JournalContentSearchLocalService;
48  import com.liferay.portlet.journal.service.JournalContentSearchLocalServiceFactory;
49  import com.liferay.portlet.journal.service.JournalFeedLocalService;
50  import com.liferay.portlet.journal.service.JournalFeedLocalServiceFactory;
51  import com.liferay.portlet.journal.service.JournalFeedService;
52  import com.liferay.portlet.journal.service.JournalFeedServiceFactory;
53  import com.liferay.portlet.journal.service.JournalStructureLocalService;
54  import com.liferay.portlet.journal.service.JournalStructureLocalServiceFactory;
55  import com.liferay.portlet.journal.service.JournalStructureService;
56  import com.liferay.portlet.journal.service.JournalStructureServiceFactory;
57  import com.liferay.portlet.journal.service.JournalTemplateLocalService;
58  import com.liferay.portlet.journal.service.JournalTemplateLocalServiceFactory;
59  import com.liferay.portlet.journal.service.JournalTemplateService;
60  import com.liferay.portlet.journal.service.JournalTemplateServiceFactory;
61  import com.liferay.portlet.journal.service.persistence.JournalArticleFinder;
62  import com.liferay.portlet.journal.service.persistence.JournalArticleFinderUtil;
63  import com.liferay.portlet.journal.service.persistence.JournalArticleImagePersistence;
64  import com.liferay.portlet.journal.service.persistence.JournalArticleImageUtil;
65  import com.liferay.portlet.journal.service.persistence.JournalArticlePersistence;
66  import com.liferay.portlet.journal.service.persistence.JournalArticleResourcePersistence;
67  import com.liferay.portlet.journal.service.persistence.JournalArticleResourceUtil;
68  import com.liferay.portlet.journal.service.persistence.JournalArticleUtil;
69  import com.liferay.portlet.journal.service.persistence.JournalContentSearchPersistence;
70  import com.liferay.portlet.journal.service.persistence.JournalContentSearchUtil;
71  import com.liferay.portlet.journal.service.persistence.JournalFeedFinder;
72  import com.liferay.portlet.journal.service.persistence.JournalFeedFinderUtil;
73  import com.liferay.portlet.journal.service.persistence.JournalFeedPersistence;
74  import com.liferay.portlet.journal.service.persistence.JournalFeedUtil;
75  import com.liferay.portlet.journal.service.persistence.JournalStructureFinder;
76  import com.liferay.portlet.journal.service.persistence.JournalStructureFinderUtil;
77  import com.liferay.portlet.journal.service.persistence.JournalStructurePersistence;
78  import com.liferay.portlet.journal.service.persistence.JournalStructureUtil;
79  import com.liferay.portlet.journal.service.persistence.JournalTemplateFinder;
80  import com.liferay.portlet.journal.service.persistence.JournalTemplateFinderUtil;
81  import com.liferay.portlet.journal.service.persistence.JournalTemplatePersistence;
82  import com.liferay.portlet.journal.service.persistence.JournalTemplateUtil;
83  
84  import java.util.List;
85  
86  /**
87   * <a href="JournalArticleImageLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
88   *
89   * @author Brian Wing Shun Chan
90   *
91   */
92  public abstract class JournalArticleImageLocalServiceBaseImpl
93      implements JournalArticleImageLocalService, InitializingBean {
94      public JournalArticleImage addJournalArticleImage(
95          JournalArticleImage journalArticleImage) throws SystemException {
96          journalArticleImage.setNew(true);
97  
98          return journalArticleImagePersistence.update(journalArticleImage, false);
99      }
100 
101     public void deleteJournalArticleImage(long articleImageId)
102         throws PortalException, SystemException {
103         journalArticleImagePersistence.remove(articleImageId);
104     }
105 
106     public void deleteJournalArticleImage(
107         JournalArticleImage journalArticleImage) throws SystemException {
108         journalArticleImagePersistence.remove(journalArticleImage);
109     }
110 
111     public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
112         throws SystemException {
113         return journalArticleImagePersistence.findWithDynamicQuery(dynamicQuery);
114     }
115 
116     public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
117         int end) throws SystemException {
118         return journalArticleImagePersistence.findWithDynamicQuery(dynamicQuery,
119             start, end);
120     }
121 
122     public JournalArticleImage getJournalArticleImage(long articleImageId)
123         throws PortalException, SystemException {
124         return journalArticleImagePersistence.findByPrimaryKey(articleImageId);
125     }
126 
127     public JournalArticleImage updateJournalArticleImage(
128         JournalArticleImage journalArticleImage) throws SystemException {
129         journalArticleImage.setNew(false);
130 
131         return journalArticleImagePersistence.update(journalArticleImage, true);
132     }
133 
134     public JournalArticleLocalService getJournalArticleLocalService() {
135         return journalArticleLocalService;
136     }
137 
138     public void setJournalArticleLocalService(
139         JournalArticleLocalService journalArticleLocalService) {
140         this.journalArticleLocalService = journalArticleLocalService;
141     }
142 
143     public JournalArticleService getJournalArticleService() {
144         return journalArticleService;
145     }
146 
147     public void setJournalArticleService(
148         JournalArticleService journalArticleService) {
149         this.journalArticleService = journalArticleService;
150     }
151 
152     public JournalArticlePersistence getJournalArticlePersistence() {
153         return journalArticlePersistence;
154     }
155 
156     public void setJournalArticlePersistence(
157         JournalArticlePersistence journalArticlePersistence) {
158         this.journalArticlePersistence = journalArticlePersistence;
159     }
160 
161     public JournalArticleFinder getJournalArticleFinder() {
162         return journalArticleFinder;
163     }
164 
165     public void setJournalArticleFinder(
166         JournalArticleFinder journalArticleFinder) {
167         this.journalArticleFinder = journalArticleFinder;
168     }
169 
170     public JournalArticleImagePersistence getJournalArticleImagePersistence() {
171         return journalArticleImagePersistence;
172     }
173 
174     public void setJournalArticleImagePersistence(
175         JournalArticleImagePersistence journalArticleImagePersistence) {
176         this.journalArticleImagePersistence = journalArticleImagePersistence;
177     }
178 
179     public JournalArticleResourceLocalService getJournalArticleResourceLocalService() {
180         return journalArticleResourceLocalService;
181     }
182 
183     public void setJournalArticleResourceLocalService(
184         JournalArticleResourceLocalService journalArticleResourceLocalService) {
185         this.journalArticleResourceLocalService = journalArticleResourceLocalService;
186     }
187 
188     public JournalArticleResourcePersistence getJournalArticleResourcePersistence() {
189         return journalArticleResourcePersistence;
190     }
191 
192     public void setJournalArticleResourcePersistence(
193         JournalArticleResourcePersistence journalArticleResourcePersistence) {
194         this.journalArticleResourcePersistence = journalArticleResourcePersistence;
195     }
196 
197     public JournalContentSearchLocalService getJournalContentSearchLocalService() {
198         return journalContentSearchLocalService;
199     }
200 
201     public void setJournalContentSearchLocalService(
202         JournalContentSearchLocalService journalContentSearchLocalService) {
203         this.journalContentSearchLocalService = journalContentSearchLocalService;
204     }
205 
206     public JournalContentSearchPersistence getJournalContentSearchPersistence() {
207         return journalContentSearchPersistence;
208     }
209 
210     public void setJournalContentSearchPersistence(
211         JournalContentSearchPersistence journalContentSearchPersistence) {
212         this.journalContentSearchPersistence = journalContentSearchPersistence;
213     }
214 
215     public JournalFeedLocalService getJournalFeedLocalService() {
216         return journalFeedLocalService;
217     }
218 
219     public void setJournalFeedLocalService(
220         JournalFeedLocalService journalFeedLocalService) {
221         this.journalFeedLocalService = journalFeedLocalService;
222     }
223 
224     public JournalFeedService getJournalFeedService() {
225         return journalFeedService;
226     }
227 
228     public void setJournalFeedService(JournalFeedService journalFeedService) {
229         this.journalFeedService = journalFeedService;
230     }
231 
232     public JournalFeedPersistence getJournalFeedPersistence() {
233         return journalFeedPersistence;
234     }
235 
236     public void setJournalFeedPersistence(
237         JournalFeedPersistence journalFeedPersistence) {
238         this.journalFeedPersistence = journalFeedPersistence;
239     }
240 
241     public JournalFeedFinder getJournalFeedFinder() {
242         return journalFeedFinder;
243     }
244 
245     public void setJournalFeedFinder(JournalFeedFinder journalFeedFinder) {
246         this.journalFeedFinder = journalFeedFinder;
247     }
248 
249     public JournalStructureLocalService getJournalStructureLocalService() {
250         return journalStructureLocalService;
251     }
252 
253     public void setJournalStructureLocalService(
254         JournalStructureLocalService journalStructureLocalService) {
255         this.journalStructureLocalService = journalStructureLocalService;
256     }
257 
258     public JournalStructureService getJournalStructureService() {
259         return journalStructureService;
260     }
261 
262     public void setJournalStructureService(
263         JournalStructureService journalStructureService) {
264         this.journalStructureService = journalStructureService;
265     }
266 
267     public JournalStructurePersistence getJournalStructurePersistence() {
268         return journalStructurePersistence;
269     }
270 
271     public void setJournalStructurePersistence(
272         JournalStructurePersistence journalStructurePersistence) {
273         this.journalStructurePersistence = journalStructurePersistence;
274     }
275 
276     public JournalStructureFinder getJournalStructureFinder() {
277         return journalStructureFinder;
278     }
279 
280     public void setJournalStructureFinder(
281         JournalStructureFinder journalStructureFinder) {
282         this.journalStructureFinder = journalStructureFinder;
283     }
284 
285     public JournalTemplateLocalService getJournalTemplateLocalService() {
286         return journalTemplateLocalService;
287     }
288 
289     public void setJournalTemplateLocalService(
290         JournalTemplateLocalService journalTemplateLocalService) {
291         this.journalTemplateLocalService = journalTemplateLocalService;
292     }
293 
294     public JournalTemplateService getJournalTemplateService() {
295         return journalTemplateService;
296     }
297 
298     public void setJournalTemplateService(
299         JournalTemplateService journalTemplateService) {
300         this.journalTemplateService = journalTemplateService;
301     }
302 
303     public JournalTemplatePersistence getJournalTemplatePersistence() {
304         return journalTemplatePersistence;
305     }
306 
307     public void setJournalTemplatePersistence(
308         JournalTemplatePersistence journalTemplatePersistence) {
309         this.journalTemplatePersistence = journalTemplatePersistence;
310     }
311 
312     public JournalTemplateFinder getJournalTemplateFinder() {
313         return journalTemplateFinder;
314     }
315 
316     public void setJournalTemplateFinder(
317         JournalTemplateFinder journalTemplateFinder) {
318         this.journalTemplateFinder = journalTemplateFinder;
319     }
320 
321     public CounterLocalService getCounterLocalService() {
322         return counterLocalService;
323     }
324 
325     public void setCounterLocalService(CounterLocalService counterLocalService) {
326         this.counterLocalService = counterLocalService;
327     }
328 
329     public CounterService getCounterService() {
330         return counterService;
331     }
332 
333     public void setCounterService(CounterService counterService) {
334         this.counterService = counterService;
335     }
336 
337     public ImageLocalService getImageLocalService() {
338         return imageLocalService;
339     }
340 
341     public void setImageLocalService(ImageLocalService imageLocalService) {
342         this.imageLocalService = imageLocalService;
343     }
344 
345     public ImagePersistence getImagePersistence() {
346         return imagePersistence;
347     }
348 
349     public void setImagePersistence(ImagePersistence imagePersistence) {
350         this.imagePersistence = imagePersistence;
351     }
352 
353     public void afterPropertiesSet() {
354         if (journalArticleLocalService == null) {
355             journalArticleLocalService = JournalArticleLocalServiceFactory.getImpl();
356         }
357 
358         if (journalArticleService == null) {
359             journalArticleService = JournalArticleServiceFactory.getImpl();
360         }
361 
362         if (journalArticlePersistence == null) {
363             journalArticlePersistence = JournalArticleUtil.getPersistence();
364         }
365 
366         if (journalArticleFinder == null) {
367             journalArticleFinder = JournalArticleFinderUtil.getFinder();
368         }
369 
370         if (journalArticleImagePersistence == null) {
371             journalArticleImagePersistence = JournalArticleImageUtil.getPersistence();
372         }
373 
374         if (journalArticleResourceLocalService == null) {
375             journalArticleResourceLocalService = JournalArticleResourceLocalServiceFactory.getImpl();
376         }
377 
378         if (journalArticleResourcePersistence == null) {
379             journalArticleResourcePersistence = JournalArticleResourceUtil.getPersistence();
380         }
381 
382         if (journalContentSearchLocalService == null) {
383             journalContentSearchLocalService = JournalContentSearchLocalServiceFactory.getImpl();
384         }
385 
386         if (journalContentSearchPersistence == null) {
387             journalContentSearchPersistence = JournalContentSearchUtil.getPersistence();
388         }
389 
390         if (journalFeedLocalService == null) {
391             journalFeedLocalService = JournalFeedLocalServiceFactory.getImpl();
392         }
393 
394         if (journalFeedService == null) {
395             journalFeedService = JournalFeedServiceFactory.getImpl();
396         }
397 
398         if (journalFeedPersistence == null) {
399             journalFeedPersistence = JournalFeedUtil.getPersistence();
400         }
401 
402         if (journalFeedFinder == null) {
403             journalFeedFinder = JournalFeedFinderUtil.getFinder();
404         }
405 
406         if (journalStructureLocalService == null) {
407             journalStructureLocalService = JournalStructureLocalServiceFactory.getImpl();
408         }
409 
410         if (journalStructureService == null) {
411             journalStructureService = JournalStructureServiceFactory.getImpl();
412         }
413 
414         if (journalStructurePersistence == null) {
415             journalStructurePersistence = JournalStructureUtil.getPersistence();
416         }
417 
418         if (journalStructureFinder == null) {
419             journalStructureFinder = JournalStructureFinderUtil.getFinder();
420         }
421 
422         if (journalTemplateLocalService == null) {
423             journalTemplateLocalService = JournalTemplateLocalServiceFactory.getImpl();
424         }
425 
426         if (journalTemplateService == null) {
427             journalTemplateService = JournalTemplateServiceFactory.getImpl();
428         }
429 
430         if (journalTemplatePersistence == null) {
431             journalTemplatePersistence = JournalTemplateUtil.getPersistence();
432         }
433 
434         if (journalTemplateFinder == null) {
435             journalTemplateFinder = JournalTemplateFinderUtil.getFinder();
436         }
437 
438         if (counterLocalService == null) {
439             counterLocalService = CounterLocalServiceFactory.getImpl();
440         }
441 
442         if (counterService == null) {
443             counterService = CounterServiceFactory.getImpl();
444         }
445 
446         if (imageLocalService == null) {
447             imageLocalService = ImageLocalServiceFactory.getImpl();
448         }
449 
450         if (imagePersistence == null) {
451             imagePersistence = ImageUtil.getPersistence();
452         }
453     }
454 
455     protected JournalArticleLocalService journalArticleLocalService;
456     protected JournalArticleService journalArticleService;
457     protected JournalArticlePersistence journalArticlePersistence;
458     protected JournalArticleFinder journalArticleFinder;
459     protected JournalArticleImagePersistence journalArticleImagePersistence;
460     protected JournalArticleResourceLocalService journalArticleResourceLocalService;
461     protected JournalArticleResourcePersistence journalArticleResourcePersistence;
462     protected JournalContentSearchLocalService journalContentSearchLocalService;
463     protected JournalContentSearchPersistence journalContentSearchPersistence;
464     protected JournalFeedLocalService journalFeedLocalService;
465     protected JournalFeedService journalFeedService;
466     protected JournalFeedPersistence journalFeedPersistence;
467     protected JournalFeedFinder journalFeedFinder;
468     protected JournalStructureLocalService journalStructureLocalService;
469     protected JournalStructureService journalStructureService;
470     protected JournalStructurePersistence journalStructurePersistence;
471     protected JournalStructureFinder journalStructureFinder;
472     protected JournalTemplateLocalService journalTemplateLocalService;
473     protected JournalTemplateService journalTemplateService;
474     protected JournalTemplatePersistence journalTemplatePersistence;
475     protected JournalTemplateFinder journalTemplateFinder;
476     protected CounterLocalService counterLocalService;
477     protected CounterService counterService;
478     protected ImageLocalService imageLocalService;
479     protected ImagePersistence imagePersistence;
480 }