001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.journal.service.base;
016    
017    import com.liferay.counter.service.CounterLocalService;
018    
019    import com.liferay.portal.kernel.annotation.BeanReference;
020    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023    import com.liferay.portal.kernel.exception.PortalException;
024    import com.liferay.portal.kernel.exception.SystemException;
025    import com.liferay.portal.kernel.util.OrderByComparator;
026    import com.liferay.portal.service.ResourceLocalService;
027    import com.liferay.portal.service.ResourceService;
028    import com.liferay.portal.service.UserLocalService;
029    import com.liferay.portal.service.UserService;
030    import com.liferay.portal.service.persistence.ResourceFinder;
031    import com.liferay.portal.service.persistence.ResourcePersistence;
032    import com.liferay.portal.service.persistence.UserFinder;
033    import com.liferay.portal.service.persistence.UserPersistence;
034    
035    import com.liferay.portlet.expando.service.ExpandoValueLocalService;
036    import com.liferay.portlet.expando.service.ExpandoValueService;
037    import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
038    import com.liferay.portlet.journal.model.JournalFeed;
039    import com.liferay.portlet.journal.service.JournalArticleImageLocalService;
040    import com.liferay.portlet.journal.service.JournalArticleLocalService;
041    import com.liferay.portlet.journal.service.JournalArticleResourceLocalService;
042    import com.liferay.portlet.journal.service.JournalArticleService;
043    import com.liferay.portlet.journal.service.JournalContentSearchLocalService;
044    import com.liferay.portlet.journal.service.JournalFeedLocalService;
045    import com.liferay.portlet.journal.service.JournalFeedService;
046    import com.liferay.portlet.journal.service.JournalStructureLocalService;
047    import com.liferay.portlet.journal.service.JournalStructureService;
048    import com.liferay.portlet.journal.service.JournalTemplateLocalService;
049    import com.liferay.portlet.journal.service.JournalTemplateService;
050    import com.liferay.portlet.journal.service.persistence.JournalArticleFinder;
051    import com.liferay.portlet.journal.service.persistence.JournalArticleImagePersistence;
052    import com.liferay.portlet.journal.service.persistence.JournalArticlePersistence;
053    import com.liferay.portlet.journal.service.persistence.JournalArticleResourcePersistence;
054    import com.liferay.portlet.journal.service.persistence.JournalContentSearchPersistence;
055    import com.liferay.portlet.journal.service.persistence.JournalFeedFinder;
056    import com.liferay.portlet.journal.service.persistence.JournalFeedPersistence;
057    import com.liferay.portlet.journal.service.persistence.JournalStructureFinder;
058    import com.liferay.portlet.journal.service.persistence.JournalStructurePersistence;
059    import com.liferay.portlet.journal.service.persistence.JournalTemplateFinder;
060    import com.liferay.portlet.journal.service.persistence.JournalTemplatePersistence;
061    
062    import java.util.List;
063    
064    import javax.sql.DataSource;
065    
066    /**
067     * @author Brian Wing Shun Chan
068     */
069    public abstract class JournalFeedLocalServiceBaseImpl
070            implements JournalFeedLocalService {
071            public JournalFeed addJournalFeed(JournalFeed journalFeed)
072                    throws SystemException {
073                    journalFeed.setNew(true);
074    
075                    return journalFeedPersistence.update(journalFeed, false);
076            }
077    
078            public JournalFeed createJournalFeed(long id) {
079                    return journalFeedPersistence.create(id);
080            }
081    
082            public void deleteJournalFeed(long id)
083                    throws PortalException, SystemException {
084                    journalFeedPersistence.remove(id);
085            }
086    
087            public void deleteJournalFeed(JournalFeed journalFeed)
088                    throws SystemException {
089                    journalFeedPersistence.remove(journalFeed);
090            }
091    
092            @SuppressWarnings("unchecked")
093            public List dynamicQuery(DynamicQuery dynamicQuery)
094                    throws SystemException {
095                    return journalFeedPersistence.findWithDynamicQuery(dynamicQuery);
096            }
097    
098            @SuppressWarnings("unchecked")
099            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
100                    throws SystemException {
101                    return journalFeedPersistence.findWithDynamicQuery(dynamicQuery, start,
102                            end);
103            }
104    
105            @SuppressWarnings("unchecked")
106            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
107                    OrderByComparator orderByComparator) throws SystemException {
108                    return journalFeedPersistence.findWithDynamicQuery(dynamicQuery, start,
109                            end, orderByComparator);
110            }
111    
112            public long dynamicQueryCount(DynamicQuery dynamicQuery)
113                    throws SystemException {
114                    return journalFeedPersistence.countWithDynamicQuery(dynamicQuery);
115            }
116    
117            public JournalFeed getJournalFeed(long id)
118                    throws PortalException, SystemException {
119                    return journalFeedPersistence.findByPrimaryKey(id);
120            }
121    
122            public JournalFeed getJournalFeedByUuidAndGroupId(String uuid, long groupId)
123                    throws PortalException, SystemException {
124                    return journalFeedPersistence.findByUUID_G(uuid, groupId);
125            }
126    
127            public List<JournalFeed> getJournalFeeds(int start, int end)
128                    throws SystemException {
129                    return journalFeedPersistence.findAll(start, end);
130            }
131    
132            public int getJournalFeedsCount() throws SystemException {
133                    return journalFeedPersistence.countAll();
134            }
135    
136            public JournalFeed updateJournalFeed(JournalFeed journalFeed)
137                    throws SystemException {
138                    journalFeed.setNew(false);
139    
140                    return journalFeedPersistence.update(journalFeed, true);
141            }
142    
143            public JournalFeed updateJournalFeed(JournalFeed journalFeed, boolean merge)
144                    throws SystemException {
145                    journalFeed.setNew(false);
146    
147                    return journalFeedPersistence.update(journalFeed, merge);
148            }
149    
150            public JournalArticleLocalService getJournalArticleLocalService() {
151                    return journalArticleLocalService;
152            }
153    
154            public void setJournalArticleLocalService(
155                    JournalArticleLocalService journalArticleLocalService) {
156                    this.journalArticleLocalService = journalArticleLocalService;
157            }
158    
159            public JournalArticleService getJournalArticleService() {
160                    return journalArticleService;
161            }
162    
163            public void setJournalArticleService(
164                    JournalArticleService journalArticleService) {
165                    this.journalArticleService = journalArticleService;
166            }
167    
168            public JournalArticlePersistence getJournalArticlePersistence() {
169                    return journalArticlePersistence;
170            }
171    
172            public void setJournalArticlePersistence(
173                    JournalArticlePersistence journalArticlePersistence) {
174                    this.journalArticlePersistence = journalArticlePersistence;
175            }
176    
177            public JournalArticleFinder getJournalArticleFinder() {
178                    return journalArticleFinder;
179            }
180    
181            public void setJournalArticleFinder(
182                    JournalArticleFinder journalArticleFinder) {
183                    this.journalArticleFinder = journalArticleFinder;
184            }
185    
186            public JournalArticleImageLocalService getJournalArticleImageLocalService() {
187                    return journalArticleImageLocalService;
188            }
189    
190            public void setJournalArticleImageLocalService(
191                    JournalArticleImageLocalService journalArticleImageLocalService) {
192                    this.journalArticleImageLocalService = journalArticleImageLocalService;
193            }
194    
195            public JournalArticleImagePersistence getJournalArticleImagePersistence() {
196                    return journalArticleImagePersistence;
197            }
198    
199            public void setJournalArticleImagePersistence(
200                    JournalArticleImagePersistence journalArticleImagePersistence) {
201                    this.journalArticleImagePersistence = journalArticleImagePersistence;
202            }
203    
204            public JournalArticleResourceLocalService getJournalArticleResourceLocalService() {
205                    return journalArticleResourceLocalService;
206            }
207    
208            public void setJournalArticleResourceLocalService(
209                    JournalArticleResourceLocalService journalArticleResourceLocalService) {
210                    this.journalArticleResourceLocalService = journalArticleResourceLocalService;
211            }
212    
213            public JournalArticleResourcePersistence getJournalArticleResourcePersistence() {
214                    return journalArticleResourcePersistence;
215            }
216    
217            public void setJournalArticleResourcePersistence(
218                    JournalArticleResourcePersistence journalArticleResourcePersistence) {
219                    this.journalArticleResourcePersistence = journalArticleResourcePersistence;
220            }
221    
222            public JournalContentSearchLocalService getJournalContentSearchLocalService() {
223                    return journalContentSearchLocalService;
224            }
225    
226            public void setJournalContentSearchLocalService(
227                    JournalContentSearchLocalService journalContentSearchLocalService) {
228                    this.journalContentSearchLocalService = journalContentSearchLocalService;
229            }
230    
231            public JournalContentSearchPersistence getJournalContentSearchPersistence() {
232                    return journalContentSearchPersistence;
233            }
234    
235            public void setJournalContentSearchPersistence(
236                    JournalContentSearchPersistence journalContentSearchPersistence) {
237                    this.journalContentSearchPersistence = journalContentSearchPersistence;
238            }
239    
240            public JournalFeedLocalService getJournalFeedLocalService() {
241                    return journalFeedLocalService;
242            }
243    
244            public void setJournalFeedLocalService(
245                    JournalFeedLocalService journalFeedLocalService) {
246                    this.journalFeedLocalService = journalFeedLocalService;
247            }
248    
249            public JournalFeedService getJournalFeedService() {
250                    return journalFeedService;
251            }
252    
253            public void setJournalFeedService(JournalFeedService journalFeedService) {
254                    this.journalFeedService = journalFeedService;
255            }
256    
257            public JournalFeedPersistence getJournalFeedPersistence() {
258                    return journalFeedPersistence;
259            }
260    
261            public void setJournalFeedPersistence(
262                    JournalFeedPersistence journalFeedPersistence) {
263                    this.journalFeedPersistence = journalFeedPersistence;
264            }
265    
266            public JournalFeedFinder getJournalFeedFinder() {
267                    return journalFeedFinder;
268            }
269    
270            public void setJournalFeedFinder(JournalFeedFinder journalFeedFinder) {
271                    this.journalFeedFinder = journalFeedFinder;
272            }
273    
274            public JournalStructureLocalService getJournalStructureLocalService() {
275                    return journalStructureLocalService;
276            }
277    
278            public void setJournalStructureLocalService(
279                    JournalStructureLocalService journalStructureLocalService) {
280                    this.journalStructureLocalService = journalStructureLocalService;
281            }
282    
283            public JournalStructureService getJournalStructureService() {
284                    return journalStructureService;
285            }
286    
287            public void setJournalStructureService(
288                    JournalStructureService journalStructureService) {
289                    this.journalStructureService = journalStructureService;
290            }
291    
292            public JournalStructurePersistence getJournalStructurePersistence() {
293                    return journalStructurePersistence;
294            }
295    
296            public void setJournalStructurePersistence(
297                    JournalStructurePersistence journalStructurePersistence) {
298                    this.journalStructurePersistence = journalStructurePersistence;
299            }
300    
301            public JournalStructureFinder getJournalStructureFinder() {
302                    return journalStructureFinder;
303            }
304    
305            public void setJournalStructureFinder(
306                    JournalStructureFinder journalStructureFinder) {
307                    this.journalStructureFinder = journalStructureFinder;
308            }
309    
310            public JournalTemplateLocalService getJournalTemplateLocalService() {
311                    return journalTemplateLocalService;
312            }
313    
314            public void setJournalTemplateLocalService(
315                    JournalTemplateLocalService journalTemplateLocalService) {
316                    this.journalTemplateLocalService = journalTemplateLocalService;
317            }
318    
319            public JournalTemplateService getJournalTemplateService() {
320                    return journalTemplateService;
321            }
322    
323            public void setJournalTemplateService(
324                    JournalTemplateService journalTemplateService) {
325                    this.journalTemplateService = journalTemplateService;
326            }
327    
328            public JournalTemplatePersistence getJournalTemplatePersistence() {
329                    return journalTemplatePersistence;
330            }
331    
332            public void setJournalTemplatePersistence(
333                    JournalTemplatePersistence journalTemplatePersistence) {
334                    this.journalTemplatePersistence = journalTemplatePersistence;
335            }
336    
337            public JournalTemplateFinder getJournalTemplateFinder() {
338                    return journalTemplateFinder;
339            }
340    
341            public void setJournalTemplateFinder(
342                    JournalTemplateFinder journalTemplateFinder) {
343                    this.journalTemplateFinder = journalTemplateFinder;
344            }
345    
346            public CounterLocalService getCounterLocalService() {
347                    return counterLocalService;
348            }
349    
350            public void setCounterLocalService(CounterLocalService counterLocalService) {
351                    this.counterLocalService = counterLocalService;
352            }
353    
354            public ResourceLocalService getResourceLocalService() {
355                    return resourceLocalService;
356            }
357    
358            public void setResourceLocalService(
359                    ResourceLocalService resourceLocalService) {
360                    this.resourceLocalService = resourceLocalService;
361            }
362    
363            public ResourceService getResourceService() {
364                    return resourceService;
365            }
366    
367            public void setResourceService(ResourceService resourceService) {
368                    this.resourceService = resourceService;
369            }
370    
371            public ResourcePersistence getResourcePersistence() {
372                    return resourcePersistence;
373            }
374    
375            public void setResourcePersistence(ResourcePersistence resourcePersistence) {
376                    this.resourcePersistence = resourcePersistence;
377            }
378    
379            public ResourceFinder getResourceFinder() {
380                    return resourceFinder;
381            }
382    
383            public void setResourceFinder(ResourceFinder resourceFinder) {
384                    this.resourceFinder = resourceFinder;
385            }
386    
387            public UserLocalService getUserLocalService() {
388                    return userLocalService;
389            }
390    
391            public void setUserLocalService(UserLocalService userLocalService) {
392                    this.userLocalService = userLocalService;
393            }
394    
395            public UserService getUserService() {
396                    return userService;
397            }
398    
399            public void setUserService(UserService userService) {
400                    this.userService = userService;
401            }
402    
403            public UserPersistence getUserPersistence() {
404                    return userPersistence;
405            }
406    
407            public void setUserPersistence(UserPersistence userPersistence) {
408                    this.userPersistence = userPersistence;
409            }
410    
411            public UserFinder getUserFinder() {
412                    return userFinder;
413            }
414    
415            public void setUserFinder(UserFinder userFinder) {
416                    this.userFinder = userFinder;
417            }
418    
419            public ExpandoValueLocalService getExpandoValueLocalService() {
420                    return expandoValueLocalService;
421            }
422    
423            public void setExpandoValueLocalService(
424                    ExpandoValueLocalService expandoValueLocalService) {
425                    this.expandoValueLocalService = expandoValueLocalService;
426            }
427    
428            public ExpandoValueService getExpandoValueService() {
429                    return expandoValueService;
430            }
431    
432            public void setExpandoValueService(ExpandoValueService expandoValueService) {
433                    this.expandoValueService = expandoValueService;
434            }
435    
436            public ExpandoValuePersistence getExpandoValuePersistence() {
437                    return expandoValuePersistence;
438            }
439    
440            public void setExpandoValuePersistence(
441                    ExpandoValuePersistence expandoValuePersistence) {
442                    this.expandoValuePersistence = expandoValuePersistence;
443            }
444    
445            protected void runSQL(String sql) throws SystemException {
446                    try {
447                            DataSource dataSource = journalFeedPersistence.getDataSource();
448    
449                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
450                                            sql, new int[0]);
451    
452                            sqlUpdate.update();
453                    }
454                    catch (Exception e) {
455                            throw new SystemException(e);
456                    }
457            }
458    
459            @BeanReference(type = JournalArticleLocalService.class)
460            protected JournalArticleLocalService journalArticleLocalService;
461            @BeanReference(type = JournalArticleService.class)
462            protected JournalArticleService journalArticleService;
463            @BeanReference(type = JournalArticlePersistence.class)
464            protected JournalArticlePersistence journalArticlePersistence;
465            @BeanReference(type = JournalArticleFinder.class)
466            protected JournalArticleFinder journalArticleFinder;
467            @BeanReference(type = JournalArticleImageLocalService.class)
468            protected JournalArticleImageLocalService journalArticleImageLocalService;
469            @BeanReference(type = JournalArticleImagePersistence.class)
470            protected JournalArticleImagePersistence journalArticleImagePersistence;
471            @BeanReference(type = JournalArticleResourceLocalService.class)
472            protected JournalArticleResourceLocalService journalArticleResourceLocalService;
473            @BeanReference(type = JournalArticleResourcePersistence.class)
474            protected JournalArticleResourcePersistence journalArticleResourcePersistence;
475            @BeanReference(type = JournalContentSearchLocalService.class)
476            protected JournalContentSearchLocalService journalContentSearchLocalService;
477            @BeanReference(type = JournalContentSearchPersistence.class)
478            protected JournalContentSearchPersistence journalContentSearchPersistence;
479            @BeanReference(type = JournalFeedLocalService.class)
480            protected JournalFeedLocalService journalFeedLocalService;
481            @BeanReference(type = JournalFeedService.class)
482            protected JournalFeedService journalFeedService;
483            @BeanReference(type = JournalFeedPersistence.class)
484            protected JournalFeedPersistence journalFeedPersistence;
485            @BeanReference(type = JournalFeedFinder.class)
486            protected JournalFeedFinder journalFeedFinder;
487            @BeanReference(type = JournalStructureLocalService.class)
488            protected JournalStructureLocalService journalStructureLocalService;
489            @BeanReference(type = JournalStructureService.class)
490            protected JournalStructureService journalStructureService;
491            @BeanReference(type = JournalStructurePersistence.class)
492            protected JournalStructurePersistence journalStructurePersistence;
493            @BeanReference(type = JournalStructureFinder.class)
494            protected JournalStructureFinder journalStructureFinder;
495            @BeanReference(type = JournalTemplateLocalService.class)
496            protected JournalTemplateLocalService journalTemplateLocalService;
497            @BeanReference(type = JournalTemplateService.class)
498            protected JournalTemplateService journalTemplateService;
499            @BeanReference(type = JournalTemplatePersistence.class)
500            protected JournalTemplatePersistence journalTemplatePersistence;
501            @BeanReference(type = JournalTemplateFinder.class)
502            protected JournalTemplateFinder journalTemplateFinder;
503            @BeanReference(type = CounterLocalService.class)
504            protected CounterLocalService counterLocalService;
505            @BeanReference(type = ResourceLocalService.class)
506            protected ResourceLocalService resourceLocalService;
507            @BeanReference(type = ResourceService.class)
508            protected ResourceService resourceService;
509            @BeanReference(type = ResourcePersistence.class)
510            protected ResourcePersistence resourcePersistence;
511            @BeanReference(type = ResourceFinder.class)
512            protected ResourceFinder resourceFinder;
513            @BeanReference(type = UserLocalService.class)
514            protected UserLocalService userLocalService;
515            @BeanReference(type = UserService.class)
516            protected UserService userService;
517            @BeanReference(type = UserPersistence.class)
518            protected UserPersistence userPersistence;
519            @BeanReference(type = UserFinder.class)
520            protected UserFinder userFinder;
521            @BeanReference(type = ExpandoValueLocalService.class)
522            protected ExpandoValueLocalService expandoValueLocalService;
523            @BeanReference(type = ExpandoValueService.class)
524            protected ExpandoValueService expandoValueService;
525            @BeanReference(type = ExpandoValuePersistence.class)
526            protected ExpandoValuePersistence expandoValuePersistence;
527    }