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.db.DB;
21  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
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.ResourceLocalService;
27  import com.liferay.portal.service.ResourceService;
28  import com.liferay.portal.service.UserLocalService;
29  import com.liferay.portal.service.UserService;
30  import com.liferay.portal.service.persistence.ResourceFinder;
31  import com.liferay.portal.service.persistence.ResourcePersistence;
32  import com.liferay.portal.service.persistence.UserFinder;
33  import com.liferay.portal.service.persistence.UserPersistence;
34  
35  import com.liferay.portlet.expando.service.ExpandoValueLocalService;
36  import com.liferay.portlet.expando.service.ExpandoValueService;
37  import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
38  import com.liferay.portlet.journal.model.JournalFeed;
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  /**
65   * <a href="JournalFeedLocalServiceBaseImpl.java.html"><b><i>View Source</i></b>
66   * </a>
67   *
68   * @author Brian Wing Shun Chan
69   */
70  public abstract class JournalFeedLocalServiceBaseImpl
71      implements JournalFeedLocalService {
72      public JournalFeed addJournalFeed(JournalFeed journalFeed)
73          throws SystemException {
74          journalFeed.setNew(true);
75  
76          return journalFeedPersistence.update(journalFeed, false);
77      }
78  
79      public JournalFeed createJournalFeed(long id) {
80          return journalFeedPersistence.create(id);
81      }
82  
83      public void deleteJournalFeed(long id)
84          throws PortalException, SystemException {
85          journalFeedPersistence.remove(id);
86      }
87  
88      public void deleteJournalFeed(JournalFeed journalFeed)
89          throws SystemException {
90          journalFeedPersistence.remove(journalFeed);
91      }
92  
93      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
94          throws SystemException {
95          return journalFeedPersistence.findWithDynamicQuery(dynamicQuery);
96      }
97  
98      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
99          int end) throws SystemException {
100         return journalFeedPersistence.findWithDynamicQuery(dynamicQuery, start,
101             end);
102     }
103 
104     public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
105         int end, OrderByComparator orderByComparator) throws SystemException {
106         return journalFeedPersistence.findWithDynamicQuery(dynamicQuery, start,
107             end, orderByComparator);
108     }
109 
110     public int dynamicQueryCount(DynamicQuery dynamicQuery)
111         throws SystemException {
112         return journalFeedPersistence.countWithDynamicQuery(dynamicQuery);
113     }
114 
115     public JournalFeed getJournalFeed(long id)
116         throws PortalException, SystemException {
117         return journalFeedPersistence.findByPrimaryKey(id);
118     }
119 
120     public List<JournalFeed> getJournalFeeds(int start, int end)
121         throws SystemException {
122         return journalFeedPersistence.findAll(start, end);
123     }
124 
125     public int getJournalFeedsCount() throws SystemException {
126         return journalFeedPersistence.countAll();
127     }
128 
129     public JournalFeed updateJournalFeed(JournalFeed journalFeed)
130         throws SystemException {
131         journalFeed.setNew(false);
132 
133         return journalFeedPersistence.update(journalFeed, true);
134     }
135 
136     public JournalFeed updateJournalFeed(JournalFeed journalFeed, boolean merge)
137         throws SystemException {
138         journalFeed.setNew(false);
139 
140         return journalFeedPersistence.update(journalFeed, merge);
141     }
142 
143     public JournalArticleLocalService getJournalArticleLocalService() {
144         return journalArticleLocalService;
145     }
146 
147     public void setJournalArticleLocalService(
148         JournalArticleLocalService journalArticleLocalService) {
149         this.journalArticleLocalService = journalArticleLocalService;
150     }
151 
152     public JournalArticleService getJournalArticleService() {
153         return journalArticleService;
154     }
155 
156     public void setJournalArticleService(
157         JournalArticleService journalArticleService) {
158         this.journalArticleService = journalArticleService;
159     }
160 
161     public JournalArticlePersistence getJournalArticlePersistence() {
162         return journalArticlePersistence;
163     }
164 
165     public void setJournalArticlePersistence(
166         JournalArticlePersistence journalArticlePersistence) {
167         this.journalArticlePersistence = journalArticlePersistence;
168     }
169 
170     public JournalArticleFinder getJournalArticleFinder() {
171         return journalArticleFinder;
172     }
173 
174     public void setJournalArticleFinder(
175         JournalArticleFinder journalArticleFinder) {
176         this.journalArticleFinder = journalArticleFinder;
177     }
178 
179     public JournalArticleImageLocalService getJournalArticleImageLocalService() {
180         return journalArticleImageLocalService;
181     }
182 
183     public void setJournalArticleImageLocalService(
184         JournalArticleImageLocalService journalArticleImageLocalService) {
185         this.journalArticleImageLocalService = journalArticleImageLocalService;
186     }
187 
188     public JournalArticleImagePersistence getJournalArticleImagePersistence() {
189         return journalArticleImagePersistence;
190     }
191 
192     public void setJournalArticleImagePersistence(
193         JournalArticleImagePersistence journalArticleImagePersistence) {
194         this.journalArticleImagePersistence = journalArticleImagePersistence;
195     }
196 
197     public JournalArticleResourceLocalService getJournalArticleResourceLocalService() {
198         return journalArticleResourceLocalService;
199     }
200 
201     public void setJournalArticleResourceLocalService(
202         JournalArticleResourceLocalService journalArticleResourceLocalService) {
203         this.journalArticleResourceLocalService = journalArticleResourceLocalService;
204     }
205 
206     public JournalArticleResourcePersistence getJournalArticleResourcePersistence() {
207         return journalArticleResourcePersistence;
208     }
209 
210     public void setJournalArticleResourcePersistence(
211         JournalArticleResourcePersistence journalArticleResourcePersistence) {
212         this.journalArticleResourcePersistence = journalArticleResourcePersistence;
213     }
214 
215     public JournalContentSearchLocalService getJournalContentSearchLocalService() {
216         return journalContentSearchLocalService;
217     }
218 
219     public void setJournalContentSearchLocalService(
220         JournalContentSearchLocalService journalContentSearchLocalService) {
221         this.journalContentSearchLocalService = journalContentSearchLocalService;
222     }
223 
224     public JournalContentSearchPersistence getJournalContentSearchPersistence() {
225         return journalContentSearchPersistence;
226     }
227 
228     public void setJournalContentSearchPersistence(
229         JournalContentSearchPersistence journalContentSearchPersistence) {
230         this.journalContentSearchPersistence = journalContentSearchPersistence;
231     }
232 
233     public JournalFeedLocalService getJournalFeedLocalService() {
234         return journalFeedLocalService;
235     }
236 
237     public void setJournalFeedLocalService(
238         JournalFeedLocalService journalFeedLocalService) {
239         this.journalFeedLocalService = journalFeedLocalService;
240     }
241 
242     public JournalFeedService getJournalFeedService() {
243         return journalFeedService;
244     }
245 
246     public void setJournalFeedService(JournalFeedService journalFeedService) {
247         this.journalFeedService = journalFeedService;
248     }
249 
250     public JournalFeedPersistence getJournalFeedPersistence() {
251         return journalFeedPersistence;
252     }
253 
254     public void setJournalFeedPersistence(
255         JournalFeedPersistence journalFeedPersistence) {
256         this.journalFeedPersistence = journalFeedPersistence;
257     }
258 
259     public JournalFeedFinder getJournalFeedFinder() {
260         return journalFeedFinder;
261     }
262 
263     public void setJournalFeedFinder(JournalFeedFinder journalFeedFinder) {
264         this.journalFeedFinder = journalFeedFinder;
265     }
266 
267     public JournalStructureLocalService getJournalStructureLocalService() {
268         return journalStructureLocalService;
269     }
270 
271     public void setJournalStructureLocalService(
272         JournalStructureLocalService journalStructureLocalService) {
273         this.journalStructureLocalService = journalStructureLocalService;
274     }
275 
276     public JournalStructureService getJournalStructureService() {
277         return journalStructureService;
278     }
279 
280     public void setJournalStructureService(
281         JournalStructureService journalStructureService) {
282         this.journalStructureService = journalStructureService;
283     }
284 
285     public JournalStructurePersistence getJournalStructurePersistence() {
286         return journalStructurePersistence;
287     }
288 
289     public void setJournalStructurePersistence(
290         JournalStructurePersistence journalStructurePersistence) {
291         this.journalStructurePersistence = journalStructurePersistence;
292     }
293 
294     public JournalStructureFinder getJournalStructureFinder() {
295         return journalStructureFinder;
296     }
297 
298     public void setJournalStructureFinder(
299         JournalStructureFinder journalStructureFinder) {
300         this.journalStructureFinder = journalStructureFinder;
301     }
302 
303     public JournalTemplateLocalService getJournalTemplateLocalService() {
304         return journalTemplateLocalService;
305     }
306 
307     public void setJournalTemplateLocalService(
308         JournalTemplateLocalService journalTemplateLocalService) {
309         this.journalTemplateLocalService = journalTemplateLocalService;
310     }
311 
312     public JournalTemplateService getJournalTemplateService() {
313         return journalTemplateService;
314     }
315 
316     public void setJournalTemplateService(
317         JournalTemplateService journalTemplateService) {
318         this.journalTemplateService = journalTemplateService;
319     }
320 
321     public JournalTemplatePersistence getJournalTemplatePersistence() {
322         return journalTemplatePersistence;
323     }
324 
325     public void setJournalTemplatePersistence(
326         JournalTemplatePersistence journalTemplatePersistence) {
327         this.journalTemplatePersistence = journalTemplatePersistence;
328     }
329 
330     public JournalTemplateFinder getJournalTemplateFinder() {
331         return journalTemplateFinder;
332     }
333 
334     public void setJournalTemplateFinder(
335         JournalTemplateFinder journalTemplateFinder) {
336         this.journalTemplateFinder = journalTemplateFinder;
337     }
338 
339     public CounterLocalService getCounterLocalService() {
340         return counterLocalService;
341     }
342 
343     public void setCounterLocalService(CounterLocalService counterLocalService) {
344         this.counterLocalService = counterLocalService;
345     }
346 
347     public ResourceLocalService getResourceLocalService() {
348         return resourceLocalService;
349     }
350 
351     public void setResourceLocalService(
352         ResourceLocalService resourceLocalService) {
353         this.resourceLocalService = resourceLocalService;
354     }
355 
356     public ResourceService getResourceService() {
357         return resourceService;
358     }
359 
360     public void setResourceService(ResourceService resourceService) {
361         this.resourceService = resourceService;
362     }
363 
364     public ResourcePersistence getResourcePersistence() {
365         return resourcePersistence;
366     }
367 
368     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
369         this.resourcePersistence = resourcePersistence;
370     }
371 
372     public ResourceFinder getResourceFinder() {
373         return resourceFinder;
374     }
375 
376     public void setResourceFinder(ResourceFinder resourceFinder) {
377         this.resourceFinder = resourceFinder;
378     }
379 
380     public UserLocalService getUserLocalService() {
381         return userLocalService;
382     }
383 
384     public void setUserLocalService(UserLocalService userLocalService) {
385         this.userLocalService = userLocalService;
386     }
387 
388     public UserService getUserService() {
389         return userService;
390     }
391 
392     public void setUserService(UserService userService) {
393         this.userService = userService;
394     }
395 
396     public UserPersistence getUserPersistence() {
397         return userPersistence;
398     }
399 
400     public void setUserPersistence(UserPersistence userPersistence) {
401         this.userPersistence = userPersistence;
402     }
403 
404     public UserFinder getUserFinder() {
405         return userFinder;
406     }
407 
408     public void setUserFinder(UserFinder userFinder) {
409         this.userFinder = userFinder;
410     }
411 
412     public ExpandoValueLocalService getExpandoValueLocalService() {
413         return expandoValueLocalService;
414     }
415 
416     public void setExpandoValueLocalService(
417         ExpandoValueLocalService expandoValueLocalService) {
418         this.expandoValueLocalService = expandoValueLocalService;
419     }
420 
421     public ExpandoValueService getExpandoValueService() {
422         return expandoValueService;
423     }
424 
425     public void setExpandoValueService(ExpandoValueService expandoValueService) {
426         this.expandoValueService = expandoValueService;
427     }
428 
429     public ExpandoValuePersistence getExpandoValuePersistence() {
430         return expandoValuePersistence;
431     }
432 
433     public void setExpandoValuePersistence(
434         ExpandoValuePersistence expandoValuePersistence) {
435         this.expandoValuePersistence = expandoValuePersistence;
436     }
437 
438     protected void runSQL(String sql) throws SystemException {
439         try {
440             DB db = DBFactoryUtil.getDB();
441 
442             db.runSQL(sql);
443         }
444         catch (Exception e) {
445             throw new SystemException(e);
446         }
447     }
448 
449     @BeanReference(type = JournalArticleLocalService.class)
450     protected JournalArticleLocalService journalArticleLocalService;
451     @BeanReference(type = JournalArticleService.class)
452     protected JournalArticleService journalArticleService;
453     @BeanReference(type = JournalArticlePersistence.class)
454     protected JournalArticlePersistence journalArticlePersistence;
455     @BeanReference(type = JournalArticleFinder.class)
456     protected JournalArticleFinder journalArticleFinder;
457     @BeanReference(type = JournalArticleImageLocalService.class)
458     protected JournalArticleImageLocalService journalArticleImageLocalService;
459     @BeanReference(type = JournalArticleImagePersistence.class)
460     protected JournalArticleImagePersistence journalArticleImagePersistence;
461     @BeanReference(type = JournalArticleResourceLocalService.class)
462     protected JournalArticleResourceLocalService journalArticleResourceLocalService;
463     @BeanReference(type = JournalArticleResourcePersistence.class)
464     protected JournalArticleResourcePersistence journalArticleResourcePersistence;
465     @BeanReference(type = JournalContentSearchLocalService.class)
466     protected JournalContentSearchLocalService journalContentSearchLocalService;
467     @BeanReference(type = JournalContentSearchPersistence.class)
468     protected JournalContentSearchPersistence journalContentSearchPersistence;
469     @BeanReference(type = JournalFeedLocalService.class)
470     protected JournalFeedLocalService journalFeedLocalService;
471     @BeanReference(type = JournalFeedService.class)
472     protected JournalFeedService journalFeedService;
473     @BeanReference(type = JournalFeedPersistence.class)
474     protected JournalFeedPersistence journalFeedPersistence;
475     @BeanReference(type = JournalFeedFinder.class)
476     protected JournalFeedFinder journalFeedFinder;
477     @BeanReference(type = JournalStructureLocalService.class)
478     protected JournalStructureLocalService journalStructureLocalService;
479     @BeanReference(type = JournalStructureService.class)
480     protected JournalStructureService journalStructureService;
481     @BeanReference(type = JournalStructurePersistence.class)
482     protected JournalStructurePersistence journalStructurePersistence;
483     @BeanReference(type = JournalStructureFinder.class)
484     protected JournalStructureFinder journalStructureFinder;
485     @BeanReference(type = JournalTemplateLocalService.class)
486     protected JournalTemplateLocalService journalTemplateLocalService;
487     @BeanReference(type = JournalTemplateService.class)
488     protected JournalTemplateService journalTemplateService;
489     @BeanReference(type = JournalTemplatePersistence.class)
490     protected JournalTemplatePersistence journalTemplatePersistence;
491     @BeanReference(type = JournalTemplateFinder.class)
492     protected JournalTemplateFinder journalTemplateFinder;
493     @BeanReference(type = CounterLocalService.class)
494     protected CounterLocalService counterLocalService;
495     @BeanReference(type = ResourceLocalService.class)
496     protected ResourceLocalService resourceLocalService;
497     @BeanReference(type = ResourceService.class)
498     protected ResourceService resourceService;
499     @BeanReference(type = ResourcePersistence.class)
500     protected ResourcePersistence resourcePersistence;
501     @BeanReference(type = ResourceFinder.class)
502     protected ResourceFinder resourceFinder;
503     @BeanReference(type = UserLocalService.class)
504     protected UserLocalService userLocalService;
505     @BeanReference(type = UserService.class)
506     protected UserService userService;
507     @BeanReference(type = UserPersistence.class)
508     protected UserPersistence userPersistence;
509     @BeanReference(type = UserFinder.class)
510     protected UserFinder userFinder;
511     @BeanReference(type = ExpandoValueLocalService.class)
512     protected ExpandoValueLocalService expandoValueLocalService;
513     @BeanReference(type = ExpandoValueService.class)
514     protected ExpandoValueService expandoValueService;
515     @BeanReference(type = ExpandoValuePersistence.class)
516     protected ExpandoValuePersistence expandoValuePersistence;
517 }