001
014
015 package com.liferay.portlet.journal.service.base;
016
017 import com.liferay.counter.service.CounterLocalService;
018
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.bean.IdentifiableBean;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
024 import com.liferay.portal.kernel.exception.PortalException;
025 import com.liferay.portal.kernel.exception.SystemException;
026 import com.liferay.portal.kernel.log.Log;
027 import com.liferay.portal.kernel.log.LogFactoryUtil;
028 import com.liferay.portal.kernel.search.Indexer;
029 import com.liferay.portal.kernel.search.IndexerRegistryUtil;
030 import com.liferay.portal.kernel.search.SearchException;
031 import com.liferay.portal.kernel.util.OrderByComparator;
032 import com.liferay.portal.model.PersistedModel;
033 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
034 import com.liferay.portal.service.ResourceLocalService;
035 import com.liferay.portal.service.ResourceService;
036 import com.liferay.portal.service.UserLocalService;
037 import com.liferay.portal.service.UserService;
038 import com.liferay.portal.service.persistence.ResourceFinder;
039 import com.liferay.portal.service.persistence.ResourcePersistence;
040 import com.liferay.portal.service.persistence.UserFinder;
041 import com.liferay.portal.service.persistence.UserPersistence;
042
043 import com.liferay.portlet.expando.service.ExpandoValueLocalService;
044 import com.liferay.portlet.expando.service.ExpandoValueService;
045 import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
046 import com.liferay.portlet.journal.model.JournalFeed;
047 import com.liferay.portlet.journal.service.JournalArticleImageLocalService;
048 import com.liferay.portlet.journal.service.JournalArticleLocalService;
049 import com.liferay.portlet.journal.service.JournalArticleResourceLocalService;
050 import com.liferay.portlet.journal.service.JournalArticleService;
051 import com.liferay.portlet.journal.service.JournalContentSearchLocalService;
052 import com.liferay.portlet.journal.service.JournalFeedLocalService;
053 import com.liferay.portlet.journal.service.JournalFeedService;
054 import com.liferay.portlet.journal.service.JournalStructureLocalService;
055 import com.liferay.portlet.journal.service.JournalStructureService;
056 import com.liferay.portlet.journal.service.JournalTemplateLocalService;
057 import com.liferay.portlet.journal.service.JournalTemplateService;
058 import com.liferay.portlet.journal.service.persistence.JournalArticleFinder;
059 import com.liferay.portlet.journal.service.persistence.JournalArticleImagePersistence;
060 import com.liferay.portlet.journal.service.persistence.JournalArticlePersistence;
061 import com.liferay.portlet.journal.service.persistence.JournalArticleResourcePersistence;
062 import com.liferay.portlet.journal.service.persistence.JournalContentSearchPersistence;
063 import com.liferay.portlet.journal.service.persistence.JournalFeedFinder;
064 import com.liferay.portlet.journal.service.persistence.JournalFeedPersistence;
065 import com.liferay.portlet.journal.service.persistence.JournalStructureFinder;
066 import com.liferay.portlet.journal.service.persistence.JournalStructurePersistence;
067 import com.liferay.portlet.journal.service.persistence.JournalTemplateFinder;
068 import com.liferay.portlet.journal.service.persistence.JournalTemplatePersistence;
069
070 import java.io.Serializable;
071
072 import java.util.List;
073
074 import javax.sql.DataSource;
075
076
088 public abstract class JournalFeedLocalServiceBaseImpl
089 implements JournalFeedLocalService, IdentifiableBean {
090
095
096
103 public JournalFeed addJournalFeed(JournalFeed journalFeed)
104 throws SystemException {
105 journalFeed.setNew(true);
106
107 journalFeed = journalFeedPersistence.update(journalFeed, false);
108
109 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
110
111 if (indexer != null) {
112 try {
113 indexer.reindex(journalFeed);
114 }
115 catch (SearchException se) {
116 if (_log.isWarnEnabled()) {
117 _log.warn(se, se);
118 }
119 }
120 }
121
122 return journalFeed;
123 }
124
125
131 public JournalFeed createJournalFeed(long id) {
132 return journalFeedPersistence.create(id);
133 }
134
135
142 public void deleteJournalFeed(long id)
143 throws PortalException, SystemException {
144 JournalFeed journalFeed = journalFeedPersistence.remove(id);
145
146 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
147
148 if (indexer != null) {
149 try {
150 indexer.delete(journalFeed);
151 }
152 catch (SearchException se) {
153 if (_log.isWarnEnabled()) {
154 _log.warn(se, se);
155 }
156 }
157 }
158 }
159
160
166 public void deleteJournalFeed(JournalFeed journalFeed)
167 throws SystemException {
168 journalFeedPersistence.remove(journalFeed);
169
170 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
171
172 if (indexer != null) {
173 try {
174 indexer.delete(journalFeed);
175 }
176 catch (SearchException se) {
177 if (_log.isWarnEnabled()) {
178 _log.warn(se, se);
179 }
180 }
181 }
182 }
183
184
191 @SuppressWarnings("rawtypes")
192 public List dynamicQuery(DynamicQuery dynamicQuery)
193 throws SystemException {
194 return journalFeedPersistence.findWithDynamicQuery(dynamicQuery);
195 }
196
197
210 @SuppressWarnings("rawtypes")
211 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
212 throws SystemException {
213 return journalFeedPersistence.findWithDynamicQuery(dynamicQuery, start,
214 end);
215 }
216
217
231 @SuppressWarnings("rawtypes")
232 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
233 OrderByComparator orderByComparator) throws SystemException {
234 return journalFeedPersistence.findWithDynamicQuery(dynamicQuery, start,
235 end, orderByComparator);
236 }
237
238
245 public long dynamicQueryCount(DynamicQuery dynamicQuery)
246 throws SystemException {
247 return journalFeedPersistence.countWithDynamicQuery(dynamicQuery);
248 }
249
250 public JournalFeed fetchJournalFeed(long id) throws SystemException {
251 return journalFeedPersistence.fetchByPrimaryKey(id);
252 }
253
254
262 public JournalFeed getJournalFeed(long id)
263 throws PortalException, SystemException {
264 return journalFeedPersistence.findByPrimaryKey(id);
265 }
266
267 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
268 throws PortalException, SystemException {
269 return journalFeedPersistence.findByPrimaryKey(primaryKeyObj);
270 }
271
272
281 public JournalFeed getJournalFeedByUuidAndGroupId(String uuid, long groupId)
282 throws PortalException, SystemException {
283 return journalFeedPersistence.findByUUID_G(uuid, groupId);
284 }
285
286
298 public List<JournalFeed> getJournalFeeds(int start, int end)
299 throws SystemException {
300 return journalFeedPersistence.findAll(start, end);
301 }
302
303
309 public int getJournalFeedsCount() throws SystemException {
310 return journalFeedPersistence.countAll();
311 }
312
313
320 public JournalFeed updateJournalFeed(JournalFeed journalFeed)
321 throws SystemException {
322 return updateJournalFeed(journalFeed, true);
323 }
324
325
333 public JournalFeed updateJournalFeed(JournalFeed journalFeed, boolean merge)
334 throws SystemException {
335 journalFeed.setNew(false);
336
337 journalFeed = journalFeedPersistence.update(journalFeed, merge);
338
339 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
340
341 if (indexer != null) {
342 try {
343 indexer.reindex(journalFeed);
344 }
345 catch (SearchException se) {
346 if (_log.isWarnEnabled()) {
347 _log.warn(se, se);
348 }
349 }
350 }
351
352 return journalFeed;
353 }
354
355
360 public JournalArticleLocalService getJournalArticleLocalService() {
361 return journalArticleLocalService;
362 }
363
364
369 public void setJournalArticleLocalService(
370 JournalArticleLocalService journalArticleLocalService) {
371 this.journalArticleLocalService = journalArticleLocalService;
372 }
373
374
379 public JournalArticleService getJournalArticleService() {
380 return journalArticleService;
381 }
382
383
388 public void setJournalArticleService(
389 JournalArticleService journalArticleService) {
390 this.journalArticleService = journalArticleService;
391 }
392
393
398 public JournalArticlePersistence getJournalArticlePersistence() {
399 return journalArticlePersistence;
400 }
401
402
407 public void setJournalArticlePersistence(
408 JournalArticlePersistence journalArticlePersistence) {
409 this.journalArticlePersistence = journalArticlePersistence;
410 }
411
412
417 public JournalArticleFinder getJournalArticleFinder() {
418 return journalArticleFinder;
419 }
420
421
426 public void setJournalArticleFinder(
427 JournalArticleFinder journalArticleFinder) {
428 this.journalArticleFinder = journalArticleFinder;
429 }
430
431
436 public JournalArticleImageLocalService getJournalArticleImageLocalService() {
437 return journalArticleImageLocalService;
438 }
439
440
445 public void setJournalArticleImageLocalService(
446 JournalArticleImageLocalService journalArticleImageLocalService) {
447 this.journalArticleImageLocalService = journalArticleImageLocalService;
448 }
449
450
455 public JournalArticleImagePersistence getJournalArticleImagePersistence() {
456 return journalArticleImagePersistence;
457 }
458
459
464 public void setJournalArticleImagePersistence(
465 JournalArticleImagePersistence journalArticleImagePersistence) {
466 this.journalArticleImagePersistence = journalArticleImagePersistence;
467 }
468
469
474 public JournalArticleResourceLocalService getJournalArticleResourceLocalService() {
475 return journalArticleResourceLocalService;
476 }
477
478
483 public void setJournalArticleResourceLocalService(
484 JournalArticleResourceLocalService journalArticleResourceLocalService) {
485 this.journalArticleResourceLocalService = journalArticleResourceLocalService;
486 }
487
488
493 public JournalArticleResourcePersistence getJournalArticleResourcePersistence() {
494 return journalArticleResourcePersistence;
495 }
496
497
502 public void setJournalArticleResourcePersistence(
503 JournalArticleResourcePersistence journalArticleResourcePersistence) {
504 this.journalArticleResourcePersistence = journalArticleResourcePersistence;
505 }
506
507
512 public JournalContentSearchLocalService getJournalContentSearchLocalService() {
513 return journalContentSearchLocalService;
514 }
515
516
521 public void setJournalContentSearchLocalService(
522 JournalContentSearchLocalService journalContentSearchLocalService) {
523 this.journalContentSearchLocalService = journalContentSearchLocalService;
524 }
525
526
531 public JournalContentSearchPersistence getJournalContentSearchPersistence() {
532 return journalContentSearchPersistence;
533 }
534
535
540 public void setJournalContentSearchPersistence(
541 JournalContentSearchPersistence journalContentSearchPersistence) {
542 this.journalContentSearchPersistence = journalContentSearchPersistence;
543 }
544
545
550 public JournalFeedLocalService getJournalFeedLocalService() {
551 return journalFeedLocalService;
552 }
553
554
559 public void setJournalFeedLocalService(
560 JournalFeedLocalService journalFeedLocalService) {
561 this.journalFeedLocalService = journalFeedLocalService;
562 }
563
564
569 public JournalFeedService getJournalFeedService() {
570 return journalFeedService;
571 }
572
573
578 public void setJournalFeedService(JournalFeedService journalFeedService) {
579 this.journalFeedService = journalFeedService;
580 }
581
582
587 public JournalFeedPersistence getJournalFeedPersistence() {
588 return journalFeedPersistence;
589 }
590
591
596 public void setJournalFeedPersistence(
597 JournalFeedPersistence journalFeedPersistence) {
598 this.journalFeedPersistence = journalFeedPersistence;
599 }
600
601
606 public JournalFeedFinder getJournalFeedFinder() {
607 return journalFeedFinder;
608 }
609
610
615 public void setJournalFeedFinder(JournalFeedFinder journalFeedFinder) {
616 this.journalFeedFinder = journalFeedFinder;
617 }
618
619
624 public JournalStructureLocalService getJournalStructureLocalService() {
625 return journalStructureLocalService;
626 }
627
628
633 public void setJournalStructureLocalService(
634 JournalStructureLocalService journalStructureLocalService) {
635 this.journalStructureLocalService = journalStructureLocalService;
636 }
637
638
643 public JournalStructureService getJournalStructureService() {
644 return journalStructureService;
645 }
646
647
652 public void setJournalStructureService(
653 JournalStructureService journalStructureService) {
654 this.journalStructureService = journalStructureService;
655 }
656
657
662 public JournalStructurePersistence getJournalStructurePersistence() {
663 return journalStructurePersistence;
664 }
665
666
671 public void setJournalStructurePersistence(
672 JournalStructurePersistence journalStructurePersistence) {
673 this.journalStructurePersistence = journalStructurePersistence;
674 }
675
676
681 public JournalStructureFinder getJournalStructureFinder() {
682 return journalStructureFinder;
683 }
684
685
690 public void setJournalStructureFinder(
691 JournalStructureFinder journalStructureFinder) {
692 this.journalStructureFinder = journalStructureFinder;
693 }
694
695
700 public JournalTemplateLocalService getJournalTemplateLocalService() {
701 return journalTemplateLocalService;
702 }
703
704
709 public void setJournalTemplateLocalService(
710 JournalTemplateLocalService journalTemplateLocalService) {
711 this.journalTemplateLocalService = journalTemplateLocalService;
712 }
713
714
719 public JournalTemplateService getJournalTemplateService() {
720 return journalTemplateService;
721 }
722
723
728 public void setJournalTemplateService(
729 JournalTemplateService journalTemplateService) {
730 this.journalTemplateService = journalTemplateService;
731 }
732
733
738 public JournalTemplatePersistence getJournalTemplatePersistence() {
739 return journalTemplatePersistence;
740 }
741
742
747 public void setJournalTemplatePersistence(
748 JournalTemplatePersistence journalTemplatePersistence) {
749 this.journalTemplatePersistence = journalTemplatePersistence;
750 }
751
752
757 public JournalTemplateFinder getJournalTemplateFinder() {
758 return journalTemplateFinder;
759 }
760
761
766 public void setJournalTemplateFinder(
767 JournalTemplateFinder journalTemplateFinder) {
768 this.journalTemplateFinder = journalTemplateFinder;
769 }
770
771
776 public CounterLocalService getCounterLocalService() {
777 return counterLocalService;
778 }
779
780
785 public void setCounterLocalService(CounterLocalService counterLocalService) {
786 this.counterLocalService = counterLocalService;
787 }
788
789
794 public ResourceLocalService getResourceLocalService() {
795 return resourceLocalService;
796 }
797
798
803 public void setResourceLocalService(
804 ResourceLocalService resourceLocalService) {
805 this.resourceLocalService = resourceLocalService;
806 }
807
808
813 public ResourceService getResourceService() {
814 return resourceService;
815 }
816
817
822 public void setResourceService(ResourceService resourceService) {
823 this.resourceService = resourceService;
824 }
825
826
831 public ResourcePersistence getResourcePersistence() {
832 return resourcePersistence;
833 }
834
835
840 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
841 this.resourcePersistence = resourcePersistence;
842 }
843
844
849 public ResourceFinder getResourceFinder() {
850 return resourceFinder;
851 }
852
853
858 public void setResourceFinder(ResourceFinder resourceFinder) {
859 this.resourceFinder = resourceFinder;
860 }
861
862
867 public UserLocalService getUserLocalService() {
868 return userLocalService;
869 }
870
871
876 public void setUserLocalService(UserLocalService userLocalService) {
877 this.userLocalService = userLocalService;
878 }
879
880
885 public UserService getUserService() {
886 return userService;
887 }
888
889
894 public void setUserService(UserService userService) {
895 this.userService = userService;
896 }
897
898
903 public UserPersistence getUserPersistence() {
904 return userPersistence;
905 }
906
907
912 public void setUserPersistence(UserPersistence userPersistence) {
913 this.userPersistence = userPersistence;
914 }
915
916
921 public UserFinder getUserFinder() {
922 return userFinder;
923 }
924
925
930 public void setUserFinder(UserFinder userFinder) {
931 this.userFinder = userFinder;
932 }
933
934
939 public ExpandoValueLocalService getExpandoValueLocalService() {
940 return expandoValueLocalService;
941 }
942
943
948 public void setExpandoValueLocalService(
949 ExpandoValueLocalService expandoValueLocalService) {
950 this.expandoValueLocalService = expandoValueLocalService;
951 }
952
953
958 public ExpandoValueService getExpandoValueService() {
959 return expandoValueService;
960 }
961
962
967 public void setExpandoValueService(ExpandoValueService expandoValueService) {
968 this.expandoValueService = expandoValueService;
969 }
970
971
976 public ExpandoValuePersistence getExpandoValuePersistence() {
977 return expandoValuePersistence;
978 }
979
980
985 public void setExpandoValuePersistence(
986 ExpandoValuePersistence expandoValuePersistence) {
987 this.expandoValuePersistence = expandoValuePersistence;
988 }
989
990 public void afterPropertiesSet() {
991 persistedModelLocalServiceRegistry.register("com.liferay.portlet.journal.model.JournalFeed",
992 journalFeedLocalService);
993 }
994
995 public void destroy() {
996 persistedModelLocalServiceRegistry.unregister(
997 "com.liferay.portlet.journal.model.JournalFeed");
998 }
999
1000
1005 public String getBeanIdentifier() {
1006 return _beanIdentifier;
1007 }
1008
1009
1014 public void setBeanIdentifier(String beanIdentifier) {
1015 _beanIdentifier = beanIdentifier;
1016 }
1017
1018 protected ClassLoader getClassLoader() {
1019 Class<?> clazz = getClass();
1020
1021 return clazz.getClassLoader();
1022 }
1023
1024 protected Class<?> getModelClass() {
1025 return JournalFeed.class;
1026 }
1027
1028 protected String getModelClassName() {
1029 return JournalFeed.class.getName();
1030 }
1031
1032
1037 protected void runSQL(String sql) throws SystemException {
1038 try {
1039 DataSource dataSource = journalFeedPersistence.getDataSource();
1040
1041 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1042 sql, new int[0]);
1043
1044 sqlUpdate.update();
1045 }
1046 catch (Exception e) {
1047 throw new SystemException(e);
1048 }
1049 }
1050
1051 @BeanReference(type = JournalArticleLocalService.class)
1052 protected JournalArticleLocalService journalArticleLocalService;
1053 @BeanReference(type = JournalArticleService.class)
1054 protected JournalArticleService journalArticleService;
1055 @BeanReference(type = JournalArticlePersistence.class)
1056 protected JournalArticlePersistence journalArticlePersistence;
1057 @BeanReference(type = JournalArticleFinder.class)
1058 protected JournalArticleFinder journalArticleFinder;
1059 @BeanReference(type = JournalArticleImageLocalService.class)
1060 protected JournalArticleImageLocalService journalArticleImageLocalService;
1061 @BeanReference(type = JournalArticleImagePersistence.class)
1062 protected JournalArticleImagePersistence journalArticleImagePersistence;
1063 @BeanReference(type = JournalArticleResourceLocalService.class)
1064 protected JournalArticleResourceLocalService journalArticleResourceLocalService;
1065 @BeanReference(type = JournalArticleResourcePersistence.class)
1066 protected JournalArticleResourcePersistence journalArticleResourcePersistence;
1067 @BeanReference(type = JournalContentSearchLocalService.class)
1068 protected JournalContentSearchLocalService journalContentSearchLocalService;
1069 @BeanReference(type = JournalContentSearchPersistence.class)
1070 protected JournalContentSearchPersistence journalContentSearchPersistence;
1071 @BeanReference(type = JournalFeedLocalService.class)
1072 protected JournalFeedLocalService journalFeedLocalService;
1073 @BeanReference(type = JournalFeedService.class)
1074 protected JournalFeedService journalFeedService;
1075 @BeanReference(type = JournalFeedPersistence.class)
1076 protected JournalFeedPersistence journalFeedPersistence;
1077 @BeanReference(type = JournalFeedFinder.class)
1078 protected JournalFeedFinder journalFeedFinder;
1079 @BeanReference(type = JournalStructureLocalService.class)
1080 protected JournalStructureLocalService journalStructureLocalService;
1081 @BeanReference(type = JournalStructureService.class)
1082 protected JournalStructureService journalStructureService;
1083 @BeanReference(type = JournalStructurePersistence.class)
1084 protected JournalStructurePersistence journalStructurePersistence;
1085 @BeanReference(type = JournalStructureFinder.class)
1086 protected JournalStructureFinder journalStructureFinder;
1087 @BeanReference(type = JournalTemplateLocalService.class)
1088 protected JournalTemplateLocalService journalTemplateLocalService;
1089 @BeanReference(type = JournalTemplateService.class)
1090 protected JournalTemplateService journalTemplateService;
1091 @BeanReference(type = JournalTemplatePersistence.class)
1092 protected JournalTemplatePersistence journalTemplatePersistence;
1093 @BeanReference(type = JournalTemplateFinder.class)
1094 protected JournalTemplateFinder journalTemplateFinder;
1095 @BeanReference(type = CounterLocalService.class)
1096 protected CounterLocalService counterLocalService;
1097 @BeanReference(type = ResourceLocalService.class)
1098 protected ResourceLocalService resourceLocalService;
1099 @BeanReference(type = ResourceService.class)
1100 protected ResourceService resourceService;
1101 @BeanReference(type = ResourcePersistence.class)
1102 protected ResourcePersistence resourcePersistence;
1103 @BeanReference(type = ResourceFinder.class)
1104 protected ResourceFinder resourceFinder;
1105 @BeanReference(type = UserLocalService.class)
1106 protected UserLocalService userLocalService;
1107 @BeanReference(type = UserService.class)
1108 protected UserService userService;
1109 @BeanReference(type = UserPersistence.class)
1110 protected UserPersistence userPersistence;
1111 @BeanReference(type = UserFinder.class)
1112 protected UserFinder userFinder;
1113 @BeanReference(type = ExpandoValueLocalService.class)
1114 protected ExpandoValueLocalService expandoValueLocalService;
1115 @BeanReference(type = ExpandoValueService.class)
1116 protected ExpandoValueService expandoValueService;
1117 @BeanReference(type = ExpandoValuePersistence.class)
1118 protected ExpandoValuePersistence expandoValuePersistence;
1119 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1120 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1121 private static Log _log = LogFactoryUtil.getLog(JournalFeedLocalServiceBaseImpl.class);
1122 private String _beanIdentifier;
1123 }