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