001
014
015 package com.liferay.portlet.documentlibrary.service.base;
016
017 import com.liferay.counter.service.CounterLocalService;
018
019 import com.liferay.portal.kernel.annotation.BeanReference;
020 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
022 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
023 import com.liferay.portal.kernel.exception.PortalException;
024 import com.liferay.portal.kernel.exception.SystemException;
025 import com.liferay.portal.kernel.util.OrderByComparator;
026 import com.liferay.portal.service.ResourceLocalService;
027 import com.liferay.portal.service.ResourceService;
028 import com.liferay.portal.service.UserLocalService;
029 import com.liferay.portal.service.UserService;
030 import com.liferay.portal.service.persistence.ResourceFinder;
031 import com.liferay.portal.service.persistence.ResourcePersistence;
032 import com.liferay.portal.service.persistence.UserFinder;
033 import com.liferay.portal.service.persistence.UserPersistence;
034
035 import com.liferay.portlet.asset.service.AssetEntryLocalService;
036 import com.liferay.portlet.asset.service.AssetEntryService;
037 import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
038 import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
039 import com.liferay.portlet.documentlibrary.model.DLFileVersion;
040 import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService;
041 import com.liferay.portlet.documentlibrary.service.DLFileEntryService;
042 import com.liferay.portlet.documentlibrary.service.DLFileRankLocalService;
043 import com.liferay.portlet.documentlibrary.service.DLFileShortcutLocalService;
044 import com.liferay.portlet.documentlibrary.service.DLFileShortcutService;
045 import com.liferay.portlet.documentlibrary.service.DLFileVersionLocalService;
046 import com.liferay.portlet.documentlibrary.service.DLFileVersionService;
047 import com.liferay.portlet.documentlibrary.service.DLFolderLocalService;
048 import com.liferay.portlet.documentlibrary.service.DLFolderService;
049 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryFinder;
050 import com.liferay.portlet.documentlibrary.service.persistence.DLFileEntryPersistence;
051 import com.liferay.portlet.documentlibrary.service.persistence.DLFileRankPersistence;
052 import com.liferay.portlet.documentlibrary.service.persistence.DLFileShortcutPersistence;
053 import com.liferay.portlet.documentlibrary.service.persistence.DLFileVersionPersistence;
054 import com.liferay.portlet.documentlibrary.service.persistence.DLFolderFinder;
055 import com.liferay.portlet.documentlibrary.service.persistence.DLFolderPersistence;
056
057 import java.util.List;
058
059 import javax.sql.DataSource;
060
061
077 public abstract class DLFileVersionLocalServiceBaseImpl
078 implements DLFileVersionLocalService {
079
086 public DLFileVersion addDLFileVersion(DLFileVersion dlFileVersion)
087 throws SystemException {
088 dlFileVersion.setNew(true);
089
090 return dlFileVersionPersistence.update(dlFileVersion, false);
091 }
092
093
099 public DLFileVersion createDLFileVersion(long fileVersionId) {
100 return dlFileVersionPersistence.create(fileVersionId);
101 }
102
103
110 public void deleteDLFileVersion(long fileVersionId)
111 throws PortalException, SystemException {
112 dlFileVersionPersistence.remove(fileVersionId);
113 }
114
115
121 public void deleteDLFileVersion(DLFileVersion dlFileVersion)
122 throws SystemException {
123 dlFileVersionPersistence.remove(dlFileVersion);
124 }
125
126
133 @SuppressWarnings("rawtypes")
134 public List dynamicQuery(DynamicQuery dynamicQuery)
135 throws SystemException {
136 return dlFileVersionPersistence.findWithDynamicQuery(dynamicQuery);
137 }
138
139
152 @SuppressWarnings("rawtypes")
153 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
154 throws SystemException {
155 return dlFileVersionPersistence.findWithDynamicQuery(dynamicQuery,
156 start, end);
157 }
158
159
173 @SuppressWarnings("rawtypes")
174 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
175 OrderByComparator orderByComparator) throws SystemException {
176 return dlFileVersionPersistence.findWithDynamicQuery(dynamicQuery,
177 start, end, orderByComparator);
178 }
179
180
187 public long dynamicQueryCount(DynamicQuery dynamicQuery)
188 throws SystemException {
189 return dlFileVersionPersistence.countWithDynamicQuery(dynamicQuery);
190 }
191
192
200 public DLFileVersion getDLFileVersion(long fileVersionId)
201 throws PortalException, SystemException {
202 return dlFileVersionPersistence.findByPrimaryKey(fileVersionId);
203 }
204
205
217 public List<DLFileVersion> getDLFileVersions(int start, int end)
218 throws SystemException {
219 return dlFileVersionPersistence.findAll(start, end);
220 }
221
222
228 public int getDLFileVersionsCount() throws SystemException {
229 return dlFileVersionPersistence.countAll();
230 }
231
232
239 public DLFileVersion updateDLFileVersion(DLFileVersion dlFileVersion)
240 throws SystemException {
241 dlFileVersion.setNew(false);
242
243 return dlFileVersionPersistence.update(dlFileVersion, true);
244 }
245
246
254 public DLFileVersion updateDLFileVersion(DLFileVersion dlFileVersion,
255 boolean merge) throws SystemException {
256 dlFileVersion.setNew(false);
257
258 return dlFileVersionPersistence.update(dlFileVersion, merge);
259 }
260
261
266 public DLFileEntryLocalService getDLFileEntryLocalService() {
267 return dlFileEntryLocalService;
268 }
269
270
275 public void setDLFileEntryLocalService(
276 DLFileEntryLocalService dlFileEntryLocalService) {
277 this.dlFileEntryLocalService = dlFileEntryLocalService;
278 }
279
280
285 public DLFileEntryService getDLFileEntryService() {
286 return dlFileEntryService;
287 }
288
289
294 public void setDLFileEntryService(DLFileEntryService dlFileEntryService) {
295 this.dlFileEntryService = dlFileEntryService;
296 }
297
298
303 public DLFileEntryPersistence getDLFileEntryPersistence() {
304 return dlFileEntryPersistence;
305 }
306
307
312 public void setDLFileEntryPersistence(
313 DLFileEntryPersistence dlFileEntryPersistence) {
314 this.dlFileEntryPersistence = dlFileEntryPersistence;
315 }
316
317
322 public DLFileEntryFinder getDLFileEntryFinder() {
323 return dlFileEntryFinder;
324 }
325
326
331 public void setDLFileEntryFinder(DLFileEntryFinder dlFileEntryFinder) {
332 this.dlFileEntryFinder = dlFileEntryFinder;
333 }
334
335
340 public DLFileRankLocalService getDLFileRankLocalService() {
341 return dlFileRankLocalService;
342 }
343
344
349 public void setDLFileRankLocalService(
350 DLFileRankLocalService dlFileRankLocalService) {
351 this.dlFileRankLocalService = dlFileRankLocalService;
352 }
353
354
359 public DLFileRankPersistence getDLFileRankPersistence() {
360 return dlFileRankPersistence;
361 }
362
363
368 public void setDLFileRankPersistence(
369 DLFileRankPersistence dlFileRankPersistence) {
370 this.dlFileRankPersistence = dlFileRankPersistence;
371 }
372
373
378 public DLFileShortcutLocalService getDLFileShortcutLocalService() {
379 return dlFileShortcutLocalService;
380 }
381
382
387 public void setDLFileShortcutLocalService(
388 DLFileShortcutLocalService dlFileShortcutLocalService) {
389 this.dlFileShortcutLocalService = dlFileShortcutLocalService;
390 }
391
392
397 public DLFileShortcutService getDLFileShortcutService() {
398 return dlFileShortcutService;
399 }
400
401
406 public void setDLFileShortcutService(
407 DLFileShortcutService dlFileShortcutService) {
408 this.dlFileShortcutService = dlFileShortcutService;
409 }
410
411
416 public DLFileShortcutPersistence getDLFileShortcutPersistence() {
417 return dlFileShortcutPersistence;
418 }
419
420
425 public void setDLFileShortcutPersistence(
426 DLFileShortcutPersistence dlFileShortcutPersistence) {
427 this.dlFileShortcutPersistence = dlFileShortcutPersistence;
428 }
429
430
435 public DLFileVersionLocalService getDLFileVersionLocalService() {
436 return dlFileVersionLocalService;
437 }
438
439
444 public void setDLFileVersionLocalService(
445 DLFileVersionLocalService dlFileVersionLocalService) {
446 this.dlFileVersionLocalService = dlFileVersionLocalService;
447 }
448
449
454 public DLFileVersionService getDLFileVersionService() {
455 return dlFileVersionService;
456 }
457
458
463 public void setDLFileVersionService(
464 DLFileVersionService dlFileVersionService) {
465 this.dlFileVersionService = dlFileVersionService;
466 }
467
468
473 public DLFileVersionPersistence getDLFileVersionPersistence() {
474 return dlFileVersionPersistence;
475 }
476
477
482 public void setDLFileVersionPersistence(
483 DLFileVersionPersistence dlFileVersionPersistence) {
484 this.dlFileVersionPersistence = dlFileVersionPersistence;
485 }
486
487
492 public DLFolderLocalService getDLFolderLocalService() {
493 return dlFolderLocalService;
494 }
495
496
501 public void setDLFolderLocalService(
502 DLFolderLocalService dlFolderLocalService) {
503 this.dlFolderLocalService = dlFolderLocalService;
504 }
505
506
511 public DLFolderService getDLFolderService() {
512 return dlFolderService;
513 }
514
515
520 public void setDLFolderService(DLFolderService dlFolderService) {
521 this.dlFolderService = dlFolderService;
522 }
523
524
529 public DLFolderPersistence getDLFolderPersistence() {
530 return dlFolderPersistence;
531 }
532
533
538 public void setDLFolderPersistence(DLFolderPersistence dlFolderPersistence) {
539 this.dlFolderPersistence = dlFolderPersistence;
540 }
541
542
547 public DLFolderFinder getDLFolderFinder() {
548 return dlFolderFinder;
549 }
550
551
556 public void setDLFolderFinder(DLFolderFinder dlFolderFinder) {
557 this.dlFolderFinder = dlFolderFinder;
558 }
559
560
565 public CounterLocalService getCounterLocalService() {
566 return counterLocalService;
567 }
568
569
574 public void setCounterLocalService(CounterLocalService counterLocalService) {
575 this.counterLocalService = counterLocalService;
576 }
577
578
583 public ResourceLocalService getResourceLocalService() {
584 return resourceLocalService;
585 }
586
587
592 public void setResourceLocalService(
593 ResourceLocalService resourceLocalService) {
594 this.resourceLocalService = resourceLocalService;
595 }
596
597
602 public ResourceService getResourceService() {
603 return resourceService;
604 }
605
606
611 public void setResourceService(ResourceService resourceService) {
612 this.resourceService = resourceService;
613 }
614
615
620 public ResourcePersistence getResourcePersistence() {
621 return resourcePersistence;
622 }
623
624
629 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
630 this.resourcePersistence = resourcePersistence;
631 }
632
633
638 public ResourceFinder getResourceFinder() {
639 return resourceFinder;
640 }
641
642
647 public void setResourceFinder(ResourceFinder resourceFinder) {
648 this.resourceFinder = resourceFinder;
649 }
650
651
656 public UserLocalService getUserLocalService() {
657 return userLocalService;
658 }
659
660
665 public void setUserLocalService(UserLocalService userLocalService) {
666 this.userLocalService = userLocalService;
667 }
668
669
674 public UserService getUserService() {
675 return userService;
676 }
677
678
683 public void setUserService(UserService userService) {
684 this.userService = userService;
685 }
686
687
692 public UserPersistence getUserPersistence() {
693 return userPersistence;
694 }
695
696
701 public void setUserPersistence(UserPersistence userPersistence) {
702 this.userPersistence = userPersistence;
703 }
704
705
710 public UserFinder getUserFinder() {
711 return userFinder;
712 }
713
714
719 public void setUserFinder(UserFinder userFinder) {
720 this.userFinder = userFinder;
721 }
722
723
728 public AssetEntryLocalService getAssetEntryLocalService() {
729 return assetEntryLocalService;
730 }
731
732
737 public void setAssetEntryLocalService(
738 AssetEntryLocalService assetEntryLocalService) {
739 this.assetEntryLocalService = assetEntryLocalService;
740 }
741
742
747 public AssetEntryService getAssetEntryService() {
748 return assetEntryService;
749 }
750
751
756 public void setAssetEntryService(AssetEntryService assetEntryService) {
757 this.assetEntryService = assetEntryService;
758 }
759
760
765 public AssetEntryPersistence getAssetEntryPersistence() {
766 return assetEntryPersistence;
767 }
768
769
774 public void setAssetEntryPersistence(
775 AssetEntryPersistence assetEntryPersistence) {
776 this.assetEntryPersistence = assetEntryPersistence;
777 }
778
779
784 public AssetEntryFinder getAssetEntryFinder() {
785 return assetEntryFinder;
786 }
787
788
793 public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
794 this.assetEntryFinder = assetEntryFinder;
795 }
796
797
802 protected void runSQL(String sql) throws SystemException {
803 try {
804 DataSource dataSource = dlFileVersionPersistence.getDataSource();
805
806 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
807 sql, new int[0]);
808
809 sqlUpdate.update();
810 }
811 catch (Exception e) {
812 throw new SystemException(e);
813 }
814 }
815
816 @BeanReference(type = DLFileEntryLocalService.class)
817 protected DLFileEntryLocalService dlFileEntryLocalService;
818 @BeanReference(type = DLFileEntryService.class)
819 protected DLFileEntryService dlFileEntryService;
820 @BeanReference(type = DLFileEntryPersistence.class)
821 protected DLFileEntryPersistence dlFileEntryPersistence;
822 @BeanReference(type = DLFileEntryFinder.class)
823 protected DLFileEntryFinder dlFileEntryFinder;
824 @BeanReference(type = DLFileRankLocalService.class)
825 protected DLFileRankLocalService dlFileRankLocalService;
826 @BeanReference(type = DLFileRankPersistence.class)
827 protected DLFileRankPersistence dlFileRankPersistence;
828 @BeanReference(type = DLFileShortcutLocalService.class)
829 protected DLFileShortcutLocalService dlFileShortcutLocalService;
830 @BeanReference(type = DLFileShortcutService.class)
831 protected DLFileShortcutService dlFileShortcutService;
832 @BeanReference(type = DLFileShortcutPersistence.class)
833 protected DLFileShortcutPersistence dlFileShortcutPersistence;
834 @BeanReference(type = DLFileVersionLocalService.class)
835 protected DLFileVersionLocalService dlFileVersionLocalService;
836 @BeanReference(type = DLFileVersionService.class)
837 protected DLFileVersionService dlFileVersionService;
838 @BeanReference(type = DLFileVersionPersistence.class)
839 protected DLFileVersionPersistence dlFileVersionPersistence;
840 @BeanReference(type = DLFolderLocalService.class)
841 protected DLFolderLocalService dlFolderLocalService;
842 @BeanReference(type = DLFolderService.class)
843 protected DLFolderService dlFolderService;
844 @BeanReference(type = DLFolderPersistence.class)
845 protected DLFolderPersistence dlFolderPersistence;
846 @BeanReference(type = DLFolderFinder.class)
847 protected DLFolderFinder dlFolderFinder;
848 @BeanReference(type = CounterLocalService.class)
849 protected CounterLocalService counterLocalService;
850 @BeanReference(type = ResourceLocalService.class)
851 protected ResourceLocalService resourceLocalService;
852 @BeanReference(type = ResourceService.class)
853 protected ResourceService resourceService;
854 @BeanReference(type = ResourcePersistence.class)
855 protected ResourcePersistence resourcePersistence;
856 @BeanReference(type = ResourceFinder.class)
857 protected ResourceFinder resourceFinder;
858 @BeanReference(type = UserLocalService.class)
859 protected UserLocalService userLocalService;
860 @BeanReference(type = UserService.class)
861 protected UserService userService;
862 @BeanReference(type = UserPersistence.class)
863 protected UserPersistence userPersistence;
864 @BeanReference(type = UserFinder.class)
865 protected UserFinder userFinder;
866 @BeanReference(type = AssetEntryLocalService.class)
867 protected AssetEntryLocalService assetEntryLocalService;
868 @BeanReference(type = AssetEntryService.class)
869 protected AssetEntryService assetEntryService;
870 @BeanReference(type = AssetEntryPersistence.class)
871 protected AssetEntryPersistence assetEntryPersistence;
872 @BeanReference(type = AssetEntryFinder.class)
873 protected AssetEntryFinder assetEntryFinder;
874 }