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.WebDAVPropsLocalService;
039 import com.liferay.portal.service.persistence.ResourceFinder;
040 import com.liferay.portal.service.persistence.ResourcePersistence;
041 import com.liferay.portal.service.persistence.UserFinder;
042 import com.liferay.portal.service.persistence.UserPersistence;
043 import com.liferay.portal.service.persistence.WebDAVPropsPersistence;
044
045 import com.liferay.portlet.expando.service.ExpandoValueLocalService;
046 import com.liferay.portlet.expando.service.ExpandoValueService;
047 import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
048 import com.liferay.portlet.journal.model.JournalStructure;
049 import com.liferay.portlet.journal.service.JournalArticleImageLocalService;
050 import com.liferay.portlet.journal.service.JournalArticleLocalService;
051 import com.liferay.portlet.journal.service.JournalArticleResourceLocalService;
052 import com.liferay.portlet.journal.service.JournalArticleService;
053 import com.liferay.portlet.journal.service.JournalContentSearchLocalService;
054 import com.liferay.portlet.journal.service.JournalFeedLocalService;
055 import com.liferay.portlet.journal.service.JournalFeedService;
056 import com.liferay.portlet.journal.service.JournalStructureLocalService;
057 import com.liferay.portlet.journal.service.JournalStructureService;
058 import com.liferay.portlet.journal.service.JournalTemplateLocalService;
059 import com.liferay.portlet.journal.service.JournalTemplateService;
060 import com.liferay.portlet.journal.service.persistence.JournalArticleFinder;
061 import com.liferay.portlet.journal.service.persistence.JournalArticleImagePersistence;
062 import com.liferay.portlet.journal.service.persistence.JournalArticlePersistence;
063 import com.liferay.portlet.journal.service.persistence.JournalArticleResourcePersistence;
064 import com.liferay.portlet.journal.service.persistence.JournalContentSearchPersistence;
065 import com.liferay.portlet.journal.service.persistence.JournalFeedFinder;
066 import com.liferay.portlet.journal.service.persistence.JournalFeedPersistence;
067 import com.liferay.portlet.journal.service.persistence.JournalStructureFinder;
068 import com.liferay.portlet.journal.service.persistence.JournalStructurePersistence;
069 import com.liferay.portlet.journal.service.persistence.JournalTemplateFinder;
070 import com.liferay.portlet.journal.service.persistence.JournalTemplatePersistence;
071
072 import java.io.Serializable;
073
074 import java.util.List;
075
076 import javax.sql.DataSource;
077
078
090 public abstract class JournalStructureLocalServiceBaseImpl
091 implements JournalStructureLocalService, IdentifiableBean {
092
097
098
105 public JournalStructure addJournalStructure(
106 JournalStructure journalStructure) throws SystemException {
107 journalStructure.setNew(true);
108
109 journalStructure = journalStructurePersistence.update(journalStructure,
110 false);
111
112 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
113
114 if (indexer != null) {
115 try {
116 indexer.reindex(journalStructure);
117 }
118 catch (SearchException se) {
119 if (_log.isWarnEnabled()) {
120 _log.warn(se, se);
121 }
122 }
123 }
124
125 return journalStructure;
126 }
127
128
134 public JournalStructure createJournalStructure(long id) {
135 return journalStructurePersistence.create(id);
136 }
137
138
145 public void deleteJournalStructure(long id)
146 throws PortalException, SystemException {
147 JournalStructure journalStructure = journalStructurePersistence.remove(id);
148
149 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
150
151 if (indexer != null) {
152 try {
153 indexer.delete(journalStructure);
154 }
155 catch (SearchException se) {
156 if (_log.isWarnEnabled()) {
157 _log.warn(se, se);
158 }
159 }
160 }
161 }
162
163
169 public void deleteJournalStructure(JournalStructure journalStructure)
170 throws SystemException {
171 journalStructurePersistence.remove(journalStructure);
172
173 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
174
175 if (indexer != null) {
176 try {
177 indexer.delete(journalStructure);
178 }
179 catch (SearchException se) {
180 if (_log.isWarnEnabled()) {
181 _log.warn(se, se);
182 }
183 }
184 }
185 }
186
187
194 @SuppressWarnings("rawtypes")
195 public List dynamicQuery(DynamicQuery dynamicQuery)
196 throws SystemException {
197 return journalStructurePersistence.findWithDynamicQuery(dynamicQuery);
198 }
199
200
213 @SuppressWarnings("rawtypes")
214 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
215 throws SystemException {
216 return journalStructurePersistence.findWithDynamicQuery(dynamicQuery,
217 start, end);
218 }
219
220
234 @SuppressWarnings("rawtypes")
235 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
236 OrderByComparator orderByComparator) throws SystemException {
237 return journalStructurePersistence.findWithDynamicQuery(dynamicQuery,
238 start, end, orderByComparator);
239 }
240
241
248 public long dynamicQueryCount(DynamicQuery dynamicQuery)
249 throws SystemException {
250 return journalStructurePersistence.countWithDynamicQuery(dynamicQuery);
251 }
252
253 public JournalStructure fetchJournalStructure(long id)
254 throws SystemException {
255 return journalStructurePersistence.fetchByPrimaryKey(id);
256 }
257
258
266 public JournalStructure getJournalStructure(long id)
267 throws PortalException, SystemException {
268 return journalStructurePersistence.findByPrimaryKey(id);
269 }
270
271 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
272 throws PortalException, SystemException {
273 return journalStructurePersistence.findByPrimaryKey(primaryKeyObj);
274 }
275
276
285 public JournalStructure getJournalStructureByUuidAndGroupId(String uuid,
286 long groupId) throws PortalException, SystemException {
287 return journalStructurePersistence.findByUUID_G(uuid, groupId);
288 }
289
290
302 public List<JournalStructure> getJournalStructures(int start, int end)
303 throws SystemException {
304 return journalStructurePersistence.findAll(start, end);
305 }
306
307
313 public int getJournalStructuresCount() throws SystemException {
314 return journalStructurePersistence.countAll();
315 }
316
317
324 public JournalStructure updateJournalStructure(
325 JournalStructure journalStructure) throws SystemException {
326 return updateJournalStructure(journalStructure, true);
327 }
328
329
337 public JournalStructure updateJournalStructure(
338 JournalStructure journalStructure, boolean merge)
339 throws SystemException {
340 journalStructure.setNew(false);
341
342 journalStructure = journalStructurePersistence.update(journalStructure,
343 merge);
344
345 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
346
347 if (indexer != null) {
348 try {
349 indexer.reindex(journalStructure);
350 }
351 catch (SearchException se) {
352 if (_log.isWarnEnabled()) {
353 _log.warn(se, se);
354 }
355 }
356 }
357
358 return journalStructure;
359 }
360
361
366 public JournalArticleLocalService getJournalArticleLocalService() {
367 return journalArticleLocalService;
368 }
369
370
375 public void setJournalArticleLocalService(
376 JournalArticleLocalService journalArticleLocalService) {
377 this.journalArticleLocalService = journalArticleLocalService;
378 }
379
380
385 public JournalArticleService getJournalArticleService() {
386 return journalArticleService;
387 }
388
389
394 public void setJournalArticleService(
395 JournalArticleService journalArticleService) {
396 this.journalArticleService = journalArticleService;
397 }
398
399
404 public JournalArticlePersistence getJournalArticlePersistence() {
405 return journalArticlePersistence;
406 }
407
408
413 public void setJournalArticlePersistence(
414 JournalArticlePersistence journalArticlePersistence) {
415 this.journalArticlePersistence = journalArticlePersistence;
416 }
417
418
423 public JournalArticleFinder getJournalArticleFinder() {
424 return journalArticleFinder;
425 }
426
427
432 public void setJournalArticleFinder(
433 JournalArticleFinder journalArticleFinder) {
434 this.journalArticleFinder = journalArticleFinder;
435 }
436
437
442 public JournalArticleImageLocalService getJournalArticleImageLocalService() {
443 return journalArticleImageLocalService;
444 }
445
446
451 public void setJournalArticleImageLocalService(
452 JournalArticleImageLocalService journalArticleImageLocalService) {
453 this.journalArticleImageLocalService = journalArticleImageLocalService;
454 }
455
456
461 public JournalArticleImagePersistence getJournalArticleImagePersistence() {
462 return journalArticleImagePersistence;
463 }
464
465
470 public void setJournalArticleImagePersistence(
471 JournalArticleImagePersistence journalArticleImagePersistence) {
472 this.journalArticleImagePersistence = journalArticleImagePersistence;
473 }
474
475
480 public JournalArticleResourceLocalService getJournalArticleResourceLocalService() {
481 return journalArticleResourceLocalService;
482 }
483
484
489 public void setJournalArticleResourceLocalService(
490 JournalArticleResourceLocalService journalArticleResourceLocalService) {
491 this.journalArticleResourceLocalService = journalArticleResourceLocalService;
492 }
493
494
499 public JournalArticleResourcePersistence getJournalArticleResourcePersistence() {
500 return journalArticleResourcePersistence;
501 }
502
503
508 public void setJournalArticleResourcePersistence(
509 JournalArticleResourcePersistence journalArticleResourcePersistence) {
510 this.journalArticleResourcePersistence = journalArticleResourcePersistence;
511 }
512
513
518 public JournalContentSearchLocalService getJournalContentSearchLocalService() {
519 return journalContentSearchLocalService;
520 }
521
522
527 public void setJournalContentSearchLocalService(
528 JournalContentSearchLocalService journalContentSearchLocalService) {
529 this.journalContentSearchLocalService = journalContentSearchLocalService;
530 }
531
532
537 public JournalContentSearchPersistence getJournalContentSearchPersistence() {
538 return journalContentSearchPersistence;
539 }
540
541
546 public void setJournalContentSearchPersistence(
547 JournalContentSearchPersistence journalContentSearchPersistence) {
548 this.journalContentSearchPersistence = journalContentSearchPersistence;
549 }
550
551
556 public JournalFeedLocalService getJournalFeedLocalService() {
557 return journalFeedLocalService;
558 }
559
560
565 public void setJournalFeedLocalService(
566 JournalFeedLocalService journalFeedLocalService) {
567 this.journalFeedLocalService = journalFeedLocalService;
568 }
569
570
575 public JournalFeedService getJournalFeedService() {
576 return journalFeedService;
577 }
578
579
584 public void setJournalFeedService(JournalFeedService journalFeedService) {
585 this.journalFeedService = journalFeedService;
586 }
587
588
593 public JournalFeedPersistence getJournalFeedPersistence() {
594 return journalFeedPersistence;
595 }
596
597
602 public void setJournalFeedPersistence(
603 JournalFeedPersistence journalFeedPersistence) {
604 this.journalFeedPersistence = journalFeedPersistence;
605 }
606
607
612 public JournalFeedFinder getJournalFeedFinder() {
613 return journalFeedFinder;
614 }
615
616
621 public void setJournalFeedFinder(JournalFeedFinder journalFeedFinder) {
622 this.journalFeedFinder = journalFeedFinder;
623 }
624
625
630 public JournalStructureLocalService getJournalStructureLocalService() {
631 return journalStructureLocalService;
632 }
633
634
639 public void setJournalStructureLocalService(
640 JournalStructureLocalService journalStructureLocalService) {
641 this.journalStructureLocalService = journalStructureLocalService;
642 }
643
644
649 public JournalStructureService getJournalStructureService() {
650 return journalStructureService;
651 }
652
653
658 public void setJournalStructureService(
659 JournalStructureService journalStructureService) {
660 this.journalStructureService = journalStructureService;
661 }
662
663
668 public JournalStructurePersistence getJournalStructurePersistence() {
669 return journalStructurePersistence;
670 }
671
672
677 public void setJournalStructurePersistence(
678 JournalStructurePersistence journalStructurePersistence) {
679 this.journalStructurePersistence = journalStructurePersistence;
680 }
681
682
687 public JournalStructureFinder getJournalStructureFinder() {
688 return journalStructureFinder;
689 }
690
691
696 public void setJournalStructureFinder(
697 JournalStructureFinder journalStructureFinder) {
698 this.journalStructureFinder = journalStructureFinder;
699 }
700
701
706 public JournalTemplateLocalService getJournalTemplateLocalService() {
707 return journalTemplateLocalService;
708 }
709
710
715 public void setJournalTemplateLocalService(
716 JournalTemplateLocalService journalTemplateLocalService) {
717 this.journalTemplateLocalService = journalTemplateLocalService;
718 }
719
720
725 public JournalTemplateService getJournalTemplateService() {
726 return journalTemplateService;
727 }
728
729
734 public void setJournalTemplateService(
735 JournalTemplateService journalTemplateService) {
736 this.journalTemplateService = journalTemplateService;
737 }
738
739
744 public JournalTemplatePersistence getJournalTemplatePersistence() {
745 return journalTemplatePersistence;
746 }
747
748
753 public void setJournalTemplatePersistence(
754 JournalTemplatePersistence journalTemplatePersistence) {
755 this.journalTemplatePersistence = journalTemplatePersistence;
756 }
757
758
763 public JournalTemplateFinder getJournalTemplateFinder() {
764 return journalTemplateFinder;
765 }
766
767
772 public void setJournalTemplateFinder(
773 JournalTemplateFinder journalTemplateFinder) {
774 this.journalTemplateFinder = journalTemplateFinder;
775 }
776
777
782 public CounterLocalService getCounterLocalService() {
783 return counterLocalService;
784 }
785
786
791 public void setCounterLocalService(CounterLocalService counterLocalService) {
792 this.counterLocalService = counterLocalService;
793 }
794
795
800 public ResourceLocalService getResourceLocalService() {
801 return resourceLocalService;
802 }
803
804
809 public void setResourceLocalService(
810 ResourceLocalService resourceLocalService) {
811 this.resourceLocalService = resourceLocalService;
812 }
813
814
819 public ResourceService getResourceService() {
820 return resourceService;
821 }
822
823
828 public void setResourceService(ResourceService resourceService) {
829 this.resourceService = resourceService;
830 }
831
832
837 public ResourcePersistence getResourcePersistence() {
838 return resourcePersistence;
839 }
840
841
846 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
847 this.resourcePersistence = resourcePersistence;
848 }
849
850
855 public ResourceFinder getResourceFinder() {
856 return resourceFinder;
857 }
858
859
864 public void setResourceFinder(ResourceFinder resourceFinder) {
865 this.resourceFinder = resourceFinder;
866 }
867
868
873 public UserLocalService getUserLocalService() {
874 return userLocalService;
875 }
876
877
882 public void setUserLocalService(UserLocalService userLocalService) {
883 this.userLocalService = userLocalService;
884 }
885
886
891 public UserService getUserService() {
892 return userService;
893 }
894
895
900 public void setUserService(UserService userService) {
901 this.userService = userService;
902 }
903
904
909 public UserPersistence getUserPersistence() {
910 return userPersistence;
911 }
912
913
918 public void setUserPersistence(UserPersistence userPersistence) {
919 this.userPersistence = userPersistence;
920 }
921
922
927 public UserFinder getUserFinder() {
928 return userFinder;
929 }
930
931
936 public void setUserFinder(UserFinder userFinder) {
937 this.userFinder = userFinder;
938 }
939
940
945 public WebDAVPropsLocalService getWebDAVPropsLocalService() {
946 return webDAVPropsLocalService;
947 }
948
949
954 public void setWebDAVPropsLocalService(
955 WebDAVPropsLocalService webDAVPropsLocalService) {
956 this.webDAVPropsLocalService = webDAVPropsLocalService;
957 }
958
959
964 public WebDAVPropsPersistence getWebDAVPropsPersistence() {
965 return webDAVPropsPersistence;
966 }
967
968
973 public void setWebDAVPropsPersistence(
974 WebDAVPropsPersistence webDAVPropsPersistence) {
975 this.webDAVPropsPersistence = webDAVPropsPersistence;
976 }
977
978
983 public ExpandoValueLocalService getExpandoValueLocalService() {
984 return expandoValueLocalService;
985 }
986
987
992 public void setExpandoValueLocalService(
993 ExpandoValueLocalService expandoValueLocalService) {
994 this.expandoValueLocalService = expandoValueLocalService;
995 }
996
997
1002 public ExpandoValueService getExpandoValueService() {
1003 return expandoValueService;
1004 }
1005
1006
1011 public void setExpandoValueService(ExpandoValueService expandoValueService) {
1012 this.expandoValueService = expandoValueService;
1013 }
1014
1015
1020 public ExpandoValuePersistence getExpandoValuePersistence() {
1021 return expandoValuePersistence;
1022 }
1023
1024
1029 public void setExpandoValuePersistence(
1030 ExpandoValuePersistence expandoValuePersistence) {
1031 this.expandoValuePersistence = expandoValuePersistence;
1032 }
1033
1034 public void afterPropertiesSet() {
1035 persistedModelLocalServiceRegistry.register("com.liferay.portlet.journal.model.JournalStructure",
1036 journalStructureLocalService);
1037 }
1038
1039 public void destroy() {
1040 persistedModelLocalServiceRegistry.unregister(
1041 "com.liferay.portlet.journal.model.JournalStructure");
1042 }
1043
1044
1049 public String getBeanIdentifier() {
1050 return _beanIdentifier;
1051 }
1052
1053
1058 public void setBeanIdentifier(String beanIdentifier) {
1059 _beanIdentifier = beanIdentifier;
1060 }
1061
1062 protected Class<?> getModelClass() {
1063 return JournalStructure.class;
1064 }
1065
1066 protected String getModelClassName() {
1067 return JournalStructure.class.getName();
1068 }
1069
1070
1075 protected void runSQL(String sql) throws SystemException {
1076 try {
1077 DataSource dataSource = journalStructurePersistence.getDataSource();
1078
1079 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1080 sql, new int[0]);
1081
1082 sqlUpdate.update();
1083 }
1084 catch (Exception e) {
1085 throw new SystemException(e);
1086 }
1087 }
1088
1089 @BeanReference(type = JournalArticleLocalService.class)
1090 protected JournalArticleLocalService journalArticleLocalService;
1091 @BeanReference(type = JournalArticleService.class)
1092 protected JournalArticleService journalArticleService;
1093 @BeanReference(type = JournalArticlePersistence.class)
1094 protected JournalArticlePersistence journalArticlePersistence;
1095 @BeanReference(type = JournalArticleFinder.class)
1096 protected JournalArticleFinder journalArticleFinder;
1097 @BeanReference(type = JournalArticleImageLocalService.class)
1098 protected JournalArticleImageLocalService journalArticleImageLocalService;
1099 @BeanReference(type = JournalArticleImagePersistence.class)
1100 protected JournalArticleImagePersistence journalArticleImagePersistence;
1101 @BeanReference(type = JournalArticleResourceLocalService.class)
1102 protected JournalArticleResourceLocalService journalArticleResourceLocalService;
1103 @BeanReference(type = JournalArticleResourcePersistence.class)
1104 protected JournalArticleResourcePersistence journalArticleResourcePersistence;
1105 @BeanReference(type = JournalContentSearchLocalService.class)
1106 protected JournalContentSearchLocalService journalContentSearchLocalService;
1107 @BeanReference(type = JournalContentSearchPersistence.class)
1108 protected JournalContentSearchPersistence journalContentSearchPersistence;
1109 @BeanReference(type = JournalFeedLocalService.class)
1110 protected JournalFeedLocalService journalFeedLocalService;
1111 @BeanReference(type = JournalFeedService.class)
1112 protected JournalFeedService journalFeedService;
1113 @BeanReference(type = JournalFeedPersistence.class)
1114 protected JournalFeedPersistence journalFeedPersistence;
1115 @BeanReference(type = JournalFeedFinder.class)
1116 protected JournalFeedFinder journalFeedFinder;
1117 @BeanReference(type = JournalStructureLocalService.class)
1118 protected JournalStructureLocalService journalStructureLocalService;
1119 @BeanReference(type = JournalStructureService.class)
1120 protected JournalStructureService journalStructureService;
1121 @BeanReference(type = JournalStructurePersistence.class)
1122 protected JournalStructurePersistence journalStructurePersistence;
1123 @BeanReference(type = JournalStructureFinder.class)
1124 protected JournalStructureFinder journalStructureFinder;
1125 @BeanReference(type = JournalTemplateLocalService.class)
1126 protected JournalTemplateLocalService journalTemplateLocalService;
1127 @BeanReference(type = JournalTemplateService.class)
1128 protected JournalTemplateService journalTemplateService;
1129 @BeanReference(type = JournalTemplatePersistence.class)
1130 protected JournalTemplatePersistence journalTemplatePersistence;
1131 @BeanReference(type = JournalTemplateFinder.class)
1132 protected JournalTemplateFinder journalTemplateFinder;
1133 @BeanReference(type = CounterLocalService.class)
1134 protected CounterLocalService counterLocalService;
1135 @BeanReference(type = ResourceLocalService.class)
1136 protected ResourceLocalService resourceLocalService;
1137 @BeanReference(type = ResourceService.class)
1138 protected ResourceService resourceService;
1139 @BeanReference(type = ResourcePersistence.class)
1140 protected ResourcePersistence resourcePersistence;
1141 @BeanReference(type = ResourceFinder.class)
1142 protected ResourceFinder resourceFinder;
1143 @BeanReference(type = UserLocalService.class)
1144 protected UserLocalService userLocalService;
1145 @BeanReference(type = UserService.class)
1146 protected UserService userService;
1147 @BeanReference(type = UserPersistence.class)
1148 protected UserPersistence userPersistence;
1149 @BeanReference(type = UserFinder.class)
1150 protected UserFinder userFinder;
1151 @BeanReference(type = WebDAVPropsLocalService.class)
1152 protected WebDAVPropsLocalService webDAVPropsLocalService;
1153 @BeanReference(type = WebDAVPropsPersistence.class)
1154 protected WebDAVPropsPersistence webDAVPropsPersistence;
1155 @BeanReference(type = ExpandoValueLocalService.class)
1156 protected ExpandoValueLocalService expandoValueLocalService;
1157 @BeanReference(type = ExpandoValueService.class)
1158 protected ExpandoValueService expandoValueService;
1159 @BeanReference(type = ExpandoValuePersistence.class)
1160 protected ExpandoValuePersistence expandoValuePersistence;
1161 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1162 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1163 private static Log _log = LogFactoryUtil.getLog(JournalStructureLocalServiceBaseImpl.class);
1164 private String _beanIdentifier;
1165 }