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