001
014
015 package com.liferay.portlet.bookmarks.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.asset.service.AssetEntryLocalService;
044 import com.liferay.portlet.asset.service.AssetEntryService;
045 import com.liferay.portlet.asset.service.AssetLinkLocalService;
046 import com.liferay.portlet.asset.service.AssetTagLocalService;
047 import com.liferay.portlet.asset.service.AssetTagService;
048 import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
049 import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
050 import com.liferay.portlet.asset.service.persistence.AssetLinkPersistence;
051 import com.liferay.portlet.asset.service.persistence.AssetTagFinder;
052 import com.liferay.portlet.asset.service.persistence.AssetTagPersistence;
053 import com.liferay.portlet.bookmarks.model.BookmarksEntry;
054 import com.liferay.portlet.bookmarks.service.BookmarksEntryLocalService;
055 import com.liferay.portlet.bookmarks.service.BookmarksEntryService;
056 import com.liferay.portlet.bookmarks.service.BookmarksFolderLocalService;
057 import com.liferay.portlet.bookmarks.service.BookmarksFolderService;
058 import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryFinder;
059 import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryPersistence;
060 import com.liferay.portlet.bookmarks.service.persistence.BookmarksFolderPersistence;
061 import com.liferay.portlet.expando.service.ExpandoValueLocalService;
062 import com.liferay.portlet.expando.service.ExpandoValueService;
063 import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
064 import com.liferay.portlet.social.service.SocialActivityLocalService;
065 import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
066 import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
067
068 import java.io.Serializable;
069
070 import java.util.List;
071
072 import javax.sql.DataSource;
073
074
086 public abstract class BookmarksEntryLocalServiceBaseImpl
087 implements BookmarksEntryLocalService, IdentifiableBean {
088
093
094
101 public BookmarksEntry addBookmarksEntry(BookmarksEntry bookmarksEntry)
102 throws SystemException {
103 bookmarksEntry.setNew(true);
104
105 bookmarksEntry = bookmarksEntryPersistence.update(bookmarksEntry, false);
106
107 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
108
109 if (indexer != null) {
110 try {
111 indexer.reindex(bookmarksEntry);
112 }
113 catch (SearchException se) {
114 if (_log.isWarnEnabled()) {
115 _log.warn(se, se);
116 }
117 }
118 }
119
120 return bookmarksEntry;
121 }
122
123
129 public BookmarksEntry createBookmarksEntry(long entryId) {
130 return bookmarksEntryPersistence.create(entryId);
131 }
132
133
140 public void deleteBookmarksEntry(long entryId)
141 throws PortalException, SystemException {
142 BookmarksEntry bookmarksEntry = bookmarksEntryPersistence.remove(entryId);
143
144 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
145
146 if (indexer != null) {
147 try {
148 indexer.delete(bookmarksEntry);
149 }
150 catch (SearchException se) {
151 if (_log.isWarnEnabled()) {
152 _log.warn(se, se);
153 }
154 }
155 }
156 }
157
158
164 public void deleteBookmarksEntry(BookmarksEntry bookmarksEntry)
165 throws SystemException {
166 bookmarksEntryPersistence.remove(bookmarksEntry);
167
168 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
169
170 if (indexer != null) {
171 try {
172 indexer.delete(bookmarksEntry);
173 }
174 catch (SearchException se) {
175 if (_log.isWarnEnabled()) {
176 _log.warn(se, se);
177 }
178 }
179 }
180 }
181
182
189 @SuppressWarnings("rawtypes")
190 public List dynamicQuery(DynamicQuery dynamicQuery)
191 throws SystemException {
192 return bookmarksEntryPersistence.findWithDynamicQuery(dynamicQuery);
193 }
194
195
208 @SuppressWarnings("rawtypes")
209 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
210 throws SystemException {
211 return bookmarksEntryPersistence.findWithDynamicQuery(dynamicQuery,
212 start, end);
213 }
214
215
229 @SuppressWarnings("rawtypes")
230 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
231 OrderByComparator orderByComparator) throws SystemException {
232 return bookmarksEntryPersistence.findWithDynamicQuery(dynamicQuery,
233 start, end, orderByComparator);
234 }
235
236
243 public long dynamicQueryCount(DynamicQuery dynamicQuery)
244 throws SystemException {
245 return bookmarksEntryPersistence.countWithDynamicQuery(dynamicQuery);
246 }
247
248 public BookmarksEntry fetchBookmarksEntry(long entryId)
249 throws SystemException {
250 return bookmarksEntryPersistence.fetchByPrimaryKey(entryId);
251 }
252
253
261 public BookmarksEntry getBookmarksEntry(long entryId)
262 throws PortalException, SystemException {
263 return bookmarksEntryPersistence.findByPrimaryKey(entryId);
264 }
265
266 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
267 throws PortalException, SystemException {
268 return bookmarksEntryPersistence.findByPrimaryKey(primaryKeyObj);
269 }
270
271
280 public BookmarksEntry getBookmarksEntryByUuidAndGroupId(String uuid,
281 long groupId) throws PortalException, SystemException {
282 return bookmarksEntryPersistence.findByUUID_G(uuid, groupId);
283 }
284
285
297 public List<BookmarksEntry> getBookmarksEntries(int start, int end)
298 throws SystemException {
299 return bookmarksEntryPersistence.findAll(start, end);
300 }
301
302
308 public int getBookmarksEntriesCount() throws SystemException {
309 return bookmarksEntryPersistence.countAll();
310 }
311
312
319 public BookmarksEntry updateBookmarksEntry(BookmarksEntry bookmarksEntry)
320 throws SystemException {
321 return updateBookmarksEntry(bookmarksEntry, true);
322 }
323
324
332 public BookmarksEntry updateBookmarksEntry(BookmarksEntry bookmarksEntry,
333 boolean merge) throws SystemException {
334 bookmarksEntry.setNew(false);
335
336 bookmarksEntry = bookmarksEntryPersistence.update(bookmarksEntry, merge);
337
338 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
339
340 if (indexer != null) {
341 try {
342 indexer.reindex(bookmarksEntry);
343 }
344 catch (SearchException se) {
345 if (_log.isWarnEnabled()) {
346 _log.warn(se, se);
347 }
348 }
349 }
350
351 return bookmarksEntry;
352 }
353
354
359 public BookmarksEntryLocalService getBookmarksEntryLocalService() {
360 return bookmarksEntryLocalService;
361 }
362
363
368 public void setBookmarksEntryLocalService(
369 BookmarksEntryLocalService bookmarksEntryLocalService) {
370 this.bookmarksEntryLocalService = bookmarksEntryLocalService;
371 }
372
373
378 public BookmarksEntryService getBookmarksEntryService() {
379 return bookmarksEntryService;
380 }
381
382
387 public void setBookmarksEntryService(
388 BookmarksEntryService bookmarksEntryService) {
389 this.bookmarksEntryService = bookmarksEntryService;
390 }
391
392
397 public BookmarksEntryPersistence getBookmarksEntryPersistence() {
398 return bookmarksEntryPersistence;
399 }
400
401
406 public void setBookmarksEntryPersistence(
407 BookmarksEntryPersistence bookmarksEntryPersistence) {
408 this.bookmarksEntryPersistence = bookmarksEntryPersistence;
409 }
410
411
416 public BookmarksEntryFinder getBookmarksEntryFinder() {
417 return bookmarksEntryFinder;
418 }
419
420
425 public void setBookmarksEntryFinder(
426 BookmarksEntryFinder bookmarksEntryFinder) {
427 this.bookmarksEntryFinder = bookmarksEntryFinder;
428 }
429
430
435 public BookmarksFolderLocalService getBookmarksFolderLocalService() {
436 return bookmarksFolderLocalService;
437 }
438
439
444 public void setBookmarksFolderLocalService(
445 BookmarksFolderLocalService bookmarksFolderLocalService) {
446 this.bookmarksFolderLocalService = bookmarksFolderLocalService;
447 }
448
449
454 public BookmarksFolderService getBookmarksFolderService() {
455 return bookmarksFolderService;
456 }
457
458
463 public void setBookmarksFolderService(
464 BookmarksFolderService bookmarksFolderService) {
465 this.bookmarksFolderService = bookmarksFolderService;
466 }
467
468
473 public BookmarksFolderPersistence getBookmarksFolderPersistence() {
474 return bookmarksFolderPersistence;
475 }
476
477
482 public void setBookmarksFolderPersistence(
483 BookmarksFolderPersistence bookmarksFolderPersistence) {
484 this.bookmarksFolderPersistence = bookmarksFolderPersistence;
485 }
486
487
492 public CounterLocalService getCounterLocalService() {
493 return counterLocalService;
494 }
495
496
501 public void setCounterLocalService(CounterLocalService counterLocalService) {
502 this.counterLocalService = counterLocalService;
503 }
504
505
510 public ResourceLocalService getResourceLocalService() {
511 return resourceLocalService;
512 }
513
514
519 public void setResourceLocalService(
520 ResourceLocalService resourceLocalService) {
521 this.resourceLocalService = resourceLocalService;
522 }
523
524
529 public ResourceService getResourceService() {
530 return resourceService;
531 }
532
533
538 public void setResourceService(ResourceService resourceService) {
539 this.resourceService = resourceService;
540 }
541
542
547 public ResourcePersistence getResourcePersistence() {
548 return resourcePersistence;
549 }
550
551
556 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
557 this.resourcePersistence = resourcePersistence;
558 }
559
560
565 public ResourceFinder getResourceFinder() {
566 return resourceFinder;
567 }
568
569
574 public void setResourceFinder(ResourceFinder resourceFinder) {
575 this.resourceFinder = resourceFinder;
576 }
577
578
583 public UserLocalService getUserLocalService() {
584 return userLocalService;
585 }
586
587
592 public void setUserLocalService(UserLocalService userLocalService) {
593 this.userLocalService = userLocalService;
594 }
595
596
601 public UserService getUserService() {
602 return userService;
603 }
604
605
610 public void setUserService(UserService userService) {
611 this.userService = userService;
612 }
613
614
619 public UserPersistence getUserPersistence() {
620 return userPersistence;
621 }
622
623
628 public void setUserPersistence(UserPersistence userPersistence) {
629 this.userPersistence = userPersistence;
630 }
631
632
637 public UserFinder getUserFinder() {
638 return userFinder;
639 }
640
641
646 public void setUserFinder(UserFinder userFinder) {
647 this.userFinder = userFinder;
648 }
649
650
655 public AssetEntryLocalService getAssetEntryLocalService() {
656 return assetEntryLocalService;
657 }
658
659
664 public void setAssetEntryLocalService(
665 AssetEntryLocalService assetEntryLocalService) {
666 this.assetEntryLocalService = assetEntryLocalService;
667 }
668
669
674 public AssetEntryService getAssetEntryService() {
675 return assetEntryService;
676 }
677
678
683 public void setAssetEntryService(AssetEntryService assetEntryService) {
684 this.assetEntryService = assetEntryService;
685 }
686
687
692 public AssetEntryPersistence getAssetEntryPersistence() {
693 return assetEntryPersistence;
694 }
695
696
701 public void setAssetEntryPersistence(
702 AssetEntryPersistence assetEntryPersistence) {
703 this.assetEntryPersistence = assetEntryPersistence;
704 }
705
706
711 public AssetEntryFinder getAssetEntryFinder() {
712 return assetEntryFinder;
713 }
714
715
720 public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
721 this.assetEntryFinder = assetEntryFinder;
722 }
723
724
729 public AssetLinkLocalService getAssetLinkLocalService() {
730 return assetLinkLocalService;
731 }
732
733
738 public void setAssetLinkLocalService(
739 AssetLinkLocalService assetLinkLocalService) {
740 this.assetLinkLocalService = assetLinkLocalService;
741 }
742
743
748 public AssetLinkPersistence getAssetLinkPersistence() {
749 return assetLinkPersistence;
750 }
751
752
757 public void setAssetLinkPersistence(
758 AssetLinkPersistence assetLinkPersistence) {
759 this.assetLinkPersistence = assetLinkPersistence;
760 }
761
762
767 public AssetTagLocalService getAssetTagLocalService() {
768 return assetTagLocalService;
769 }
770
771
776 public void setAssetTagLocalService(
777 AssetTagLocalService assetTagLocalService) {
778 this.assetTagLocalService = assetTagLocalService;
779 }
780
781
786 public AssetTagService getAssetTagService() {
787 return assetTagService;
788 }
789
790
795 public void setAssetTagService(AssetTagService assetTagService) {
796 this.assetTagService = assetTagService;
797 }
798
799
804 public AssetTagPersistence getAssetTagPersistence() {
805 return assetTagPersistence;
806 }
807
808
813 public void setAssetTagPersistence(AssetTagPersistence assetTagPersistence) {
814 this.assetTagPersistence = assetTagPersistence;
815 }
816
817
822 public AssetTagFinder getAssetTagFinder() {
823 return assetTagFinder;
824 }
825
826
831 public void setAssetTagFinder(AssetTagFinder assetTagFinder) {
832 this.assetTagFinder = assetTagFinder;
833 }
834
835
840 public ExpandoValueLocalService getExpandoValueLocalService() {
841 return expandoValueLocalService;
842 }
843
844
849 public void setExpandoValueLocalService(
850 ExpandoValueLocalService expandoValueLocalService) {
851 this.expandoValueLocalService = expandoValueLocalService;
852 }
853
854
859 public ExpandoValueService getExpandoValueService() {
860 return expandoValueService;
861 }
862
863
868 public void setExpandoValueService(ExpandoValueService expandoValueService) {
869 this.expandoValueService = expandoValueService;
870 }
871
872
877 public ExpandoValuePersistence getExpandoValuePersistence() {
878 return expandoValuePersistence;
879 }
880
881
886 public void setExpandoValuePersistence(
887 ExpandoValuePersistence expandoValuePersistence) {
888 this.expandoValuePersistence = expandoValuePersistence;
889 }
890
891
896 public SocialActivityLocalService getSocialActivityLocalService() {
897 return socialActivityLocalService;
898 }
899
900
905 public void setSocialActivityLocalService(
906 SocialActivityLocalService socialActivityLocalService) {
907 this.socialActivityLocalService = socialActivityLocalService;
908 }
909
910
915 public SocialActivityPersistence getSocialActivityPersistence() {
916 return socialActivityPersistence;
917 }
918
919
924 public void setSocialActivityPersistence(
925 SocialActivityPersistence socialActivityPersistence) {
926 this.socialActivityPersistence = socialActivityPersistence;
927 }
928
929
934 public SocialActivityFinder getSocialActivityFinder() {
935 return socialActivityFinder;
936 }
937
938
943 public void setSocialActivityFinder(
944 SocialActivityFinder socialActivityFinder) {
945 this.socialActivityFinder = socialActivityFinder;
946 }
947
948 public void afterPropertiesSet() {
949 persistedModelLocalServiceRegistry.register("com.liferay.portlet.bookmarks.model.BookmarksEntry",
950 bookmarksEntryLocalService);
951 }
952
953 public void destroy() {
954 persistedModelLocalServiceRegistry.unregister(
955 "com.liferay.portlet.bookmarks.model.BookmarksEntry");
956 }
957
958
963 public String getBeanIdentifier() {
964 return _beanIdentifier;
965 }
966
967
972 public void setBeanIdentifier(String beanIdentifier) {
973 _beanIdentifier = beanIdentifier;
974 }
975
976 protected ClassLoader getClassLoader() {
977 Class<?> clazz = getClass();
978
979 return clazz.getClassLoader();
980 }
981
982 protected Class<?> getModelClass() {
983 return BookmarksEntry.class;
984 }
985
986 protected String getModelClassName() {
987 return BookmarksEntry.class.getName();
988 }
989
990
995 protected void runSQL(String sql) throws SystemException {
996 try {
997 DataSource dataSource = bookmarksEntryPersistence.getDataSource();
998
999 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
1000 sql, new int[0]);
1001
1002 sqlUpdate.update();
1003 }
1004 catch (Exception e) {
1005 throw new SystemException(e);
1006 }
1007 }
1008
1009 @BeanReference(type = BookmarksEntryLocalService.class)
1010 protected BookmarksEntryLocalService bookmarksEntryLocalService;
1011 @BeanReference(type = BookmarksEntryService.class)
1012 protected BookmarksEntryService bookmarksEntryService;
1013 @BeanReference(type = BookmarksEntryPersistence.class)
1014 protected BookmarksEntryPersistence bookmarksEntryPersistence;
1015 @BeanReference(type = BookmarksEntryFinder.class)
1016 protected BookmarksEntryFinder bookmarksEntryFinder;
1017 @BeanReference(type = BookmarksFolderLocalService.class)
1018 protected BookmarksFolderLocalService bookmarksFolderLocalService;
1019 @BeanReference(type = BookmarksFolderService.class)
1020 protected BookmarksFolderService bookmarksFolderService;
1021 @BeanReference(type = BookmarksFolderPersistence.class)
1022 protected BookmarksFolderPersistence bookmarksFolderPersistence;
1023 @BeanReference(type = CounterLocalService.class)
1024 protected CounterLocalService counterLocalService;
1025 @BeanReference(type = ResourceLocalService.class)
1026 protected ResourceLocalService resourceLocalService;
1027 @BeanReference(type = ResourceService.class)
1028 protected ResourceService resourceService;
1029 @BeanReference(type = ResourcePersistence.class)
1030 protected ResourcePersistence resourcePersistence;
1031 @BeanReference(type = ResourceFinder.class)
1032 protected ResourceFinder resourceFinder;
1033 @BeanReference(type = UserLocalService.class)
1034 protected UserLocalService userLocalService;
1035 @BeanReference(type = UserService.class)
1036 protected UserService userService;
1037 @BeanReference(type = UserPersistence.class)
1038 protected UserPersistence userPersistence;
1039 @BeanReference(type = UserFinder.class)
1040 protected UserFinder userFinder;
1041 @BeanReference(type = AssetEntryLocalService.class)
1042 protected AssetEntryLocalService assetEntryLocalService;
1043 @BeanReference(type = AssetEntryService.class)
1044 protected AssetEntryService assetEntryService;
1045 @BeanReference(type = AssetEntryPersistence.class)
1046 protected AssetEntryPersistence assetEntryPersistence;
1047 @BeanReference(type = AssetEntryFinder.class)
1048 protected AssetEntryFinder assetEntryFinder;
1049 @BeanReference(type = AssetLinkLocalService.class)
1050 protected AssetLinkLocalService assetLinkLocalService;
1051 @BeanReference(type = AssetLinkPersistence.class)
1052 protected AssetLinkPersistence assetLinkPersistence;
1053 @BeanReference(type = AssetTagLocalService.class)
1054 protected AssetTagLocalService assetTagLocalService;
1055 @BeanReference(type = AssetTagService.class)
1056 protected AssetTagService assetTagService;
1057 @BeanReference(type = AssetTagPersistence.class)
1058 protected AssetTagPersistence assetTagPersistence;
1059 @BeanReference(type = AssetTagFinder.class)
1060 protected AssetTagFinder assetTagFinder;
1061 @BeanReference(type = ExpandoValueLocalService.class)
1062 protected ExpandoValueLocalService expandoValueLocalService;
1063 @BeanReference(type = ExpandoValueService.class)
1064 protected ExpandoValueService expandoValueService;
1065 @BeanReference(type = ExpandoValuePersistence.class)
1066 protected ExpandoValuePersistence expandoValuePersistence;
1067 @BeanReference(type = SocialActivityLocalService.class)
1068 protected SocialActivityLocalService socialActivityLocalService;
1069 @BeanReference(type = SocialActivityPersistence.class)
1070 protected SocialActivityPersistence socialActivityPersistence;
1071 @BeanReference(type = SocialActivityFinder.class)
1072 protected SocialActivityFinder socialActivityFinder;
1073 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1074 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1075 private static Log _log = LogFactoryUtil.getLog(BookmarksEntryLocalServiceBaseImpl.class);
1076 private String _beanIdentifier;
1077 }