001
014
015 package com.liferay.portlet.dynamicdatamapping.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.dao.orm.DynamicQueryFactoryUtil;
025 import com.liferay.portal.kernel.exception.PortalException;
026 import com.liferay.portal.kernel.exception.SystemException;
027 import com.liferay.portal.kernel.search.Indexable;
028 import com.liferay.portal.kernel.search.IndexableType;
029 import com.liferay.portal.kernel.util.OrderByComparator;
030 import com.liferay.portal.model.PersistedModel;
031 import com.liferay.portal.service.BaseLocalServiceImpl;
032 import com.liferay.portal.service.GroupLocalService;
033 import com.liferay.portal.service.GroupService;
034 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
035 import com.liferay.portal.service.ResourceLocalService;
036 import com.liferay.portal.service.UserLocalService;
037 import com.liferay.portal.service.UserService;
038 import com.liferay.portal.service.persistence.GroupFinder;
039 import com.liferay.portal.service.persistence.GroupPersistence;
040 import com.liferay.portal.service.persistence.UserFinder;
041 import com.liferay.portal.service.persistence.UserPersistence;
042
043 import com.liferay.portlet.documentlibrary.service.DLFileEntryTypeLocalService;
044 import com.liferay.portlet.documentlibrary.service.DLFileEntryTypeService;
045 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypeFinder;
046 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypePersistence;
047 import com.liferay.portlet.dynamicdatamapping.model.DDMStructure;
048 import com.liferay.portlet.dynamicdatamapping.service.DDMContentLocalService;
049 import com.liferay.portlet.dynamicdatamapping.service.DDMStorageLinkLocalService;
050 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService;
051 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
052 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
053 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalService;
054 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateService;
055 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMContentPersistence;
056 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStorageLinkPersistence;
057 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
058 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureLinkPersistence;
059 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
060 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplateFinder;
061 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplatePersistence;
062
063 import java.io.Serializable;
064
065 import java.util.List;
066
067 import javax.sql.DataSource;
068
069
081 public abstract class DDMStructureLocalServiceBaseImpl
082 extends BaseLocalServiceImpl implements DDMStructureLocalService,
083 IdentifiableBean {
084
089
090
097 @Indexable(type = IndexableType.REINDEX)
098 public DDMStructure addDDMStructure(DDMStructure ddmStructure)
099 throws SystemException {
100 ddmStructure.setNew(true);
101
102 return ddmStructurePersistence.update(ddmStructure);
103 }
104
105
111 public DDMStructure createDDMStructure(long structureId) {
112 return ddmStructurePersistence.create(structureId);
113 }
114
115
123 @Indexable(type = IndexableType.DELETE)
124 public DDMStructure deleteDDMStructure(long structureId)
125 throws PortalException, SystemException {
126 return ddmStructurePersistence.remove(structureId);
127 }
128
129
136 @Indexable(type = IndexableType.DELETE)
137 public DDMStructure deleteDDMStructure(DDMStructure ddmStructure)
138 throws SystemException {
139 return ddmStructurePersistence.remove(ddmStructure);
140 }
141
142 public DynamicQuery dynamicQuery() {
143 Class<?> clazz = getClass();
144
145 return DynamicQueryFactoryUtil.forClass(DDMStructure.class,
146 clazz.getClassLoader());
147 }
148
149
156 @SuppressWarnings("rawtypes")
157 public List dynamicQuery(DynamicQuery dynamicQuery)
158 throws SystemException {
159 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery);
160 }
161
162
175 @SuppressWarnings("rawtypes")
176 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
177 throws SystemException {
178 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery,
179 start, end);
180 }
181
182
196 @SuppressWarnings("rawtypes")
197 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
198 OrderByComparator orderByComparator) throws SystemException {
199 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery,
200 start, end, orderByComparator);
201 }
202
203
210 public long dynamicQueryCount(DynamicQuery dynamicQuery)
211 throws SystemException {
212 return ddmStructurePersistence.countWithDynamicQuery(dynamicQuery);
213 }
214
215 public DDMStructure fetchDDMStructure(long structureId)
216 throws SystemException {
217 return ddmStructurePersistence.fetchByPrimaryKey(structureId);
218 }
219
220
228 public DDMStructure getDDMStructure(long structureId)
229 throws PortalException, SystemException {
230 return ddmStructurePersistence.findByPrimaryKey(structureId);
231 }
232
233 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
234 throws PortalException, SystemException {
235 return ddmStructurePersistence.findByPrimaryKey(primaryKeyObj);
236 }
237
238
247 public DDMStructure getDDMStructureByUuidAndGroupId(String uuid,
248 long groupId) throws PortalException, SystemException {
249 return ddmStructurePersistence.findByUUID_G(uuid, groupId);
250 }
251
252
264 public List<DDMStructure> getDDMStructures(int start, int end)
265 throws SystemException {
266 return ddmStructurePersistence.findAll(start, end);
267 }
268
269
275 public int getDDMStructuresCount() throws SystemException {
276 return ddmStructurePersistence.countAll();
277 }
278
279
286 @Indexable(type = IndexableType.REINDEX)
287 public DDMStructure updateDDMStructure(DDMStructure ddmStructure)
288 throws SystemException {
289 return ddmStructurePersistence.update(ddmStructure);
290 }
291
292
295 public void addDLFileEntryTypeDDMStructure(long fileEntryTypeId,
296 long structureId) throws SystemException {
297 dlFileEntryTypePersistence.addDDMStructure(fileEntryTypeId, structureId);
298 }
299
300
303 public void addDLFileEntryTypeDDMStructure(long fileEntryTypeId,
304 DDMStructure ddmStructure) throws SystemException {
305 dlFileEntryTypePersistence.addDDMStructure(fileEntryTypeId, ddmStructure);
306 }
307
308
311 public void addDLFileEntryTypeDDMStructures(long fileEntryTypeId,
312 long[] structureIds) throws SystemException {
313 dlFileEntryTypePersistence.addDDMStructures(fileEntryTypeId,
314 structureIds);
315 }
316
317
320 public void addDLFileEntryTypeDDMStructures(long fileEntryTypeId,
321 List<DDMStructure> DDMStructures) throws SystemException {
322 dlFileEntryTypePersistence.addDDMStructures(fileEntryTypeId,
323 DDMStructures);
324 }
325
326
329 public void clearDLFileEntryTypeDDMStructures(long fileEntryTypeId)
330 throws SystemException {
331 dlFileEntryTypePersistence.clearDDMStructures(fileEntryTypeId);
332 }
333
334
337 public void deleteDLFileEntryTypeDDMStructure(long fileEntryTypeId,
338 long structureId) throws SystemException {
339 dlFileEntryTypePersistence.removeDDMStructure(fileEntryTypeId,
340 structureId);
341 }
342
343
346 public void deleteDLFileEntryTypeDDMStructure(long fileEntryTypeId,
347 DDMStructure ddmStructure) throws SystemException {
348 dlFileEntryTypePersistence.removeDDMStructure(fileEntryTypeId,
349 ddmStructure);
350 }
351
352
355 public void deleteDLFileEntryTypeDDMStructures(long fileEntryTypeId,
356 long[] structureIds) throws SystemException {
357 dlFileEntryTypePersistence.removeDDMStructures(fileEntryTypeId,
358 structureIds);
359 }
360
361
364 public void deleteDLFileEntryTypeDDMStructures(long fileEntryTypeId,
365 List<DDMStructure> DDMStructures) throws SystemException {
366 dlFileEntryTypePersistence.removeDDMStructures(fileEntryTypeId,
367 DDMStructures);
368 }
369
370
373 public List<DDMStructure> getDLFileEntryTypeDDMStructures(
374 long fileEntryTypeId) throws SystemException {
375 return dlFileEntryTypePersistence.getDDMStructures(fileEntryTypeId);
376 }
377
378
381 public List<DDMStructure> getDLFileEntryTypeDDMStructures(
382 long fileEntryTypeId, int start, int end) throws SystemException {
383 return dlFileEntryTypePersistence.getDDMStructures(fileEntryTypeId,
384 start, end);
385 }
386
387
390 public List<DDMStructure> getDLFileEntryTypeDDMStructures(
391 long fileEntryTypeId, int start, int end,
392 OrderByComparator orderByComparator) throws SystemException {
393 return dlFileEntryTypePersistence.getDDMStructures(fileEntryTypeId,
394 start, end, orderByComparator);
395 }
396
397
400 public int getDLFileEntryTypeDDMStructuresCount(long fileEntryTypeId)
401 throws SystemException {
402 return dlFileEntryTypePersistence.getDDMStructuresSize(fileEntryTypeId);
403 }
404
405
408 public boolean hasDLFileEntryTypeDDMStructure(long fileEntryTypeId,
409 long structureId) throws SystemException {
410 return dlFileEntryTypePersistence.containsDDMStructure(fileEntryTypeId,
411 structureId);
412 }
413
414
417 public boolean hasDLFileEntryTypeDDMStructures(long fileEntryTypeId)
418 throws SystemException {
419 return dlFileEntryTypePersistence.containsDDMStructures(fileEntryTypeId);
420 }
421
422
425 public void setDLFileEntryTypeDDMStructures(long fileEntryTypeId,
426 long[] structureIds) throws SystemException {
427 dlFileEntryTypePersistence.setDDMStructures(fileEntryTypeId,
428 structureIds);
429 }
430
431
436 public DDMContentLocalService getDDMContentLocalService() {
437 return ddmContentLocalService;
438 }
439
440
445 public void setDDMContentLocalService(
446 DDMContentLocalService ddmContentLocalService) {
447 this.ddmContentLocalService = ddmContentLocalService;
448 }
449
450
455 public DDMContentPersistence getDDMContentPersistence() {
456 return ddmContentPersistence;
457 }
458
459
464 public void setDDMContentPersistence(
465 DDMContentPersistence ddmContentPersistence) {
466 this.ddmContentPersistence = ddmContentPersistence;
467 }
468
469
474 public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
475 return ddmStorageLinkLocalService;
476 }
477
478
483 public void setDDMStorageLinkLocalService(
484 DDMStorageLinkLocalService ddmStorageLinkLocalService) {
485 this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
486 }
487
488
493 public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
494 return ddmStorageLinkPersistence;
495 }
496
497
502 public void setDDMStorageLinkPersistence(
503 DDMStorageLinkPersistence ddmStorageLinkPersistence) {
504 this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
505 }
506
507
512 public DDMStructureLocalService getDDMStructureLocalService() {
513 return ddmStructureLocalService;
514 }
515
516
521 public void setDDMStructureLocalService(
522 DDMStructureLocalService ddmStructureLocalService) {
523 this.ddmStructureLocalService = ddmStructureLocalService;
524 }
525
526
531 public DDMStructureService getDDMStructureService() {
532 return ddmStructureService;
533 }
534
535
540 public void setDDMStructureService(DDMStructureService ddmStructureService) {
541 this.ddmStructureService = ddmStructureService;
542 }
543
544
549 public DDMStructurePersistence getDDMStructurePersistence() {
550 return ddmStructurePersistence;
551 }
552
553
558 public void setDDMStructurePersistence(
559 DDMStructurePersistence ddmStructurePersistence) {
560 this.ddmStructurePersistence = ddmStructurePersistence;
561 }
562
563
568 public DDMStructureFinder getDDMStructureFinder() {
569 return ddmStructureFinder;
570 }
571
572
577 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
578 this.ddmStructureFinder = ddmStructureFinder;
579 }
580
581
586 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
587 return ddmStructureLinkLocalService;
588 }
589
590
595 public void setDDMStructureLinkLocalService(
596 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
597 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
598 }
599
600
605 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
606 return ddmStructureLinkPersistence;
607 }
608
609
614 public void setDDMStructureLinkPersistence(
615 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
616 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
617 }
618
619
624 public DDMTemplateLocalService getDDMTemplateLocalService() {
625 return ddmTemplateLocalService;
626 }
627
628
633 public void setDDMTemplateLocalService(
634 DDMTemplateLocalService ddmTemplateLocalService) {
635 this.ddmTemplateLocalService = ddmTemplateLocalService;
636 }
637
638
643 public DDMTemplateService getDDMTemplateService() {
644 return ddmTemplateService;
645 }
646
647
652 public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
653 this.ddmTemplateService = ddmTemplateService;
654 }
655
656
661 public DDMTemplatePersistence getDDMTemplatePersistence() {
662 return ddmTemplatePersistence;
663 }
664
665
670 public void setDDMTemplatePersistence(
671 DDMTemplatePersistence ddmTemplatePersistence) {
672 this.ddmTemplatePersistence = ddmTemplatePersistence;
673 }
674
675
680 public DDMTemplateFinder getDDMTemplateFinder() {
681 return ddmTemplateFinder;
682 }
683
684
689 public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
690 this.ddmTemplateFinder = ddmTemplateFinder;
691 }
692
693
698 public CounterLocalService getCounterLocalService() {
699 return counterLocalService;
700 }
701
702
707 public void setCounterLocalService(CounterLocalService counterLocalService) {
708 this.counterLocalService = counterLocalService;
709 }
710
711
716 public GroupLocalService getGroupLocalService() {
717 return groupLocalService;
718 }
719
720
725 public void setGroupLocalService(GroupLocalService groupLocalService) {
726 this.groupLocalService = groupLocalService;
727 }
728
729
734 public GroupService getGroupService() {
735 return groupService;
736 }
737
738
743 public void setGroupService(GroupService groupService) {
744 this.groupService = groupService;
745 }
746
747
752 public GroupPersistence getGroupPersistence() {
753 return groupPersistence;
754 }
755
756
761 public void setGroupPersistence(GroupPersistence groupPersistence) {
762 this.groupPersistence = groupPersistence;
763 }
764
765
770 public GroupFinder getGroupFinder() {
771 return groupFinder;
772 }
773
774
779 public void setGroupFinder(GroupFinder groupFinder) {
780 this.groupFinder = groupFinder;
781 }
782
783
788 public ResourceLocalService getResourceLocalService() {
789 return resourceLocalService;
790 }
791
792
797 public void setResourceLocalService(
798 ResourceLocalService resourceLocalService) {
799 this.resourceLocalService = resourceLocalService;
800 }
801
802
807 public UserLocalService getUserLocalService() {
808 return userLocalService;
809 }
810
811
816 public void setUserLocalService(UserLocalService userLocalService) {
817 this.userLocalService = userLocalService;
818 }
819
820
825 public UserService getUserService() {
826 return userService;
827 }
828
829
834 public void setUserService(UserService userService) {
835 this.userService = userService;
836 }
837
838
843 public UserPersistence getUserPersistence() {
844 return userPersistence;
845 }
846
847
852 public void setUserPersistence(UserPersistence userPersistence) {
853 this.userPersistence = userPersistence;
854 }
855
856
861 public UserFinder getUserFinder() {
862 return userFinder;
863 }
864
865
870 public void setUserFinder(UserFinder userFinder) {
871 this.userFinder = userFinder;
872 }
873
874
879 public DLFileEntryTypeLocalService getDLFileEntryTypeLocalService() {
880 return dlFileEntryTypeLocalService;
881 }
882
883
888 public void setDLFileEntryTypeLocalService(
889 DLFileEntryTypeLocalService dlFileEntryTypeLocalService) {
890 this.dlFileEntryTypeLocalService = dlFileEntryTypeLocalService;
891 }
892
893
898 public DLFileEntryTypeService getDLFileEntryTypeService() {
899 return dlFileEntryTypeService;
900 }
901
902
907 public void setDLFileEntryTypeService(
908 DLFileEntryTypeService dlFileEntryTypeService) {
909 this.dlFileEntryTypeService = dlFileEntryTypeService;
910 }
911
912
917 public DLFileEntryTypePersistence getDLFileEntryTypePersistence() {
918 return dlFileEntryTypePersistence;
919 }
920
921
926 public void setDLFileEntryTypePersistence(
927 DLFileEntryTypePersistence dlFileEntryTypePersistence) {
928 this.dlFileEntryTypePersistence = dlFileEntryTypePersistence;
929 }
930
931
936 public DLFileEntryTypeFinder getDLFileEntryTypeFinder() {
937 return dlFileEntryTypeFinder;
938 }
939
940
945 public void setDLFileEntryTypeFinder(
946 DLFileEntryTypeFinder dlFileEntryTypeFinder) {
947 this.dlFileEntryTypeFinder = dlFileEntryTypeFinder;
948 }
949
950 public void afterPropertiesSet() {
951 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMStructure",
952 ddmStructureLocalService);
953 }
954
955 public void destroy() {
956 persistedModelLocalServiceRegistry.unregister(
957 "com.liferay.portlet.dynamicdatamapping.model.DDMStructure");
958 }
959
960
965 public String getBeanIdentifier() {
966 return _beanIdentifier;
967 }
968
969
974 public void setBeanIdentifier(String beanIdentifier) {
975 _beanIdentifier = beanIdentifier;
976 }
977
978 protected Class<?> getModelClass() {
979 return DDMStructure.class;
980 }
981
982 protected String getModelClassName() {
983 return DDMStructure.class.getName();
984 }
985
986
991 protected void runSQL(String sql) throws SystemException {
992 try {
993 DataSource dataSource = ddmStructurePersistence.getDataSource();
994
995 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
996 sql, new int[0]);
997
998 sqlUpdate.update();
999 }
1000 catch (Exception e) {
1001 throw new SystemException(e);
1002 }
1003 }
1004
1005 @BeanReference(type = DDMContentLocalService.class)
1006 protected DDMContentLocalService ddmContentLocalService;
1007 @BeanReference(type = DDMContentPersistence.class)
1008 protected DDMContentPersistence ddmContentPersistence;
1009 @BeanReference(type = DDMStorageLinkLocalService.class)
1010 protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
1011 @BeanReference(type = DDMStorageLinkPersistence.class)
1012 protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
1013 @BeanReference(type = DDMStructureLocalService.class)
1014 protected DDMStructureLocalService ddmStructureLocalService;
1015 @BeanReference(type = DDMStructureService.class)
1016 protected DDMStructureService ddmStructureService;
1017 @BeanReference(type = DDMStructurePersistence.class)
1018 protected DDMStructurePersistence ddmStructurePersistence;
1019 @BeanReference(type = DDMStructureFinder.class)
1020 protected DDMStructureFinder ddmStructureFinder;
1021 @BeanReference(type = DDMStructureLinkLocalService.class)
1022 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
1023 @BeanReference(type = DDMStructureLinkPersistence.class)
1024 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
1025 @BeanReference(type = DDMTemplateLocalService.class)
1026 protected DDMTemplateLocalService ddmTemplateLocalService;
1027 @BeanReference(type = DDMTemplateService.class)
1028 protected DDMTemplateService ddmTemplateService;
1029 @BeanReference(type = DDMTemplatePersistence.class)
1030 protected DDMTemplatePersistence ddmTemplatePersistence;
1031 @BeanReference(type = DDMTemplateFinder.class)
1032 protected DDMTemplateFinder ddmTemplateFinder;
1033 @BeanReference(type = CounterLocalService.class)
1034 protected CounterLocalService counterLocalService;
1035 @BeanReference(type = GroupLocalService.class)
1036 protected GroupLocalService groupLocalService;
1037 @BeanReference(type = GroupService.class)
1038 protected GroupService groupService;
1039 @BeanReference(type = GroupPersistence.class)
1040 protected GroupPersistence groupPersistence;
1041 @BeanReference(type = GroupFinder.class)
1042 protected GroupFinder groupFinder;
1043 @BeanReference(type = ResourceLocalService.class)
1044 protected ResourceLocalService resourceLocalService;
1045 @BeanReference(type = UserLocalService.class)
1046 protected UserLocalService userLocalService;
1047 @BeanReference(type = UserService.class)
1048 protected UserService userService;
1049 @BeanReference(type = UserPersistence.class)
1050 protected UserPersistence userPersistence;
1051 @BeanReference(type = UserFinder.class)
1052 protected UserFinder userFinder;
1053 @BeanReference(type = DLFileEntryTypeLocalService.class)
1054 protected DLFileEntryTypeLocalService dlFileEntryTypeLocalService;
1055 @BeanReference(type = DLFileEntryTypeService.class)
1056 protected DLFileEntryTypeService dlFileEntryTypeService;
1057 @BeanReference(type = DLFileEntryTypePersistence.class)
1058 protected DLFileEntryTypePersistence dlFileEntryTypePersistence;
1059 @BeanReference(type = DLFileEntryTypeFinder.class)
1060 protected DLFileEntryTypeFinder dlFileEntryTypeFinder;
1061 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1062 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1063 private String _beanIdentifier;
1064 }