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.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.dynamicdatamapping.model.DDMStorageLink;
044 import com.liferay.portlet.dynamicdatamapping.service.DDMContentLocalService;
045 import com.liferay.portlet.dynamicdatamapping.service.DDMStorageLinkLocalService;
046 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkLocalService;
047 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLinkService;
048 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalService;
049 import com.liferay.portlet.dynamicdatamapping.service.DDMStructureService;
050 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalService;
051 import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateService;
052 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMContentPersistence;
053 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStorageLinkPersistence;
054 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureFinder;
055 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructureLinkPersistence;
056 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMStructurePersistence;
057 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplateFinder;
058 import com.liferay.portlet.dynamicdatamapping.service.persistence.DDMTemplatePersistence;
059
060 import java.io.Serializable;
061
062 import java.util.List;
063
064 import javax.sql.DataSource;
065
066
078 public abstract class DDMStorageLinkLocalServiceBaseImpl
079 implements DDMStorageLinkLocalService, IdentifiableBean {
080
085
086
093 public DDMStorageLink addDDMStorageLink(DDMStorageLink ddmStorageLink)
094 throws SystemException {
095 ddmStorageLink.setNew(true);
096
097 ddmStorageLink = ddmStorageLinkPersistence.update(ddmStorageLink, false);
098
099 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
100
101 if (indexer != null) {
102 try {
103 indexer.reindex(ddmStorageLink);
104 }
105 catch (SearchException se) {
106 if (_log.isWarnEnabled()) {
107 _log.warn(se, se);
108 }
109 }
110 }
111
112 return ddmStorageLink;
113 }
114
115
121 public DDMStorageLink createDDMStorageLink(long storageLinkId) {
122 return ddmStorageLinkPersistence.create(storageLinkId);
123 }
124
125
132 public void deleteDDMStorageLink(long storageLinkId)
133 throws PortalException, SystemException {
134 DDMStorageLink ddmStorageLink = ddmStorageLinkPersistence.remove(storageLinkId);
135
136 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
137
138 if (indexer != null) {
139 try {
140 indexer.delete(ddmStorageLink);
141 }
142 catch (SearchException se) {
143 if (_log.isWarnEnabled()) {
144 _log.warn(se, se);
145 }
146 }
147 }
148 }
149
150
156 public void deleteDDMStorageLink(DDMStorageLink ddmStorageLink)
157 throws SystemException {
158 ddmStorageLinkPersistence.remove(ddmStorageLink);
159
160 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
161
162 if (indexer != null) {
163 try {
164 indexer.delete(ddmStorageLink);
165 }
166 catch (SearchException se) {
167 if (_log.isWarnEnabled()) {
168 _log.warn(se, se);
169 }
170 }
171 }
172 }
173
174
181 @SuppressWarnings("rawtypes")
182 public List dynamicQuery(DynamicQuery dynamicQuery)
183 throws SystemException {
184 return ddmStorageLinkPersistence.findWithDynamicQuery(dynamicQuery);
185 }
186
187
200 @SuppressWarnings("rawtypes")
201 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
202 throws SystemException {
203 return ddmStorageLinkPersistence.findWithDynamicQuery(dynamicQuery,
204 start, end);
205 }
206
207
221 @SuppressWarnings("rawtypes")
222 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
223 OrderByComparator orderByComparator) throws SystemException {
224 return ddmStorageLinkPersistence.findWithDynamicQuery(dynamicQuery,
225 start, end, orderByComparator);
226 }
227
228
235 public long dynamicQueryCount(DynamicQuery dynamicQuery)
236 throws SystemException {
237 return ddmStorageLinkPersistence.countWithDynamicQuery(dynamicQuery);
238 }
239
240 public DDMStorageLink fetchDDMStorageLink(long storageLinkId)
241 throws SystemException {
242 return ddmStorageLinkPersistence.fetchByPrimaryKey(storageLinkId);
243 }
244
245
253 public DDMStorageLink getDDMStorageLink(long storageLinkId)
254 throws PortalException, SystemException {
255 return ddmStorageLinkPersistence.findByPrimaryKey(storageLinkId);
256 }
257
258 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
259 throws PortalException, SystemException {
260 return ddmStorageLinkPersistence.findByPrimaryKey(primaryKeyObj);
261 }
262
263
275 public List<DDMStorageLink> getDDMStorageLinks(int start, int end)
276 throws SystemException {
277 return ddmStorageLinkPersistence.findAll(start, end);
278 }
279
280
286 public int getDDMStorageLinksCount() throws SystemException {
287 return ddmStorageLinkPersistence.countAll();
288 }
289
290
297 public DDMStorageLink updateDDMStorageLink(DDMStorageLink ddmStorageLink)
298 throws SystemException {
299 return updateDDMStorageLink(ddmStorageLink, true);
300 }
301
302
310 public DDMStorageLink updateDDMStorageLink(DDMStorageLink ddmStorageLink,
311 boolean merge) throws SystemException {
312 ddmStorageLink.setNew(false);
313
314 ddmStorageLink = ddmStorageLinkPersistence.update(ddmStorageLink, merge);
315
316 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
317
318 if (indexer != null) {
319 try {
320 indexer.reindex(ddmStorageLink);
321 }
322 catch (SearchException se) {
323 if (_log.isWarnEnabled()) {
324 _log.warn(se, se);
325 }
326 }
327 }
328
329 return ddmStorageLink;
330 }
331
332
337 public DDMContentLocalService getDDMContentLocalService() {
338 return ddmContentLocalService;
339 }
340
341
346 public void setDDMContentLocalService(
347 DDMContentLocalService ddmContentLocalService) {
348 this.ddmContentLocalService = ddmContentLocalService;
349 }
350
351
356 public DDMContentPersistence getDDMContentPersistence() {
357 return ddmContentPersistence;
358 }
359
360
365 public void setDDMContentPersistence(
366 DDMContentPersistence ddmContentPersistence) {
367 this.ddmContentPersistence = ddmContentPersistence;
368 }
369
370
375 public DDMStorageLinkLocalService getDDMStorageLinkLocalService() {
376 return ddmStorageLinkLocalService;
377 }
378
379
384 public void setDDMStorageLinkLocalService(
385 DDMStorageLinkLocalService ddmStorageLinkLocalService) {
386 this.ddmStorageLinkLocalService = ddmStorageLinkLocalService;
387 }
388
389
394 public DDMStorageLinkPersistence getDDMStorageLinkPersistence() {
395 return ddmStorageLinkPersistence;
396 }
397
398
403 public void setDDMStorageLinkPersistence(
404 DDMStorageLinkPersistence ddmStorageLinkPersistence) {
405 this.ddmStorageLinkPersistence = ddmStorageLinkPersistence;
406 }
407
408
413 public DDMStructureLocalService getDDMStructureLocalService() {
414 return ddmStructureLocalService;
415 }
416
417
422 public void setDDMStructureLocalService(
423 DDMStructureLocalService ddmStructureLocalService) {
424 this.ddmStructureLocalService = ddmStructureLocalService;
425 }
426
427
432 public DDMStructureService getDDMStructureService() {
433 return ddmStructureService;
434 }
435
436
441 public void setDDMStructureService(DDMStructureService ddmStructureService) {
442 this.ddmStructureService = ddmStructureService;
443 }
444
445
450 public DDMStructurePersistence getDDMStructurePersistence() {
451 return ddmStructurePersistence;
452 }
453
454
459 public void setDDMStructurePersistence(
460 DDMStructurePersistence ddmStructurePersistence) {
461 this.ddmStructurePersistence = ddmStructurePersistence;
462 }
463
464
469 public DDMStructureFinder getDDMStructureFinder() {
470 return ddmStructureFinder;
471 }
472
473
478 public void setDDMStructureFinder(DDMStructureFinder ddmStructureFinder) {
479 this.ddmStructureFinder = ddmStructureFinder;
480 }
481
482
487 public DDMStructureLinkLocalService getDDMStructureLinkLocalService() {
488 return ddmStructureLinkLocalService;
489 }
490
491
496 public void setDDMStructureLinkLocalService(
497 DDMStructureLinkLocalService ddmStructureLinkLocalService) {
498 this.ddmStructureLinkLocalService = ddmStructureLinkLocalService;
499 }
500
501
506 public DDMStructureLinkService getDDMStructureLinkService() {
507 return ddmStructureLinkService;
508 }
509
510
515 public void setDDMStructureLinkService(
516 DDMStructureLinkService ddmStructureLinkService) {
517 this.ddmStructureLinkService = ddmStructureLinkService;
518 }
519
520
525 public DDMStructureLinkPersistence getDDMStructureLinkPersistence() {
526 return ddmStructureLinkPersistence;
527 }
528
529
534 public void setDDMStructureLinkPersistence(
535 DDMStructureLinkPersistence ddmStructureLinkPersistence) {
536 this.ddmStructureLinkPersistence = ddmStructureLinkPersistence;
537 }
538
539
544 public DDMTemplateLocalService getDDMTemplateLocalService() {
545 return ddmTemplateLocalService;
546 }
547
548
553 public void setDDMTemplateLocalService(
554 DDMTemplateLocalService ddmTemplateLocalService) {
555 this.ddmTemplateLocalService = ddmTemplateLocalService;
556 }
557
558
563 public DDMTemplateService getDDMTemplateService() {
564 return ddmTemplateService;
565 }
566
567
572 public void setDDMTemplateService(DDMTemplateService ddmTemplateService) {
573 this.ddmTemplateService = ddmTemplateService;
574 }
575
576
581 public DDMTemplatePersistence getDDMTemplatePersistence() {
582 return ddmTemplatePersistence;
583 }
584
585
590 public void setDDMTemplatePersistence(
591 DDMTemplatePersistence ddmTemplatePersistence) {
592 this.ddmTemplatePersistence = ddmTemplatePersistence;
593 }
594
595
600 public DDMTemplateFinder getDDMTemplateFinder() {
601 return ddmTemplateFinder;
602 }
603
604
609 public void setDDMTemplateFinder(DDMTemplateFinder ddmTemplateFinder) {
610 this.ddmTemplateFinder = ddmTemplateFinder;
611 }
612
613
618 public CounterLocalService getCounterLocalService() {
619 return counterLocalService;
620 }
621
622
627 public void setCounterLocalService(CounterLocalService counterLocalService) {
628 this.counterLocalService = counterLocalService;
629 }
630
631
636 public ResourceLocalService getResourceLocalService() {
637 return resourceLocalService;
638 }
639
640
645 public void setResourceLocalService(
646 ResourceLocalService resourceLocalService) {
647 this.resourceLocalService = resourceLocalService;
648 }
649
650
655 public ResourceService getResourceService() {
656 return resourceService;
657 }
658
659
664 public void setResourceService(ResourceService resourceService) {
665 this.resourceService = resourceService;
666 }
667
668
673 public ResourcePersistence getResourcePersistence() {
674 return resourcePersistence;
675 }
676
677
682 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
683 this.resourcePersistence = resourcePersistence;
684 }
685
686
691 public ResourceFinder getResourceFinder() {
692 return resourceFinder;
693 }
694
695
700 public void setResourceFinder(ResourceFinder resourceFinder) {
701 this.resourceFinder = resourceFinder;
702 }
703
704
709 public UserLocalService getUserLocalService() {
710 return userLocalService;
711 }
712
713
718 public void setUserLocalService(UserLocalService userLocalService) {
719 this.userLocalService = userLocalService;
720 }
721
722
727 public UserService getUserService() {
728 return userService;
729 }
730
731
736 public void setUserService(UserService userService) {
737 this.userService = userService;
738 }
739
740
745 public UserPersistence getUserPersistence() {
746 return userPersistence;
747 }
748
749
754 public void setUserPersistence(UserPersistence userPersistence) {
755 this.userPersistence = userPersistence;
756 }
757
758
763 public UserFinder getUserFinder() {
764 return userFinder;
765 }
766
767
772 public void setUserFinder(UserFinder userFinder) {
773 this.userFinder = userFinder;
774 }
775
776 public void afterPropertiesSet() {
777 persistedModelLocalServiceRegistry.register("com.liferay.portlet.dynamicdatamapping.model.DDMStorageLink",
778 ddmStorageLinkLocalService);
779 }
780
781 public void destroy() {
782 persistedModelLocalServiceRegistry.unregister(
783 "com.liferay.portlet.dynamicdatamapping.model.DDMStorageLink");
784 }
785
786
791 public String getBeanIdentifier() {
792 return _beanIdentifier;
793 }
794
795
800 public void setBeanIdentifier(String beanIdentifier) {
801 _beanIdentifier = beanIdentifier;
802 }
803
804 protected Class<?> getModelClass() {
805 return DDMStorageLink.class;
806 }
807
808 protected String getModelClassName() {
809 return DDMStorageLink.class.getName();
810 }
811
812
817 protected void runSQL(String sql) throws SystemException {
818 try {
819 DataSource dataSource = ddmStorageLinkPersistence.getDataSource();
820
821 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
822 sql, new int[0]);
823
824 sqlUpdate.update();
825 }
826 catch (Exception e) {
827 throw new SystemException(e);
828 }
829 }
830
831 @BeanReference(type = DDMContentLocalService.class)
832 protected DDMContentLocalService ddmContentLocalService;
833 @BeanReference(type = DDMContentPersistence.class)
834 protected DDMContentPersistence ddmContentPersistence;
835 @BeanReference(type = DDMStorageLinkLocalService.class)
836 protected DDMStorageLinkLocalService ddmStorageLinkLocalService;
837 @BeanReference(type = DDMStorageLinkPersistence.class)
838 protected DDMStorageLinkPersistence ddmStorageLinkPersistence;
839 @BeanReference(type = DDMStructureLocalService.class)
840 protected DDMStructureLocalService ddmStructureLocalService;
841 @BeanReference(type = DDMStructureService.class)
842 protected DDMStructureService ddmStructureService;
843 @BeanReference(type = DDMStructurePersistence.class)
844 protected DDMStructurePersistence ddmStructurePersistence;
845 @BeanReference(type = DDMStructureFinder.class)
846 protected DDMStructureFinder ddmStructureFinder;
847 @BeanReference(type = DDMStructureLinkLocalService.class)
848 protected DDMStructureLinkLocalService ddmStructureLinkLocalService;
849 @BeanReference(type = DDMStructureLinkService.class)
850 protected DDMStructureLinkService ddmStructureLinkService;
851 @BeanReference(type = DDMStructureLinkPersistence.class)
852 protected DDMStructureLinkPersistence ddmStructureLinkPersistence;
853 @BeanReference(type = DDMTemplateLocalService.class)
854 protected DDMTemplateLocalService ddmTemplateLocalService;
855 @BeanReference(type = DDMTemplateService.class)
856 protected DDMTemplateService ddmTemplateService;
857 @BeanReference(type = DDMTemplatePersistence.class)
858 protected DDMTemplatePersistence ddmTemplatePersistence;
859 @BeanReference(type = DDMTemplateFinder.class)
860 protected DDMTemplateFinder ddmTemplateFinder;
861 @BeanReference(type = CounterLocalService.class)
862 protected CounterLocalService counterLocalService;
863 @BeanReference(type = ResourceLocalService.class)
864 protected ResourceLocalService resourceLocalService;
865 @BeanReference(type = ResourceService.class)
866 protected ResourceService resourceService;
867 @BeanReference(type = ResourcePersistence.class)
868 protected ResourcePersistence resourcePersistence;
869 @BeanReference(type = ResourceFinder.class)
870 protected ResourceFinder resourceFinder;
871 @BeanReference(type = UserLocalService.class)
872 protected UserLocalService userLocalService;
873 @BeanReference(type = UserService.class)
874 protected UserService userService;
875 @BeanReference(type = UserPersistence.class)
876 protected UserPersistence userPersistence;
877 @BeanReference(type = UserFinder.class)
878 protected UserFinder userFinder;
879 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
880 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
881 private static Log _log = LogFactoryUtil.getLog(DDMStorageLinkLocalServiceBaseImpl.class);
882 private String _beanIdentifier;
883 }