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.ImageLocalService;
035 import com.liferay.portal.service.ImageService;
036 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
037 import com.liferay.portal.service.ResourceLocalService;
038 import com.liferay.portal.service.UserLocalService;
039 import com.liferay.portal.service.UserService;
040 import com.liferay.portal.service.persistence.GroupFinder;
041 import com.liferay.portal.service.persistence.GroupPersistence;
042 import com.liferay.portal.service.persistence.ImagePersistence;
043 import com.liferay.portal.service.persistence.UserFinder;
044 import com.liferay.portal.service.persistence.UserPersistence;
045
046 import com.liferay.portlet.dynamicdatamapping.model.DDMTemplate;
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 DDMTemplateLocalServiceBaseImpl
081 extends BaseLocalServiceImpl implements DDMTemplateLocalService,
082 IdentifiableBean {
083
088
089
096 @Indexable(type = IndexableType.REINDEX)
097 public DDMTemplate addDDMTemplate(DDMTemplate ddmTemplate)
098 throws SystemException {
099 ddmTemplate.setNew(true);
100
101 return ddmTemplatePersistence.update(ddmTemplate);
102 }
103
104
110 public DDMTemplate createDDMTemplate(long templateId) {
111 return ddmTemplatePersistence.create(templateId);
112 }
113
114
122 @Indexable(type = IndexableType.DELETE)
123 public DDMTemplate deleteDDMTemplate(long templateId)
124 throws PortalException, SystemException {
125 return ddmTemplatePersistence.remove(templateId);
126 }
127
128
135 @Indexable(type = IndexableType.DELETE)
136 public DDMTemplate deleteDDMTemplate(DDMTemplate ddmTemplate)
137 throws SystemException {
138 return ddmTemplatePersistence.remove(ddmTemplate);
139 }
140
141 public DynamicQuery dynamicQuery() {
142 Class<?> clazz = getClass();
143
144 return DynamicQueryFactoryUtil.forClass(DDMTemplate.class,
145 clazz.getClassLoader());
146 }
147
148
155 @SuppressWarnings("rawtypes")
156 public List dynamicQuery(DynamicQuery dynamicQuery)
157 throws SystemException {
158 return ddmTemplatePersistence.findWithDynamicQuery(dynamicQuery);
159 }
160
161
174 @SuppressWarnings("rawtypes")
175 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
176 throws SystemException {
177 return ddmTemplatePersistence.findWithDynamicQuery(dynamicQuery, start,
178 end);
179 }
180
181
195 @SuppressWarnings("rawtypes")
196 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
197 OrderByComparator orderByComparator) throws SystemException {
198 return ddmTemplatePersistence.findWithDynamicQuery(dynamicQuery, start,
199 end, orderByComparator);
200 }
201
202
209 public long dynamicQueryCount(DynamicQuery dynamicQuery)
210 throws SystemException {
211 return ddmTemplatePersistence.countWithDynamicQuery(dynamicQuery);
212 }
213
214 public DDMTemplate fetchDDMTemplate(long templateId)
215 throws SystemException {
216 return ddmTemplatePersistence.fetchByPrimaryKey(templateId);
217 }
218
219
227 public DDMTemplate getDDMTemplate(long templateId)
228 throws PortalException, SystemException {
229 return ddmTemplatePersistence.findByPrimaryKey(templateId);
230 }
231
232 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
233 throws PortalException, SystemException {
234 return ddmTemplatePersistence.findByPrimaryKey(primaryKeyObj);
235 }
236
237
246 public DDMTemplate getDDMTemplateByUuidAndGroupId(String uuid, long groupId)
247 throws PortalException, SystemException {
248 return ddmTemplatePersistence.findByUUID_G(uuid, groupId);
249 }
250
251
263 public List<DDMTemplate> getDDMTemplates(int start, int end)
264 throws SystemException {
265 return ddmTemplatePersistence.findAll(start, end);
266 }
267
268
274 public int getDDMTemplatesCount() throws SystemException {
275 return ddmTemplatePersistence.countAll();
276 }
277
278
285 @Indexable(type = IndexableType.REINDEX)
286 public DDMTemplate updateDDMTemplate(DDMTemplate ddmTemplate)
287 throws SystemException {
288 return ddmTemplatePersistence.update(ddmTemplate);
289 }
290
291
296 public DDMContentLocalService getDDMContentLocalService() {
297 return ddmContentLocalService;
298 }
299
300
305 public void setDDMContentLocalService(
306 DDMContentLocalService ddmContentLocalService) {
307 this.ddmContentLocalService = ddmContentLocalService;
308 }
309
310
315 public DDMContentPersistence getDDMContentPersistence() {
316 return ddmContentPersistence;
317 }
318
319
324 public void setDDMContentPersistence(
325 DDMContentPersistence ddmContentPersistence) {
326 this.ddmContentPersistence = ddmContentPersistence;
327 }
328
329
334 public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
335 return ddmStorageLinkLocalService;
336 }
337
338
343 public void setDDMStorageLinkLocalService(
344 DDMStorageLinkLocalService ddmStorageLinkLocalService) {
345 this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
346 }
347
348
353 public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
354 return ddmStorageLinkPersistence;
355 }
356
357
362 public void setDDMStorageLinkPersistence(
363 DDMStorageLinkPersistence ddmStorageLinkPersistence) {
364 this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
365 }
366
367
372 public DDMStructureLocalService getDDMStructureLocalService() {
373 return ddmStructureLocalService;
374 }
375
376
381 public void setDDMStructureLocalService(
382 DDMStructureLocalService ddmStructureLocalService) {
383 this.ddmStructureLocalService = ddmStructureLocalService;
384 }
385
386
391 public DDMStructureService getDDMStructureService() {
392 return ddmStructureService;
393 }
394
395
400 public void setDDMStructureService(DDMStructureService ddmStructureService) {
401 this.ddmStructureService = ddmStructureService;
402 }
403
404
409 public DDMStructurePersistence getDDMStructurePersistence() {
410 return ddmStructurePersistence;
411 }
412
413
418 public void setDDMStructurePersistence(
419 DDMStructurePersistence ddmStructurePersistence) {
420 this.ddmStructurePersistence = ddmStructurePersistence;
421 }
422
423
428 public DDMStructureFinder getDDMStructureFinder() {
429 return ddmStructureFinder;
430 }
431
432
437 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
438 this.ddmStructureFinder = ddmStructureFinder;
439 }
440
441
446 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
447 return ddmStructureLinkLocalService;
448 }
449
450
455 public void setDDMStructureLinkLocalService(
456 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
457 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
458 }
459
460
465 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
466 return ddmStructureLinkPersistence;
467 }
468
469
474 public void setDDMStructureLinkPersistence(
475 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
476 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
477 }
478
479
484 public DDMTemplateLocalService getDDMTemplateLocalService() {
485 return ddmTemplateLocalService;
486 }
487
488
493 public void setDDMTemplateLocalService(
494 DDMTemplateLocalService ddmTemplateLocalService) {
495 this.ddmTemplateLocalService = ddmTemplateLocalService;
496 }
497
498
503 public DDMTemplateService getDDMTemplateService() {
504 return ddmTemplateService;
505 }
506
507
512 public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
513 this.ddmTemplateService = ddmTemplateService;
514 }
515
516
521 public DDMTemplatePersistence getDDMTemplatePersistence() {
522 return ddmTemplatePersistence;
523 }
524
525
530 public void setDDMTemplatePersistence(
531 DDMTemplatePersistence ddmTemplatePersistence) {
532 this.ddmTemplatePersistence = ddmTemplatePersistence;
533 }
534
535
540 public DDMTemplateFinder getDDMTemplateFinder() {
541 return ddmTemplateFinder;
542 }
543
544
549 public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
550 this.ddmTemplateFinder = ddmTemplateFinder;
551 }
552
553
558 public CounterLocalService getCounterLocalService() {
559 return counterLocalService;
560 }
561
562
567 public void setCounterLocalService(CounterLocalService counterLocalService) {
568 this.counterLocalService = counterLocalService;
569 }
570
571
576 public GroupLocalService getGroupLocalService() {
577 return groupLocalService;
578 }
579
580
585 public void setGroupLocalService(GroupLocalService groupLocalService) {
586 this.groupLocalService = groupLocalService;
587 }
588
589
594 public GroupService getGroupService() {
595 return groupService;
596 }
597
598
603 public void setGroupService(GroupService groupService) {
604 this.groupService = groupService;
605 }
606
607
612 public GroupPersistence getGroupPersistence() {
613 return groupPersistence;
614 }
615
616
621 public void setGroupPersistence(GroupPersistence groupPersistence) {
622 this.groupPersistence = groupPersistence;
623 }
624
625
630 public GroupFinder getGroupFinder() {
631 return groupFinder;
632 }
633
634
639 public void setGroupFinder(GroupFinder groupFinder) {
640 this.groupFinder = groupFinder;
641 }
642
643
648 public ImageLocalService getImageLocalService() {
649 return imageLocalService;
650 }
651
652
657 public void setImageLocalService(ImageLocalService imageLocalService) {
658 this.imageLocalService = imageLocalService;
659 }
660
661
666 public ImageService getImageService() {
667 return imageService;
668 }
669
670
675 public void setImageService(ImageService imageService) {
676 this.imageService = imageService;
677 }
678
679
684 public ImagePersistence getImagePersistence() {
685 return imagePersistence;
686 }
687
688
693 public void setImagePersistence(ImagePersistence imagePersistence) {
694 this.imagePersistence = imagePersistence;
695 }
696
697
702 public ResourceLocalService getResourceLocalService() {
703 return resourceLocalService;
704 }
705
706
711 public void setResourceLocalService(
712 ResourceLocalService resourceLocalService) {
713 this.resourceLocalService = resourceLocalService;
714 }
715
716
721 public UserLocalService getUserLocalService() {
722 return userLocalService;
723 }
724
725
730 public void setUserLocalService(UserLocalService userLocalService) {
731 this.userLocalService = userLocalService;
732 }
733
734
739 public UserService getUserService() {
740 return userService;
741 }
742
743
748 public void setUserService(UserService userService) {
749 this.userService = userService;
750 }
751
752
757 public UserPersistence getUserPersistence() {
758 return userPersistence;
759 }
760
761
766 public void setUserPersistence(UserPersistence userPersistence) {
767 this.userPersistence = userPersistence;
768 }
769
770
775 public UserFinder getUserFinder() {
776 return userFinder;
777 }
778
779
784 public void setUserFinder(UserFinder userFinder) {
785 this.userFinder = userFinder;
786 }
787
788 public void afterPropertiesSet() {
789 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMTemplate",
790 ddmTemplateLocalService);
791 }
792
793 public void destroy() {
794 persistedModelLocalServiceRegistry.unregister(
795 "com.liferay.portlet.dynamicdatamapping.model.DDMTemplate");
796 }
797
798
803 public String getBeanIdentifier() {
804 return _beanIdentifier;
805 }
806
807
812 public void setBeanIdentifier(String beanIdentifier) {
813 _beanIdentifier = beanIdentifier;
814 }
815
816 protected Class<?> getModelClass() {
817 return DDMTemplate.class;
818 }
819
820 protected String getModelClassName() {
821 return DDMTemplate.class.getName();
822 }
823
824
829 protected void runSQL(String sql) throws SystemException {
830 try {
831 DataSource dataSource = ddmTemplatePersistence.getDataSource();
832
833 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
834 sql, new int[0]);
835
836 sqlUpdate.update();
837 }
838 catch (Exception e) {
839 throw new SystemException(e);
840 }
841 }
842
843 @BeanReference(type = DDMContentLocalService.class)
844 protected DDMContentLocalService ddmContentLocalService;
845 @BeanReference(type = DDMContentPersistence.class)
846 protected DDMContentPersistence ddmContentPersistence;
847 @BeanReference(type = DDMStorageLinkLocalService.class)
848 protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
849 @BeanReference(type = DDMStorageLinkPersistence.class)
850 protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
851 @BeanReference(type = DDMStructureLocalService.class)
852 protected DDMStructureLocalService ddmStructureLocalService;
853 @BeanReference(type = DDMStructureService.class)
854 protected DDMStructureService ddmStructureService;
855 @BeanReference(type = DDMStructurePersistence.class)
856 protected DDMStructurePersistence ddmStructurePersistence;
857 @BeanReference(type = DDMStructureFinder.class)
858 protected DDMStructureFinder ddmStructureFinder;
859 @BeanReference(type = DDMStructureLinkLocalService.class)
860 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
861 @BeanReference(type = DDMStructureLinkPersistence.class)
862 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
863 @BeanReference(type = DDMTemplateLocalService.class)
864 protected DDMTemplateLocalService ddmTemplateLocalService;
865 @BeanReference(type = DDMTemplateService.class)
866 protected DDMTemplateService ddmTemplateService;
867 @BeanReference(type = DDMTemplatePersistence.class)
868 protected DDMTemplatePersistence ddmTemplatePersistence;
869 @BeanReference(type = DDMTemplateFinder.class)
870 protected DDMTemplateFinder ddmTemplateFinder;
871 @BeanReference(type = CounterLocalService.class)
872 protected CounterLocalService counterLocalService;
873 @BeanReference(type = GroupLocalService.class)
874 protected GroupLocalService groupLocalService;
875 @BeanReference(type = GroupService.class)
876 protected GroupService groupService;
877 @BeanReference(type = GroupPersistence.class)
878 protected GroupPersistence groupPersistence;
879 @BeanReference(type = GroupFinder.class)
880 protected GroupFinder groupFinder;
881 @BeanReference(type = ImageLocalService.class)
882 protected ImageLocalService imageLocalService;
883 @BeanReference(type = ImageService.class)
884 protected ImageService imageService;
885 @BeanReference(type = ImagePersistence.class)
886 protected ImagePersistence imagePersistence;
887 @BeanReference(type = ResourceLocalService.class)
888 protected ResourceLocalService resourceLocalService;
889 @BeanReference(type = UserLocalService.class)
890 protected UserLocalService userLocalService;
891 @BeanReference(type = UserService.class)
892 protected UserService userService;
893 @BeanReference(type = UserPersistence.class)
894 protected UserPersistence userPersistence;
895 @BeanReference(type = UserFinder.class)
896 protected UserFinder userFinder;
897 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
898 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
899 private String _beanIdentifier;
900 }