001
014
015 package com.liferay.portlet.wiki.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.PersistedModelLocalServiceRegistry;
035 import com.liferay.portal.service.ResourceLocalService;
036 import com.liferay.portal.service.ResourceService;
037 import com.liferay.portal.service.SubscriptionLocalService;
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.ResourceFinder;
043 import com.liferay.portal.service.persistence.ResourcePersistence;
044 import com.liferay.portal.service.persistence.SubscriptionPersistence;
045 import com.liferay.portal.service.persistence.UserFinder;
046 import com.liferay.portal.service.persistence.UserPersistence;
047
048 import com.liferay.portlet.wiki.model.WikiNode;
049 import com.liferay.portlet.wiki.service.WikiNodeLocalService;
050 import com.liferay.portlet.wiki.service.WikiNodeService;
051 import com.liferay.portlet.wiki.service.WikiPageLocalService;
052 import com.liferay.portlet.wiki.service.WikiPageResourceLocalService;
053 import com.liferay.portlet.wiki.service.WikiPageService;
054 import com.liferay.portlet.wiki.service.persistence.WikiNodePersistence;
055 import com.liferay.portlet.wiki.service.persistence.WikiPageFinder;
056 import com.liferay.portlet.wiki.service.persistence.WikiPagePersistence;
057 import com.liferay.portlet.wiki.service.persistence.WikiPageResourcePersistence;
058
059 import java.io.Serializable;
060
061 import java.util.List;
062
063 import javax.sql.DataSource;
064
065
077 public abstract class WikiNodeLocalServiceBaseImpl extends BaseLocalServiceImpl
078 implements WikiNodeLocalService, IdentifiableBean {
079
084
085
092 @Indexable(type = IndexableType.REINDEX)
093 public WikiNode addWikiNode(WikiNode wikiNode) throws SystemException {
094 wikiNode.setNew(true);
095
096 return wikiNodePersistence.update(wikiNode, false);
097 }
098
099
105 public WikiNode createWikiNode(long nodeId) {
106 return wikiNodePersistence.create(nodeId);
107 }
108
109
117 @Indexable(type = IndexableType.DELETE)
118 public WikiNode deleteWikiNode(long nodeId)
119 throws PortalException, SystemException {
120 return wikiNodePersistence.remove(nodeId);
121 }
122
123
130 @Indexable(type = IndexableType.DELETE)
131 public WikiNode deleteWikiNode(WikiNode wikiNode) throws SystemException {
132 return wikiNodePersistence.remove(wikiNode);
133 }
134
135 public DynamicQuery dynamicQuery() {
136 Class<?> clazz = getClass();
137
138 return DynamicQueryFactoryUtil.forClass(WikiNode.class,
139 clazz.getClassLoader());
140 }
141
142
149 @SuppressWarnings("rawtypes")
150 public List dynamicQuery(DynamicQuery dynamicQuery)
151 throws SystemException {
152 return wikiNodePersistence.findWithDynamicQuery(dynamicQuery);
153 }
154
155
168 @SuppressWarnings("rawtypes")
169 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
170 throws SystemException {
171 return wikiNodePersistence.findWithDynamicQuery(dynamicQuery, start, end);
172 }
173
174
188 @SuppressWarnings("rawtypes")
189 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
190 OrderByComparator orderByComparator) throws SystemException {
191 return wikiNodePersistence.findWithDynamicQuery(dynamicQuery, start,
192 end, orderByComparator);
193 }
194
195
202 public long dynamicQueryCount(DynamicQuery dynamicQuery)
203 throws SystemException {
204 return wikiNodePersistence.countWithDynamicQuery(dynamicQuery);
205 }
206
207 public WikiNode fetchWikiNode(long nodeId) throws SystemException {
208 return wikiNodePersistence.fetchByPrimaryKey(nodeId);
209 }
210
211
219 public WikiNode getWikiNode(long nodeId)
220 throws PortalException, SystemException {
221 return wikiNodePersistence.findByPrimaryKey(nodeId);
222 }
223
224 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
225 throws PortalException, SystemException {
226 return wikiNodePersistence.findByPrimaryKey(primaryKeyObj);
227 }
228
229
238 public WikiNode getWikiNodeByUuidAndGroupId(String uuid, long groupId)
239 throws PortalException, SystemException {
240 return wikiNodePersistence.findByUUID_G(uuid, groupId);
241 }
242
243
255 public List<WikiNode> getWikiNodes(int start, int end)
256 throws SystemException {
257 return wikiNodePersistence.findAll(start, end);
258 }
259
260
266 public int getWikiNodesCount() throws SystemException {
267 return wikiNodePersistence.countAll();
268 }
269
270
277 @Indexable(type = IndexableType.REINDEX)
278 public WikiNode updateWikiNode(WikiNode wikiNode) throws SystemException {
279 return updateWikiNode(wikiNode, true);
280 }
281
282
290 @Indexable(type = IndexableType.REINDEX)
291 public WikiNode updateWikiNode(WikiNode wikiNode, boolean merge)
292 throws SystemException {
293 wikiNode.setNew(false);
294
295 return wikiNodePersistence.update(wikiNode, merge);
296 }
297
298
303 public WikiNodeLocalService getWikiNodeLocalService() {
304 return wikiNodeLocalService;
305 }
306
307
312 public void setWikiNodeLocalService(
313 WikiNodeLocalService wikiNodeLocalService) {
314 this.wikiNodeLocalService = wikiNodeLocalService;
315 }
316
317
322 public WikiNodeService getWikiNodeService() {
323 return wikiNodeService;
324 }
325
326
331 public void setWikiNodeService(WikiNodeService wikiNodeService) {
332 this.wikiNodeService = wikiNodeService;
333 }
334
335
340 public WikiNodePersistence getWikiNodePersistence() {
341 return wikiNodePersistence;
342 }
343
344
349 public void setWikiNodePersistence(WikiNodePersistence wikiNodePersistence) {
350 this.wikiNodePersistence = wikiNodePersistence;
351 }
352
353
358 public WikiPageLocalService getWikiPageLocalService() {
359 return wikiPageLocalService;
360 }
361
362
367 public void setWikiPageLocalService(
368 WikiPageLocalService wikiPageLocalService) {
369 this.wikiPageLocalService = wikiPageLocalService;
370 }
371
372
377 public WikiPageService getWikiPageService() {
378 return wikiPageService;
379 }
380
381
386 public void setWikiPageService(WikiPageService wikiPageService) {
387 this.wikiPageService = wikiPageService;
388 }
389
390
395 public WikiPagePersistence getWikiPagePersistence() {
396 return wikiPagePersistence;
397 }
398
399
404 public void setWikiPagePersistence(WikiPagePersistence wikiPagePersistence) {
405 this.wikiPagePersistence = wikiPagePersistence;
406 }
407
408
413 public WikiPageFinder getWikiPageFinder() {
414 return wikiPageFinder;
415 }
416
417
422 public void setWikiPageFinder(WikiPageFinder wikiPageFinder) {
423 this.wikiPageFinder = wikiPageFinder;
424 }
425
426
431 public WikiPageResourceLocalService getWikiPageResourceLocalService() {
432 return wikiPageResourceLocalService;
433 }
434
435
440 public void setWikiPageResourceLocalService(
441 WikiPageResourceLocalService wikiPageResourceLocalService) {
442 this.wikiPageResourceLocalService = wikiPageResourceLocalService;
443 }
444
445
450 public WikiPageResourcePersistence getWikiPageResourcePersistence() {
451 return wikiPageResourcePersistence;
452 }
453
454
459 public void setWikiPageResourcePersistence(
460 WikiPageResourcePersistence wikiPageResourcePersistence) {
461 this.wikiPageResourcePersistence = wikiPageResourcePersistence;
462 }
463
464
469 public CounterLocalService getCounterLocalService() {
470 return counterLocalService;
471 }
472
473
478 public void setCounterLocalService(CounterLocalService counterLocalService) {
479 this.counterLocalService = counterLocalService;
480 }
481
482
487 public GroupLocalService getGroupLocalService() {
488 return groupLocalService;
489 }
490
491
496 public void setGroupLocalService(GroupLocalService groupLocalService) {
497 this.groupLocalService = groupLocalService;
498 }
499
500
505 public GroupService getGroupService() {
506 return groupService;
507 }
508
509
514 public void setGroupService(GroupService groupService) {
515 this.groupService = groupService;
516 }
517
518
523 public GroupPersistence getGroupPersistence() {
524 return groupPersistence;
525 }
526
527
532 public void setGroupPersistence(GroupPersistence groupPersistence) {
533 this.groupPersistence = groupPersistence;
534 }
535
536
541 public GroupFinder getGroupFinder() {
542 return groupFinder;
543 }
544
545
550 public void setGroupFinder(GroupFinder groupFinder) {
551 this.groupFinder = groupFinder;
552 }
553
554
559 public ResourceLocalService getResourceLocalService() {
560 return resourceLocalService;
561 }
562
563
568 public void setResourceLocalService(
569 ResourceLocalService resourceLocalService) {
570 this.resourceLocalService = resourceLocalService;
571 }
572
573
578 public ResourceService getResourceService() {
579 return resourceService;
580 }
581
582
587 public void setResourceService(ResourceService resourceService) {
588 this.resourceService = resourceService;
589 }
590
591
596 public ResourcePersistence getResourcePersistence() {
597 return resourcePersistence;
598 }
599
600
605 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
606 this.resourcePersistence = resourcePersistence;
607 }
608
609
614 public ResourceFinder getResourceFinder() {
615 return resourceFinder;
616 }
617
618
623 public void setResourceFinder(ResourceFinder resourceFinder) {
624 this.resourceFinder = resourceFinder;
625 }
626
627
632 public SubscriptionLocalService getSubscriptionLocalService() {
633 return subscriptionLocalService;
634 }
635
636
641 public void setSubscriptionLocalService(
642 SubscriptionLocalService subscriptionLocalService) {
643 this.subscriptionLocalService = subscriptionLocalService;
644 }
645
646
651 public SubscriptionPersistence getSubscriptionPersistence() {
652 return subscriptionPersistence;
653 }
654
655
660 public void setSubscriptionPersistence(
661 SubscriptionPersistence subscriptionPersistence) {
662 this.subscriptionPersistence = subscriptionPersistence;
663 }
664
665
670 public UserLocalService getUserLocalService() {
671 return userLocalService;
672 }
673
674
679 public void setUserLocalService(UserLocalService userLocalService) {
680 this.userLocalService = userLocalService;
681 }
682
683
688 public UserService getUserService() {
689 return userService;
690 }
691
692
697 public void setUserService(UserService userService) {
698 this.userService = userService;
699 }
700
701
706 public UserPersistence getUserPersistence() {
707 return userPersistence;
708 }
709
710
715 public void setUserPersistence(UserPersistence userPersistence) {
716 this.userPersistence = userPersistence;
717 }
718
719
724 public UserFinder getUserFinder() {
725 return userFinder;
726 }
727
728
733 public void setUserFinder(UserFinder userFinder) {
734 this.userFinder = userFinder;
735 }
736
737 public void afterPropertiesSet() {
738 persistedModelLocalServiceRegistry.register("com.liferay.portlet.wiki.model.WikiNode",
739 wikiNodeLocalService);
740 }
741
742 public void destroy() {
743 persistedModelLocalServiceRegistry.unregister(
744 "com.liferay.portlet.wiki.model.WikiNode");
745 }
746
747
752 public String getBeanIdentifier() {
753 return _beanIdentifier;
754 }
755
756
761 public void setBeanIdentifier(String beanIdentifier) {
762 _beanIdentifier = beanIdentifier;
763 }
764
765 protected Class<?> getModelClass() {
766 return WikiNode.class;
767 }
768
769 protected String getModelClassName() {
770 return WikiNode.class.getName();
771 }
772
773
778 protected void runSQL(String sql) throws SystemException {
779 try {
780 DataSource dataSource = wikiNodePersistence.getDataSource();
781
782 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
783 sql, new int[0]);
784
785 sqlUpdate.update();
786 }
787 catch (Exception e) {
788 throw new SystemException(e);
789 }
790 }
791
792 @BeanReference(type = WikiNodeLocalService.class)
793 protected WikiNodeLocalService wikiNodeLocalService;
794 @BeanReference(type = WikiNodeService.class)
795 protected WikiNodeService wikiNodeService;
796 @BeanReference(type = WikiNodePersistence.class)
797 protected WikiNodePersistence wikiNodePersistence;
798 @BeanReference(type = WikiPageLocalService.class)
799 protected WikiPageLocalService wikiPageLocalService;
800 @BeanReference(type = WikiPageService.class)
801 protected WikiPageService wikiPageService;
802 @BeanReference(type = WikiPagePersistence.class)
803 protected WikiPagePersistence wikiPagePersistence;
804 @BeanReference(type = WikiPageFinder.class)
805 protected WikiPageFinder wikiPageFinder;
806 @BeanReference(type = WikiPageResourceLocalService.class)
807 protected WikiPageResourceLocalService wikiPageResourceLocalService;
808 @BeanReference(type = WikiPageResourcePersistence.class)
809 protected WikiPageResourcePersistence wikiPageResourcePersistence;
810 @BeanReference(type = CounterLocalService.class)
811 protected CounterLocalService counterLocalService;
812 @BeanReference(type = GroupLocalService.class)
813 protected GroupLocalService groupLocalService;
814 @BeanReference(type = GroupService.class)
815 protected GroupService groupService;
816 @BeanReference(type = GroupPersistence.class)
817 protected GroupPersistence groupPersistence;
818 @BeanReference(type = GroupFinder.class)
819 protected GroupFinder groupFinder;
820 @BeanReference(type = ResourceLocalService.class)
821 protected ResourceLocalService resourceLocalService;
822 @BeanReference(type = ResourceService.class)
823 protected ResourceService resourceService;
824 @BeanReference(type = ResourcePersistence.class)
825 protected ResourcePersistence resourcePersistence;
826 @BeanReference(type = ResourceFinder.class)
827 protected ResourceFinder resourceFinder;
828 @BeanReference(type = SubscriptionLocalService.class)
829 protected SubscriptionLocalService subscriptionLocalService;
830 @BeanReference(type = SubscriptionPersistence.class)
831 protected SubscriptionPersistence subscriptionPersistence;
832 @BeanReference(type = UserLocalService.class)
833 protected UserLocalService userLocalService;
834 @BeanReference(type = UserService.class)
835 protected UserService userService;
836 @BeanReference(type = UserPersistence.class)
837 protected UserPersistence userPersistence;
838 @BeanReference(type = UserFinder.class)
839 protected UserFinder userFinder;
840 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
841 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
842 private String _beanIdentifier;
843 }