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