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