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.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.GroupLocalService;
027 import com.liferay.portal.service.GroupService;
028 import com.liferay.portal.service.ResourceLocalService;
029 import com.liferay.portal.service.ResourceService;
030 import com.liferay.portal.service.SubscriptionLocalService;
031 import com.liferay.portal.service.UserLocalService;
032 import com.liferay.portal.service.UserService;
033 import com.liferay.portal.service.persistence.GroupFinder;
034 import com.liferay.portal.service.persistence.GroupPersistence;
035 import com.liferay.portal.service.persistence.ResourceFinder;
036 import com.liferay.portal.service.persistence.ResourcePersistence;
037 import com.liferay.portal.service.persistence.SubscriptionPersistence;
038 import com.liferay.portal.service.persistence.UserFinder;
039 import com.liferay.portal.service.persistence.UserPersistence;
040
041 import com.liferay.portlet.wiki.model.WikiNode;
042 import com.liferay.portlet.wiki.service.WikiNodeLocalService;
043 import com.liferay.portlet.wiki.service.WikiNodeService;
044 import com.liferay.portlet.wiki.service.WikiPageLocalService;
045 import com.liferay.portlet.wiki.service.WikiPageResourceLocalService;
046 import com.liferay.portlet.wiki.service.WikiPageService;
047 import com.liferay.portlet.wiki.service.persistence.WikiNodePersistence;
048 import com.liferay.portlet.wiki.service.persistence.WikiPageFinder;
049 import com.liferay.portlet.wiki.service.persistence.WikiPagePersistence;
050 import com.liferay.portlet.wiki.service.persistence.WikiPageResourcePersistence;
051
052 import java.util.List;
053
054 import javax.sql.DataSource;
055
056
072 public abstract class WikiNodeLocalServiceBaseImpl
073 implements WikiNodeLocalService {
074
081 public WikiNode addWikiNode(WikiNode wikiNode) throws SystemException {
082 wikiNode.setNew(true);
083
084 return wikiNodePersistence.update(wikiNode, false);
085 }
086
087
093 public WikiNode createWikiNode(long nodeId) {
094 return wikiNodePersistence.create(nodeId);
095 }
096
097
104 public void deleteWikiNode(long nodeId)
105 throws PortalException, SystemException {
106 wikiNodePersistence.remove(nodeId);
107 }
108
109
115 public void deleteWikiNode(WikiNode wikiNode) throws SystemException {
116 wikiNodePersistence.remove(wikiNode);
117 }
118
119
126 @SuppressWarnings("rawtypes")
127 public List dynamicQuery(DynamicQuery dynamicQuery)
128 throws SystemException {
129 return wikiNodePersistence.findWithDynamicQuery(dynamicQuery);
130 }
131
132
145 @SuppressWarnings("rawtypes")
146 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
147 throws SystemException {
148 return wikiNodePersistence.findWithDynamicQuery(dynamicQuery, start, end);
149 }
150
151
165 @SuppressWarnings("rawtypes")
166 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
167 OrderByComparator orderByComparator) throws SystemException {
168 return wikiNodePersistence.findWithDynamicQuery(dynamicQuery, start,
169 end, orderByComparator);
170 }
171
172
179 public long dynamicQueryCount(DynamicQuery dynamicQuery)
180 throws SystemException {
181 return wikiNodePersistence.countWithDynamicQuery(dynamicQuery);
182 }
183
184
192 public WikiNode getWikiNode(long nodeId)
193 throws PortalException, SystemException {
194 return wikiNodePersistence.findByPrimaryKey(nodeId);
195 }
196
197
206 public WikiNode getWikiNodeByUuidAndGroupId(String uuid, long groupId)
207 throws PortalException, SystemException {
208 return wikiNodePersistence.findByUUID_G(uuid, groupId);
209 }
210
211
223 public List<WikiNode> getWikiNodes(int start, int end)
224 throws SystemException {
225 return wikiNodePersistence.findAll(start, end);
226 }
227
228
234 public int getWikiNodesCount() throws SystemException {
235 return wikiNodePersistence.countAll();
236 }
237
238
245 public WikiNode updateWikiNode(WikiNode wikiNode) throws SystemException {
246 wikiNode.setNew(false);
247
248 return wikiNodePersistence.update(wikiNode, true);
249 }
250
251
259 public WikiNode updateWikiNode(WikiNode wikiNode, boolean merge)
260 throws SystemException {
261 wikiNode.setNew(false);
262
263 return wikiNodePersistence.update(wikiNode, merge);
264 }
265
266
271 public WikiNodeLocalService getWikiNodeLocalService() {
272 return wikiNodeLocalService;
273 }
274
275
280 public void setWikiNodeLocalService(
281 WikiNodeLocalService wikiNodeLocalService) {
282 this.wikiNodeLocalService = wikiNodeLocalService;
283 }
284
285
290 public WikiNodeService getWikiNodeService() {
291 return wikiNodeService;
292 }
293
294
299 public void setWikiNodeService(WikiNodeService wikiNodeService) {
300 this.wikiNodeService = wikiNodeService;
301 }
302
303
308 public WikiNodePersistence getWikiNodePersistence() {
309 return wikiNodePersistence;
310 }
311
312
317 public void setWikiNodePersistence(WikiNodePersistence wikiNodePersistence) {
318 this.wikiNodePersistence = wikiNodePersistence;
319 }
320
321
326 public WikiPageLocalService getWikiPageLocalService() {
327 return wikiPageLocalService;
328 }
329
330
335 public void setWikiPageLocalService(
336 WikiPageLocalService wikiPageLocalService) {
337 this.wikiPageLocalService = wikiPageLocalService;
338 }
339
340
345 public WikiPageService getWikiPageService() {
346 return wikiPageService;
347 }
348
349
354 public void setWikiPageService(WikiPageService wikiPageService) {
355 this.wikiPageService = wikiPageService;
356 }
357
358
363 public WikiPagePersistence getWikiPagePersistence() {
364 return wikiPagePersistence;
365 }
366
367
372 public void setWikiPagePersistence(WikiPagePersistence wikiPagePersistence) {
373 this.wikiPagePersistence = wikiPagePersistence;
374 }
375
376
381 public WikiPageFinder getWikiPageFinder() {
382 return wikiPageFinder;
383 }
384
385
390 public void setWikiPageFinder(WikiPageFinder wikiPageFinder) {
391 this.wikiPageFinder = wikiPageFinder;
392 }
393
394
399 public WikiPageResourceLocalService getWikiPageResourceLocalService() {
400 return wikiPageResourceLocalService;
401 }
402
403
408 public void setWikiPageResourceLocalService(
409 WikiPageResourceLocalService wikiPageResourceLocalService) {
410 this.wikiPageResourceLocalService = wikiPageResourceLocalService;
411 }
412
413
418 public WikiPageResourcePersistence getWikiPageResourcePersistence() {
419 return wikiPageResourcePersistence;
420 }
421
422
427 public void setWikiPageResourcePersistence(
428 WikiPageResourcePersistence wikiPageResourcePersistence) {
429 this.wikiPageResourcePersistence = wikiPageResourcePersistence;
430 }
431
432
437 public CounterLocalService getCounterLocalService() {
438 return counterLocalService;
439 }
440
441
446 public void setCounterLocalService(CounterLocalService counterLocalService) {
447 this.counterLocalService = counterLocalService;
448 }
449
450
455 public GroupLocalService getGroupLocalService() {
456 return groupLocalService;
457 }
458
459
464 public void setGroupLocalService(GroupLocalService groupLocalService) {
465 this.groupLocalService = groupLocalService;
466 }
467
468
473 public GroupService getGroupService() {
474 return groupService;
475 }
476
477
482 public void setGroupService(GroupService groupService) {
483 this.groupService = groupService;
484 }
485
486
491 public GroupPersistence getGroupPersistence() {
492 return groupPersistence;
493 }
494
495
500 public void setGroupPersistence(GroupPersistence groupPersistence) {
501 this.groupPersistence = groupPersistence;
502 }
503
504
509 public GroupFinder getGroupFinder() {
510 return groupFinder;
511 }
512
513
518 public void setGroupFinder(GroupFinder groupFinder) {
519 this.groupFinder = groupFinder;
520 }
521
522
527 public ResourceLocalService getResourceLocalService() {
528 return resourceLocalService;
529 }
530
531
536 public void setResourceLocalService(
537 ResourceLocalService resourceLocalService) {
538 this.resourceLocalService = resourceLocalService;
539 }
540
541
546 public ResourceService getResourceService() {
547 return resourceService;
548 }
549
550
555 public void setResourceService(ResourceService resourceService) {
556 this.resourceService = resourceService;
557 }
558
559
564 public ResourcePersistence getResourcePersistence() {
565 return resourcePersistence;
566 }
567
568
573 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
574 this.resourcePersistence = resourcePersistence;
575 }
576
577
582 public ResourceFinder getResourceFinder() {
583 return resourceFinder;
584 }
585
586
591 public void setResourceFinder(ResourceFinder resourceFinder) {
592 this.resourceFinder = resourceFinder;
593 }
594
595
600 public SubscriptionLocalService getSubscriptionLocalService() {
601 return subscriptionLocalService;
602 }
603
604
609 public void setSubscriptionLocalService(
610 SubscriptionLocalService subscriptionLocalService) {
611 this.subscriptionLocalService = subscriptionLocalService;
612 }
613
614
619 public SubscriptionPersistence getSubscriptionPersistence() {
620 return subscriptionPersistence;
621 }
622
623
628 public void setSubscriptionPersistence(
629 SubscriptionPersistence subscriptionPersistence) {
630 this.subscriptionPersistence = subscriptionPersistence;
631 }
632
633
638 public UserLocalService getUserLocalService() {
639 return userLocalService;
640 }
641
642
647 public void setUserLocalService(UserLocalService userLocalService) {
648 this.userLocalService = userLocalService;
649 }
650
651
656 public UserService getUserService() {
657 return userService;
658 }
659
660
665 public void setUserService(UserService userService) {
666 this.userService = userService;
667 }
668
669
674 public UserPersistence getUserPersistence() {
675 return userPersistence;
676 }
677
678
683 public void setUserPersistence(UserPersistence userPersistence) {
684 this.userPersistence = userPersistence;
685 }
686
687
692 public UserFinder getUserFinder() {
693 return userFinder;
694 }
695
696
701 public void setUserFinder(UserFinder userFinder) {
702 this.userFinder = userFinder;
703 }
704
705
710 protected void runSQL(String sql) throws SystemException {
711 try {
712 DataSource dataSource = wikiNodePersistence.getDataSource();
713
714 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
715 sql, new int[0]);
716
717 sqlUpdate.update();
718 }
719 catch (Exception e) {
720 throw new SystemException(e);
721 }
722 }
723
724 @BeanReference(type = WikiNodeLocalService.class)
725 protected WikiNodeLocalService wikiNodeLocalService;
726 @BeanReference(type = WikiNodeService.class)
727 protected WikiNodeService wikiNodeService;
728 @BeanReference(type = WikiNodePersistence.class)
729 protected WikiNodePersistence wikiNodePersistence;
730 @BeanReference(type = WikiPageLocalService.class)
731 protected WikiPageLocalService wikiPageLocalService;
732 @BeanReference(type = WikiPageService.class)
733 protected WikiPageService wikiPageService;
734 @BeanReference(type = WikiPagePersistence.class)
735 protected WikiPagePersistence wikiPagePersistence;
736 @BeanReference(type = WikiPageFinder.class)
737 protected WikiPageFinder wikiPageFinder;
738 @BeanReference(type = WikiPageResourceLocalService.class)
739 protected WikiPageResourceLocalService wikiPageResourceLocalService;
740 @BeanReference(type = WikiPageResourcePersistence.class)
741 protected WikiPageResourcePersistence wikiPageResourcePersistence;
742 @BeanReference(type = CounterLocalService.class)
743 protected CounterLocalService counterLocalService;
744 @BeanReference(type = GroupLocalService.class)
745 protected GroupLocalService groupLocalService;
746 @BeanReference(type = GroupService.class)
747 protected GroupService groupService;
748 @BeanReference(type = GroupPersistence.class)
749 protected GroupPersistence groupPersistence;
750 @BeanReference(type = GroupFinder.class)
751 protected GroupFinder groupFinder;
752 @BeanReference(type = ResourceLocalService.class)
753 protected ResourceLocalService resourceLocalService;
754 @BeanReference(type = ResourceService.class)
755 protected ResourceService resourceService;
756 @BeanReference(type = ResourcePersistence.class)
757 protected ResourcePersistence resourcePersistence;
758 @BeanReference(type = ResourceFinder.class)
759 protected ResourceFinder resourceFinder;
760 @BeanReference(type = SubscriptionLocalService.class)
761 protected SubscriptionLocalService subscriptionLocalService;
762 @BeanReference(type = SubscriptionPersistence.class)
763 protected SubscriptionPersistence subscriptionPersistence;
764 @BeanReference(type = UserLocalService.class)
765 protected UserLocalService userLocalService;
766 @BeanReference(type = UserService.class)
767 protected UserService userService;
768 @BeanReference(type = UserPersistence.class)
769 protected UserPersistence userPersistence;
770 @BeanReference(type = UserFinder.class)
771 protected UserFinder userFinder;
772 }