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