1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.journal.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  import com.liferay.counter.service.CounterService;
19  
20  import com.liferay.portal.PortalException;
21  import com.liferay.portal.SystemException;
22  import com.liferay.portal.kernel.annotation.BeanReference;
23  import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
24  import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
25  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
26  import com.liferay.portal.kernel.util.OrderByComparator;
27  import com.liferay.portal.service.ImageLocalService;
28  import com.liferay.portal.service.ImageService;
29  import com.liferay.portal.service.ResourceLocalService;
30  import com.liferay.portal.service.ResourceService;
31  import com.liferay.portal.service.UserLocalService;
32  import com.liferay.portal.service.UserService;
33  import com.liferay.portal.service.WebDAVPropsLocalService;
34  import com.liferay.portal.service.persistence.ImagePersistence;
35  import com.liferay.portal.service.persistence.ResourceFinder;
36  import com.liferay.portal.service.persistence.ResourcePersistence;
37  import com.liferay.portal.service.persistence.UserFinder;
38  import com.liferay.portal.service.persistence.UserPersistence;
39  import com.liferay.portal.service.persistence.WebDAVPropsPersistence;
40  
41  import com.liferay.portlet.expando.service.ExpandoValueLocalService;
42  import com.liferay.portlet.expando.service.ExpandoValueService;
43  import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
44  import com.liferay.portlet.journal.model.JournalTemplate;
45  import com.liferay.portlet.journal.service.JournalArticleImageLocalService;
46  import com.liferay.portlet.journal.service.JournalArticleLocalService;
47  import com.liferay.portlet.journal.service.JournalArticleResourceLocalService;
48  import com.liferay.portlet.journal.service.JournalArticleService;
49  import com.liferay.portlet.journal.service.JournalContentSearchLocalService;
50  import com.liferay.portlet.journal.service.JournalFeedLocalService;
51  import com.liferay.portlet.journal.service.JournalFeedService;
52  import com.liferay.portlet.journal.service.JournalStructureLocalService;
53  import com.liferay.portlet.journal.service.JournalStructureService;
54  import com.liferay.portlet.journal.service.JournalTemplateLocalService;
55  import com.liferay.portlet.journal.service.JournalTemplateService;
56  import com.liferay.portlet.journal.service.persistence.JournalArticleFinder;
57  import com.liferay.portlet.journal.service.persistence.JournalArticleImagePersistence;
58  import com.liferay.portlet.journal.service.persistence.JournalArticlePersistence;
59  import com.liferay.portlet.journal.service.persistence.JournalArticleResourcePersistence;
60  import com.liferay.portlet.journal.service.persistence.JournalContentSearchPersistence;
61  import com.liferay.portlet.journal.service.persistence.JournalFeedFinder;
62  import com.liferay.portlet.journal.service.persistence.JournalFeedPersistence;
63  import com.liferay.portlet.journal.service.persistence.JournalStructureFinder;
64  import com.liferay.portlet.journal.service.persistence.JournalStructurePersistence;
65  import com.liferay.portlet.journal.service.persistence.JournalTemplateFinder;
66  import com.liferay.portlet.journal.service.persistence.JournalTemplatePersistence;
67  
68  import java.util.List;
69  
70  import javax.sql.DataSource;
71  
72  /**
73   * <a href="JournalTemplateLocalServiceBaseImpl.java.html"><b><i>View Source</i>
74   * </b></a>
75   *
76   * @author Brian Wing Shun Chan
77   */
78  public abstract class JournalTemplateLocalServiceBaseImpl
79      implements JournalTemplateLocalService {
80      public JournalTemplate addJournalTemplate(JournalTemplate journalTemplate)
81          throws SystemException {
82          journalTemplate.setNew(true);
83  
84          return journalTemplatePersistence.update(journalTemplate, false);
85      }
86  
87      public JournalTemplate createJournalTemplate(long id) {
88          return journalTemplatePersistence.create(id);
89      }
90  
91      public void deleteJournalTemplate(long id)
92          throws PortalException, SystemException {
93          journalTemplatePersistence.remove(id);
94      }
95  
96      public void deleteJournalTemplate(JournalTemplate journalTemplate)
97          throws SystemException {
98          journalTemplatePersistence.remove(journalTemplate);
99      }
100 
101     @SuppressWarnings("rawtypes")
102     public List dynamicQuery(DynamicQuery dynamicQuery)
103         throws SystemException {
104         return journalTemplatePersistence.findWithDynamicQuery(dynamicQuery);
105     }
106 
107     @SuppressWarnings("rawtypes")
108     public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
109         throws SystemException {
110         return journalTemplatePersistence.findWithDynamicQuery(dynamicQuery,
111             start, end);
112     }
113 
114     @SuppressWarnings("rawtypes")
115     public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
116         OrderByComparator orderByComparator) throws SystemException {
117         return journalTemplatePersistence.findWithDynamicQuery(dynamicQuery,
118             start, end, orderByComparator);
119     }
120 
121     public int dynamicQueryCount(DynamicQuery dynamicQuery)
122         throws SystemException {
123         return journalTemplatePersistence.countWithDynamicQuery(dynamicQuery);
124     }
125 
126     public JournalTemplate getJournalTemplate(long id)
127         throws PortalException, SystemException {
128         return journalTemplatePersistence.findByPrimaryKey(id);
129     }
130 
131     public JournalTemplate getJournalTemplateByUuidAndGroupId(String uuid,
132         long groupId) throws PortalException, SystemException {
133         return journalTemplatePersistence.findByUUID_G(uuid, groupId);
134     }
135 
136     public List<JournalTemplate> getJournalTemplates(int start, int end)
137         throws SystemException {
138         return journalTemplatePersistence.findAll(start, end);
139     }
140 
141     public int getJournalTemplatesCount() throws SystemException {
142         return journalTemplatePersistence.countAll();
143     }
144 
145     public JournalTemplate updateJournalTemplate(
146         JournalTemplate journalTemplate) throws SystemException {
147         journalTemplate.setNew(false);
148 
149         return journalTemplatePersistence.update(journalTemplate, true);
150     }
151 
152     public JournalTemplate updateJournalTemplate(
153         JournalTemplate journalTemplate, boolean merge)
154         throws SystemException {
155         journalTemplate.setNew(false);
156 
157         return journalTemplatePersistence.update(journalTemplate, merge);
158     }
159 
160     public JournalArticleLocalService getJournalArticleLocalService() {
161         return journalArticleLocalService;
162     }
163 
164     public void setJournalArticleLocalService(
165         JournalArticleLocalService journalArticleLocalService) {
166         this.journalArticleLocalService = journalArticleLocalService;
167     }
168 
169     public JournalArticleService getJournalArticleService() {
170         return journalArticleService;
171     }
172 
173     public void setJournalArticleService(
174         JournalArticleService journalArticleService) {
175         this.journalArticleService = journalArticleService;
176     }
177 
178     public JournalArticlePersistence getJournalArticlePersistence() {
179         return journalArticlePersistence;
180     }
181 
182     public void setJournalArticlePersistence(
183         JournalArticlePersistence journalArticlePersistence) {
184         this.journalArticlePersistence = journalArticlePersistence;
185     }
186 
187     public JournalArticleFinder getJournalArticleFinder() {
188         return journalArticleFinder;
189     }
190 
191     public void setJournalArticleFinder(
192         JournalArticleFinder journalArticleFinder) {
193         this.journalArticleFinder = journalArticleFinder;
194     }
195 
196     public JournalArticleImageLocalService getJournalArticleImageLocalService() {
197         return journalArticleImageLocalService;
198     }
199 
200     public void setJournalArticleImageLocalService(
201         JournalArticleImageLocalService journalArticleImageLocalService) {
202         this.journalArticleImageLocalService = journalArticleImageLocalService;
203     }
204 
205     public JournalArticleImagePersistence getJournalArticleImagePersistence() {
206         return journalArticleImagePersistence;
207     }
208 
209     public void setJournalArticleImagePersistence(
210         JournalArticleImagePersistence journalArticleImagePersistence) {
211         this.journalArticleImagePersistence = journalArticleImagePersistence;
212     }
213 
214     public JournalArticleResourceLocalService getJournalArticleResourceLocalService() {
215         return journalArticleResourceLocalService;
216     }
217 
218     public void setJournalArticleResourceLocalService(
219         JournalArticleResourceLocalService journalArticleResourceLocalService) {
220         this.journalArticleResourceLocalService = journalArticleResourceLocalService;
221     }
222 
223     public JournalArticleResourcePersistence getJournalArticleResourcePersistence() {
224         return journalArticleResourcePersistence;
225     }
226 
227     public void setJournalArticleResourcePersistence(
228         JournalArticleResourcePersistence journalArticleResourcePersistence) {
229         this.journalArticleResourcePersistence = journalArticleResourcePersistence;
230     }
231 
232     public JournalContentSearchLocalService getJournalContentSearchLocalService() {
233         return journalContentSearchLocalService;
234     }
235 
236     public void setJournalContentSearchLocalService(
237         JournalContentSearchLocalService journalContentSearchLocalService) {
238         this.journalContentSearchLocalService = journalContentSearchLocalService;
239     }
240 
241     public JournalContentSearchPersistence getJournalContentSearchPersistence() {
242         return journalContentSearchPersistence;
243     }
244 
245     public void setJournalContentSearchPersistence(
246         JournalContentSearchPersistence journalContentSearchPersistence) {
247         this.journalContentSearchPersistence = journalContentSearchPersistence;
248     }
249 
250     public JournalFeedLocalService getJournalFeedLocalService() {
251         return journalFeedLocalService;
252     }
253 
254     public void setJournalFeedLocalService(
255         JournalFeedLocalService journalFeedLocalService) {
256         this.journalFeedLocalService = journalFeedLocalService;
257     }
258 
259     public JournalFeedService getJournalFeedService() {
260         return journalFeedService;
261     }
262 
263     public void setJournalFeedService(JournalFeedService journalFeedService) {
264         this.journalFeedService = journalFeedService;
265     }
266 
267     public JournalFeedPersistence getJournalFeedPersistence() {
268         return journalFeedPersistence;
269     }
270 
271     public void setJournalFeedPersistence(
272         JournalFeedPersistence journalFeedPersistence) {
273         this.journalFeedPersistence = journalFeedPersistence;
274     }
275 
276     public JournalFeedFinder getJournalFeedFinder() {
277         return journalFeedFinder;
278     }
279 
280     public void setJournalFeedFinder(JournalFeedFinder journalFeedFinder) {
281         this.journalFeedFinder = journalFeedFinder;
282     }
283 
284     public JournalStructureLocalService getJournalStructureLocalService() {
285         return journalStructureLocalService;
286     }
287 
288     public void setJournalStructureLocalService(
289         JournalStructureLocalService journalStructureLocalService) {
290         this.journalStructureLocalService = journalStructureLocalService;
291     }
292 
293     public JournalStructureService getJournalStructureService() {
294         return journalStructureService;
295     }
296 
297     public void setJournalStructureService(
298         JournalStructureService journalStructureService) {
299         this.journalStructureService = journalStructureService;
300     }
301 
302     public JournalStructurePersistence getJournalStructurePersistence() {
303         return journalStructurePersistence;
304     }
305 
306     public void setJournalStructurePersistence(
307         JournalStructurePersistence journalStructurePersistence) {
308         this.journalStructurePersistence = journalStructurePersistence;
309     }
310 
311     public JournalStructureFinder getJournalStructureFinder() {
312         return journalStructureFinder;
313     }
314 
315     public void setJournalStructureFinder(
316         JournalStructureFinder journalStructureFinder) {
317         this.journalStructureFinder = journalStructureFinder;
318     }
319 
320     public JournalTemplateLocalService getJournalTemplateLocalService() {
321         return journalTemplateLocalService;
322     }
323 
324     public void setJournalTemplateLocalService(
325         JournalTemplateLocalService journalTemplateLocalService) {
326         this.journalTemplateLocalService = journalTemplateLocalService;
327     }
328 
329     public JournalTemplateService getJournalTemplateService() {
330         return journalTemplateService;
331     }
332 
333     public void setJournalTemplateService(
334         JournalTemplateService journalTemplateService) {
335         this.journalTemplateService = journalTemplateService;
336     }
337 
338     public JournalTemplatePersistence getJournalTemplatePersistence() {
339         return journalTemplatePersistence;
340     }
341 
342     public void setJournalTemplatePersistence(
343         JournalTemplatePersistence journalTemplatePersistence) {
344         this.journalTemplatePersistence = journalTemplatePersistence;
345     }
346 
347     public JournalTemplateFinder getJournalTemplateFinder() {
348         return journalTemplateFinder;
349     }
350 
351     public void setJournalTemplateFinder(
352         JournalTemplateFinder journalTemplateFinder) {
353         this.journalTemplateFinder = journalTemplateFinder;
354     }
355 
356     public CounterLocalService getCounterLocalService() {
357         return counterLocalService;
358     }
359 
360     public void setCounterLocalService(CounterLocalService counterLocalService) {
361         this.counterLocalService = counterLocalService;
362     }
363 
364     public CounterService getCounterService() {
365         return counterService;
366     }
367 
368     public void setCounterService(CounterService counterService) {
369         this.counterService = counterService;
370     }
371 
372     public ImageLocalService getImageLocalService() {
373         return imageLocalService;
374     }
375 
376     public void setImageLocalService(ImageLocalService imageLocalService) {
377         this.imageLocalService = imageLocalService;
378     }
379 
380     public ImageService getImageService() {
381         return imageService;
382     }
383 
384     public void setImageService(ImageService imageService) {
385         this.imageService = imageService;
386     }
387 
388     public ImagePersistence getImagePersistence() {
389         return imagePersistence;
390     }
391 
392     public void setImagePersistence(ImagePersistence imagePersistence) {
393         this.imagePersistence = imagePersistence;
394     }
395 
396     public ResourceLocalService getResourceLocalService() {
397         return resourceLocalService;
398     }
399 
400     public void setResourceLocalService(
401         ResourceLocalService resourceLocalService) {
402         this.resourceLocalService = resourceLocalService;
403     }
404 
405     public ResourceService getResourceService() {
406         return resourceService;
407     }
408 
409     public void setResourceService(ResourceService resourceService) {
410         this.resourceService = resourceService;
411     }
412 
413     public ResourcePersistence getResourcePersistence() {
414         return resourcePersistence;
415     }
416 
417     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
418         this.resourcePersistence = resourcePersistence;
419     }
420 
421     public ResourceFinder getResourceFinder() {
422         return resourceFinder;
423     }
424 
425     public void setResourceFinder(ResourceFinder resourceFinder) {
426         this.resourceFinder = resourceFinder;
427     }
428 
429     public UserLocalService getUserLocalService() {
430         return userLocalService;
431     }
432 
433     public void setUserLocalService(UserLocalService userLocalService) {
434         this.userLocalService = userLocalService;
435     }
436 
437     public UserService getUserService() {
438         return userService;
439     }
440 
441     public void setUserService(UserService userService) {
442         this.userService = userService;
443     }
444 
445     public UserPersistence getUserPersistence() {
446         return userPersistence;
447     }
448 
449     public void setUserPersistence(UserPersistence userPersistence) {
450         this.userPersistence = userPersistence;
451     }
452 
453     public UserFinder getUserFinder() {
454         return userFinder;
455     }
456 
457     public void setUserFinder(UserFinder userFinder) {
458         this.userFinder = userFinder;
459     }
460 
461     public WebDAVPropsLocalService getWebDAVPropsLocalService() {
462         return webDAVPropsLocalService;
463     }
464 
465     public void setWebDAVPropsLocalService(
466         WebDAVPropsLocalService webDAVPropsLocalService) {
467         this.webDAVPropsLocalService = webDAVPropsLocalService;
468     }
469 
470     public WebDAVPropsPersistence getWebDAVPropsPersistence() {
471         return webDAVPropsPersistence;
472     }
473 
474     public void setWebDAVPropsPersistence(
475         WebDAVPropsPersistence webDAVPropsPersistence) {
476         this.webDAVPropsPersistence = webDAVPropsPersistence;
477     }
478 
479     public ExpandoValueLocalService getExpandoValueLocalService() {
480         return expandoValueLocalService;
481     }
482 
483     public void setExpandoValueLocalService(
484         ExpandoValueLocalService expandoValueLocalService) {
485         this.expandoValueLocalService = expandoValueLocalService;
486     }
487 
488     public ExpandoValueService getExpandoValueService() {
489         return expandoValueService;
490     }
491 
492     public void setExpandoValueService(ExpandoValueService expandoValueService) {
493         this.expandoValueService = expandoValueService;
494     }
495 
496     public ExpandoValuePersistence getExpandoValuePersistence() {
497         return expandoValuePersistence;
498     }
499 
500     public void setExpandoValuePersistence(
501         ExpandoValuePersistence expandoValuePersistence) {
502         this.expandoValuePersistence = expandoValuePersistence;
503     }
504 
505     protected void runSQL(String sql) throws SystemException {
506         try {
507             DataSource dataSource = journalTemplatePersistence.getDataSource();
508 
509             SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
510                     sql, new int[0]);
511 
512             sqlUpdate.update(new Object[0]);
513         }
514         catch (Exception e) {
515             throw new SystemException(e);
516         }
517     }
518 
519     @BeanReference(type = JournalArticleLocalService.class)
520     protected JournalArticleLocalService journalArticleLocalService;
521     @BeanReference(type = JournalArticleService.class)
522     protected JournalArticleService journalArticleService;
523     @BeanReference(type = JournalArticlePersistence.class)
524     protected JournalArticlePersistence journalArticlePersistence;
525     @BeanReference(type = JournalArticleFinder.class)
526     protected JournalArticleFinder journalArticleFinder;
527     @BeanReference(type = JournalArticleImageLocalService.class)
528     protected JournalArticleImageLocalService journalArticleImageLocalService;
529     @BeanReference(type = JournalArticleImagePersistence.class)
530     protected JournalArticleImagePersistence journalArticleImagePersistence;
531     @BeanReference(type = JournalArticleResourceLocalService.class)
532     protected JournalArticleResourceLocalService journalArticleResourceLocalService;
533     @BeanReference(type = JournalArticleResourcePersistence.class)
534     protected JournalArticleResourcePersistence journalArticleResourcePersistence;
535     @BeanReference(type = JournalContentSearchLocalService.class)
536     protected JournalContentSearchLocalService journalContentSearchLocalService;
537     @BeanReference(type = JournalContentSearchPersistence.class)
538     protected JournalContentSearchPersistence journalContentSearchPersistence;
539     @BeanReference(type = JournalFeedLocalService.class)
540     protected JournalFeedLocalService journalFeedLocalService;
541     @BeanReference(type = JournalFeedService.class)
542     protected JournalFeedService journalFeedService;
543     @BeanReference(type = JournalFeedPersistence.class)
544     protected JournalFeedPersistence journalFeedPersistence;
545     @BeanReference(type = JournalFeedFinder.class)
546     protected JournalFeedFinder journalFeedFinder;
547     @BeanReference(type = JournalStructureLocalService.class)
548     protected JournalStructureLocalService journalStructureLocalService;
549     @BeanReference(type = JournalStructureService.class)
550     protected JournalStructureService journalStructureService;
551     @BeanReference(type = JournalStructurePersistence.class)
552     protected JournalStructurePersistence journalStructurePersistence;
553     @BeanReference(type = JournalStructureFinder.class)
554     protected JournalStructureFinder journalStructureFinder;
555     @BeanReference(type = JournalTemplateLocalService.class)
556     protected JournalTemplateLocalService journalTemplateLocalService;
557     @BeanReference(type = JournalTemplateService.class)
558     protected JournalTemplateService journalTemplateService;
559     @BeanReference(type = JournalTemplatePersistence.class)
560     protected JournalTemplatePersistence journalTemplatePersistence;
561     @BeanReference(type = JournalTemplateFinder.class)
562     protected JournalTemplateFinder journalTemplateFinder;
563     @BeanReference(type = CounterLocalService.class)
564     protected CounterLocalService counterLocalService;
565     @BeanReference(type = CounterService.class)
566     protected CounterService counterService;
567     @BeanReference(type = ImageLocalService.class)
568     protected ImageLocalService imageLocalService;
569     @BeanReference(type = ImageService.class)
570     protected ImageService imageService;
571     @BeanReference(type = ImagePersistence.class)
572     protected ImagePersistence imagePersistence;
573     @BeanReference(type = ResourceLocalService.class)
574     protected ResourceLocalService resourceLocalService;
575     @BeanReference(type = ResourceService.class)
576     protected ResourceService resourceService;
577     @BeanReference(type = ResourcePersistence.class)
578     protected ResourcePersistence resourcePersistence;
579     @BeanReference(type = ResourceFinder.class)
580     protected ResourceFinder resourceFinder;
581     @BeanReference(type = UserLocalService.class)
582     protected UserLocalService userLocalService;
583     @BeanReference(type = UserService.class)
584     protected UserService userService;
585     @BeanReference(type = UserPersistence.class)
586     protected UserPersistence userPersistence;
587     @BeanReference(type = UserFinder.class)
588     protected UserFinder userFinder;
589     @BeanReference(type = WebDAVPropsLocalService.class)
590     protected WebDAVPropsLocalService webDAVPropsLocalService;
591     @BeanReference(type = WebDAVPropsPersistence.class)
592     protected WebDAVPropsPersistence webDAVPropsPersistence;
593     @BeanReference(type = ExpandoValueLocalService.class)
594     protected ExpandoValueLocalService expandoValueLocalService;
595     @BeanReference(type = ExpandoValueService.class)
596     protected ExpandoValueService expandoValueService;
597     @BeanReference(type = ExpandoValuePersistence.class)
598     protected ExpandoValuePersistence expandoValuePersistence;
599 }