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.PersistedModelLocalServiceRegistry;
033 import com.liferay.portal.service.ResourceLocalService;
034 import com.liferay.portal.service.ResourceService;
035 import com.liferay.portal.service.UserLocalService;
036 import com.liferay.portal.service.UserService;
037 import com.liferay.portal.service.persistence.ResourceFinder;
038 import com.liferay.portal.service.persistence.ResourcePersistence;
039 import com.liferay.portal.service.persistence.UserFinder;
040 import com.liferay.portal.service.persistence.UserPersistence;
041
042 import com.liferay.portlet.documentlibrary.service.DLFileEntryTypeLocalService;
043 import com.liferay.portlet.documentlibrary.service.DLFileEntryTypeService;
044 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypeFinder;
045 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryTypePersistence;
046 import com.liferay.portlet.dynamicdatamapping.model.DDMStructure;
047 import com.liferay.portlet.dynamicdatamapping.service.DDMContentLocalService;
048 import com.liferay.portlet.dynamicdatamapping.service.DDMStorageLinkLocalService;
049 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService;
050 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
051 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
052 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalService;
053 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateService;
054 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMContentPersistence;
055 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStorageLinkPersistence;
056 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
057 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureLinkPersistence;
058 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
059 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplateFinder;
060 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplatePersistence;
061
062 import java.io.Serializable;
063
064 import java.util.List;
065
066 import javax.sql.DataSource;
067
068
080 public abstract class DDMStructureLocalServiceBaseImpl
081 extends BaseLocalServiceImpl implements DDMStructureLocalService,
082 IdentifiableBean {
083
088
089
096 @Indexable(type = IndexableType.REINDEX)
097 public DDMStructure addDDMStructure(DDMStructure ddmStructure)
098 throws SystemException {
099 ddmStructure.setNew(true);
100
101 return ddmStructurePersistence.update(ddmStructure, false);
102 }
103
104
110 public DDMStructure createDDMStructure(long structureId) {
111 return ddmStructurePersistence.create(structureId);
112 }
113
114
122 @Indexable(type = IndexableType.DELETE)
123 public DDMStructure deleteDDMStructure(long structureId)
124 throws PortalException, SystemException {
125 return ddmStructurePersistence.remove(structureId);
126 }
127
128
135 @Indexable(type = IndexableType.DELETE)
136 public DDMStructure deleteDDMStructure(DDMStructure ddmStructure)
137 throws SystemException {
138 return ddmStructurePersistence.remove(ddmStructure);
139 }
140
141 public DynamicQuery dynamicQuery() {
142 Class<?> clazz = getClass();
143
144 return DynamicQueryFactoryUtil.forClass(DDMStructure.class,
145 clazz.getClassLoader());
146 }
147
148
155 @SuppressWarnings("rawtypes")
156 public List dynamicQuery(DynamicQuery dynamicQuery)
157 throws SystemException {
158 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery);
159 }
160
161
174 @SuppressWarnings("rawtypes")
175 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
176 throws SystemException {
177 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery,
178 start, end);
179 }
180
181
195 @SuppressWarnings("rawtypes")
196 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
197 OrderByComparator orderByComparator) throws SystemException {
198 return ddmStructurePersistence.findWithDynamicQuery(dynamicQuery,
199 start, end, orderByComparator);
200 }
201
202
209 public long dynamicQueryCount(DynamicQuery dynamicQuery)
210 throws SystemException {
211 return ddmStructurePersistence.countWithDynamicQuery(dynamicQuery);
212 }
213
214 public DDMStructure fetchDDMStructure(long structureId)
215 throws SystemException {
216 return ddmStructurePersistence.fetchByPrimaryKey(structureId);
217 }
218
219
227 public DDMStructure getDDMStructure(long structureId)
228 throws PortalException, SystemException {
229 return ddmStructurePersistence.findByPrimaryKey(structureId);
230 }
231
232 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
233 throws PortalException, SystemException {
234 return ddmStructurePersistence.findByPrimaryKey(primaryKeyObj);
235 }
236
237
246 public DDMStructure getDDMStructureByUuidAndGroupId(String uuid,
247 long groupId) throws PortalException, SystemException {
248 return ddmStructurePersistence.findByUUID_G(uuid, groupId);
249 }
250
251
263 public List<DDMStructure> getDDMStructures(int start, int end)
264 throws SystemException {
265 return ddmStructurePersistence.findAll(start, end);
266 }
267
268
274 public int getDDMStructuresCount() throws SystemException {
275 return ddmStructurePersistence.countAll();
276 }
277
278
285 @Indexable(type = IndexableType.REINDEX)
286 public DDMStructure updateDDMStructure(DDMStructure ddmStructure)
287 throws SystemException {
288 return updateDDMStructure(ddmStructure, true);
289 }
290
291
299 @Indexable(type = IndexableType.REINDEX)
300 public DDMStructure updateDDMStructure(DDMStructure ddmStructure,
301 boolean merge) throws SystemException {
302 ddmStructure.setNew(false);
303
304 return ddmStructurePersistence.update(ddmStructure, merge);
305 }
306
307
310 public void addDLFileEntryTypeDDMStructure(long fileEntryTypeId,
311 long structureId) throws SystemException {
312 dlFileEntryTypePersistence.addDDMStructure(fileEntryTypeId, structureId);
313 }
314
315
318 public void addDLFileEntryTypeDDMStructure(long fileEntryTypeId,
319 DDMStructure ddmStructure) throws SystemException {
320 dlFileEntryTypePersistence.addDDMStructure(fileEntryTypeId, ddmStructure);
321 }
322
323
326 public void addDLFileEntryTypeDDMStructures(long fileEntryTypeId,
327 long[] structureIds) throws SystemException {
328 dlFileEntryTypePersistence.addDDMStructures(fileEntryTypeId,
329 structureIds);
330 }
331
332
335 public void addDLFileEntryTypeDDMStructures(long fileEntryTypeId,
336 List<DDMStructure> DDMStructures) throws SystemException {
337 dlFileEntryTypePersistence.addDDMStructures(fileEntryTypeId,
338 DDMStructures);
339 }
340
341
344 public void clearDLFileEntryTypeDDMStructures(long fileEntryTypeId)
345 throws SystemException {
346 dlFileEntryTypePersistence.clearDDMStructures(fileEntryTypeId);
347 }
348
349
352 public void deleteDLFileEntryTypeDDMStructure(long fileEntryTypeId,
353 long structureId) throws SystemException {
354 dlFileEntryTypePersistence.removeDDMStructure(fileEntryTypeId,
355 structureId);
356 }
357
358
361 public void deleteDLFileEntryTypeDDMStructure(long fileEntryTypeId,
362 DDMStructure ddmStructure) throws SystemException {
363 dlFileEntryTypePersistence.removeDDMStructure(fileEntryTypeId,
364 ddmStructure);
365 }
366
367
370 public void deleteDLFileEntryTypeDDMStructures(long fileEntryTypeId,
371 long[] structureIds) throws SystemException {
372 dlFileEntryTypePersistence.removeDDMStructures(fileEntryTypeId,
373 structureIds);
374 }
375
376
379 public void deleteDLFileEntryTypeDDMStructures(long fileEntryTypeId,
380 List<DDMStructure> DDMStructures) throws SystemException {
381 dlFileEntryTypePersistence.removeDDMStructures(fileEntryTypeId,
382 DDMStructures);
383 }
384
385
388 public List<DDMStructure> getDLFileEntryTypeDDMStructures(
389 long fileEntryTypeId) throws SystemException {
390 return dlFileEntryTypePersistence.getDDMStructures(fileEntryTypeId);
391 }
392
393
396 public List<DDMStructure> getDLFileEntryTypeDDMStructures(
397 long fileEntryTypeId, int start, int end) throws SystemException {
398 return dlFileEntryTypePersistence.getDDMStructures(fileEntryTypeId,
399 start, end);
400 }
401
402
405 public List<DDMStructure> getDLFileEntryTypeDDMStructures(
406 long fileEntryTypeId, int start, int end,
407 OrderByComparator orderByComparator) throws SystemException {
408 return dlFileEntryTypePersistence.getDDMStructures(fileEntryTypeId,
409 start, end, orderByComparator);
410 }
411
412
415 public int getDLFileEntryTypeDDMStructuresCount(long fileEntryTypeId)
416 throws SystemException {
417 return dlFileEntryTypePersistence.getDDMStructuresSize(fileEntryTypeId);
418 }
419
420
423 public boolean hasDLFileEntryTypeDDMStructure(long fileEntryTypeId,
424 long structureId) throws SystemException {
425 return dlFileEntryTypePersistence.containsDDMStructure(fileEntryTypeId,
426 structureId);
427 }
428
429
432 public boolean hasDLFileEntryTypeDDMStructures(long fileEntryTypeId)
433 throws SystemException {
434 return dlFileEntryTypePersistence.containsDDMStructures(fileEntryTypeId);
435 }
436
437
440 public void setDLFileEntryTypeDDMStructures(long fileEntryTypeId,
441 long[] structureIds) throws SystemException {
442 dlFileEntryTypePersistence.setDDMStructures(fileEntryTypeId,
443 structureIds);
444 }
445
446
451 public DDMContentLocalService getDDMContentLocalService() {
452 return ddmContentLocalService;
453 }
454
455
460 public void setDDMContentLocalService(
461 DDMContentLocalService ddmContentLocalService) {
462 this.ddmContentLocalService = ddmContentLocalService;
463 }
464
465
470 public DDMContentPersistence getDDMContentPersistence() {
471 return ddmContentPersistence;
472 }
473
474
479 public void setDDMContentPersistence(
480 DDMContentPersistence ddmContentPersistence) {
481 this.ddmContentPersistence = ddmContentPersistence;
482 }
483
484
489 public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
490 return ddmStorageLinkLocalService;
491 }
492
493
498 public void setDDMStorageLinkLocalService(
499 DDMStorageLinkLocalService ddmStorageLinkLocalService) {
500 this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
501 }
502
503
508 public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
509 return ddmStorageLinkPersistence;
510 }
511
512
517 public void setDDMStorageLinkPersistence(
518 DDMStorageLinkPersistence ddmStorageLinkPersistence) {
519 this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
520 }
521
522
527 public DDMStructureLocalService getDDMStructureLocalService() {
528 return ddmStructureLocalService;
529 }
530
531
536 public void setDDMStructureLocalService(
537 DDMStructureLocalService ddmStructureLocalService) {
538 this.ddmStructureLocalService = ddmStructureLocalService;
539 }
540
541
546 public DDMStructureService getDDMStructureService() {
547 return ddmStructureService;
548 }
549
550
555 public void setDDMStructureService(DDMStructureService ddmStructureService) {
556 this.ddmStructureService = ddmStructureService;
557 }
558
559
564 public DDMStructurePersistence getDDMStructurePersistence() {
565 return ddmStructurePersistence;
566 }
567
568
573 public void setDDMStructurePersistence(
574 DDMStructurePersistence ddmStructurePersistence) {
575 this.ddmStructurePersistence = ddmStructurePersistence;
576 }
577
578
583 public DDMStructureFinder getDDMStructureFinder() {
584 return ddmStructureFinder;
585 }
586
587
592 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
593 this.ddmStructureFinder = ddmStructureFinder;
594 }
595
596
601 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
602 return ddmStructureLinkLocalService;
603 }
604
605
610 public void setDDMStructureLinkLocalService(
611 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
612 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
613 }
614
615
620 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
621 return ddmStructureLinkPersistence;
622 }
623
624
629 public void setDDMStructureLinkPersistence(
630 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
631 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
632 }
633
634
639 public DDMTemplateLocalService getDDMTemplateLocalService() {
640 return ddmTemplateLocalService;
641 }
642
643
648 public void setDDMTemplateLocalService(
649 DDMTemplateLocalService ddmTemplateLocalService) {
650 this.ddmTemplateLocalService = ddmTemplateLocalService;
651 }
652
653
658 public DDMTemplateService getDDMTemplateService() {
659 return ddmTemplateService;
660 }
661
662
667 public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
668 this.ddmTemplateService = ddmTemplateService;
669 }
670
671
676 public DDMTemplatePersistence getDDMTemplatePersistence() {
677 return ddmTemplatePersistence;
678 }
679
680
685 public void setDDMTemplatePersistence(
686 DDMTemplatePersistence ddmTemplatePersistence) {
687 this.ddmTemplatePersistence = ddmTemplatePersistence;
688 }
689
690
695 public DDMTemplateFinder getDDMTemplateFinder() {
696 return ddmTemplateFinder;
697 }
698
699
704 public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
705 this.ddmTemplateFinder = ddmTemplateFinder;
706 }
707
708
713 public CounterLocalService getCounterLocalService() {
714 return counterLocalService;
715 }
716
717
722 public void setCounterLocalService(CounterLocalService counterLocalService) {
723 this.counterLocalService = counterLocalService;
724 }
725
726
731 public ResourceLocalService getResourceLocalService() {
732 return resourceLocalService;
733 }
734
735
740 public void setResourceLocalService(
741 ResourceLocalService resourceLocalService) {
742 this.resourceLocalService = resourceLocalService;
743 }
744
745
750 public ResourceService getResourceService() {
751 return resourceService;
752 }
753
754
759 public void setResourceService(ResourceService resourceService) {
760 this.resourceService = resourceService;
761 }
762
763
768 public ResourcePersistence getResourcePersistence() {
769 return resourcePersistence;
770 }
771
772
777 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
778 this.resourcePersistence = resourcePersistence;
779 }
780
781
786 public ResourceFinder getResourceFinder() {
787 return resourceFinder;
788 }
789
790
795 public void setResourceFinder(ResourceFinder resourceFinder) {
796 this.resourceFinder = resourceFinder;
797 }
798
799
804 public UserLocalService getUserLocalService() {
805 return userLocalService;
806 }
807
808
813 public void setUserLocalService(UserLocalService userLocalService) {
814 this.userLocalService = userLocalService;
815 }
816
817
822 public UserService getUserService() {
823 return userService;
824 }
825
826
831 public void setUserService(UserService userService) {
832 this.userService = userService;
833 }
834
835
840 public UserPersistence getUserPersistence() {
841 return userPersistence;
842 }
843
844
849 public void setUserPersistence(UserPersistence userPersistence) {
850 this.userPersistence = userPersistence;
851 }
852
853
858 public UserFinder getUserFinder() {
859 return userFinder;
860 }
861
862
867 public void setUserFinder(UserFinder userFinder) {
868 this.userFinder = userFinder;
869 }
870
871
876 public DLFileEntryTypeLocalService getDLFileEntryTypeLocalService() {
877 return dlFileEntryTypeLocalService;
878 }
879
880
885 public void setDLFileEntryTypeLocalService(
886 DLFileEntryTypeLocalService dlFileEntryTypeLocalService) {
887 this.dlFileEntryTypeLocalService = dlFileEntryTypeLocalService;
888 }
889
890
895 public DLFileEntryTypeService getDLFileEntryTypeService() {
896 return dlFileEntryTypeService;
897 }
898
899
904 public void setDLFileEntryTypeService(
905 DLFileEntryTypeService dlFileEntryTypeService) {
906 this.dlFileEntryTypeService = dlFileEntryTypeService;
907 }
908
909
914 public DLFileEntryTypePersistence getDLFileEntryTypePersistence() {
915 return dlFileEntryTypePersistence;
916 }
917
918
923 public void setDLFileEntryTypePersistence(
924 DLFileEntryTypePersistence dlFileEntryTypePersistence) {
925 this.dlFileEntryTypePersistence = dlFileEntryTypePersistence;
926 }
927
928
933 public DLFileEntryTypeFinder getDLFileEntryTypeFinder() {
934 return dlFileEntryTypeFinder;
935 }
936
937
942 public void setDLFileEntryTypeFinder(
943 DLFileEntryTypeFinder dlFileEntryTypeFinder) {
944 this.dlFileEntryTypeFinder = dlFileEntryTypeFinder;
945 }
946
947 public void afterPropertiesSet() {
948 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMStructure",
949 ddmStructureLocalService);
950 }
951
952 public void destroy() {
953 persistedModelLocalServiceRegistry.unregister(
954 "com.liferay.portlet.dynamicdatamapping.model.DDMStructure");
955 }
956
957
962 public String getBeanIdentifier() {
963 return _beanIdentifier;
964 }
965
966
971 public void setBeanIdentifier(String beanIdentifier) {
972 _beanIdentifier = beanIdentifier;
973 }
974
975 protected Class<?> getModelClass() {
976 return DDMStructure.class;
977 }
978
979 protected String getModelClassName() {
980 return DDMStructure.class.getName();
981 }
982
983
988 protected void runSQL(String sql) throws SystemException {
989 try {
990 DataSource dataSource = ddmStructurePersistence.getDataSource();
991
992 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
993 sql, new int[0]);
994
995 sqlUpdate.update();
996 }
997 catch (Exception e) {
998 throw new SystemException(e);
999 }
1000 }
1001
1002 @BeanReference(type = DDMContentLocalService.class)
1003 protected DDMContentLocalService ddmContentLocalService;
1004 @BeanReference(type = DDMContentPersistence.class)
1005 protected DDMContentPersistence ddmContentPersistence;
1006 @BeanReference(type = DDMStorageLinkLocalService.class)
1007 protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
1008 @BeanReference(type = DDMStorageLinkPersistence.class)
1009 protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
1010 @BeanReference(type = DDMStructureLocalService.class)
1011 protected DDMStructureLocalService ddmStructureLocalService;
1012 @BeanReference(type = DDMStructureService.class)
1013 protected DDMStructureService ddmStructureService;
1014 @BeanReference(type = DDMStructurePersistence.class)
1015 protected DDMStructurePersistence ddmStructurePersistence;
1016 @BeanReference(type = DDMStructureFinder.class)
1017 protected DDMStructureFinder ddmStructureFinder;
1018 @BeanReference(type = DDMStructureLinkLocalService.class)
1019 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
1020 @BeanReference(type = DDMStructureLinkPersistence.class)
1021 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
1022 @BeanReference(type = DDMTemplateLocalService.class)
1023 protected DDMTemplateLocalService ddmTemplateLocalService;
1024 @BeanReference(type = DDMTemplateService.class)
1025 protected DDMTemplateService ddmTemplateService;
1026 @BeanReference(type = DDMTemplatePersistence.class)
1027 protected DDMTemplatePersistence ddmTemplatePersistence;
1028 @BeanReference(type = DDMTemplateFinder.class)
1029 protected DDMTemplateFinder ddmTemplateFinder;
1030 @BeanReference(type = CounterLocalService.class)
1031 protected CounterLocalService counterLocalService;
1032 @BeanReference(type = ResourceLocalService.class)
1033 protected ResourceLocalService resourceLocalService;
1034 @BeanReference(type = ResourceService.class)
1035 protected ResourceService resourceService;
1036 @BeanReference(type = ResourcePersistence.class)
1037 protected ResourcePersistence resourcePersistence;
1038 @BeanReference(type = ResourceFinder.class)
1039 protected ResourceFinder resourceFinder;
1040 @BeanReference(type = UserLocalService.class)
1041 protected UserLocalService userLocalService;
1042 @BeanReference(type = UserService.class)
1043 protected UserService userService;
1044 @BeanReference(type = UserPersistence.class)
1045 protected UserPersistence userPersistence;
1046 @BeanReference(type = UserFinder.class)
1047 protected UserFinder userFinder;
1048 @BeanReference(type = DLFileEntryTypeLocalService.class)
1049 protected DLFileEntryTypeLocalService dlFileEntryTypeLocalService;
1050 @BeanReference(type = DLFileEntryTypeService.class)
1051 protected DLFileEntryTypeService dlFileEntryTypeService;
1052 @BeanReference(type = DLFileEntryTypePersistence.class)
1053 protected DLFileEntryTypePersistence dlFileEntryTypePersistence;
1054 @BeanReference(type = DLFileEntryTypeFinder.class)
1055 protected DLFileEntryTypeFinder dlFileEntryTypeFinder;
1056 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1057 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1058 private String _beanIdentifier;
1059 }