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.PersistedModelLocalServiceRegistry;
033 import com.liferay.portal.service.ResourceLocalService;
034 import com.liferay.portal.service.ResourceService;
035 import com.liferay.portal.service.UserLocalService;
036 import com.liferay.portal.service.UserService;
037 import com.liferay.portal.service.persistence.ResourceFinder;
038 import com.liferay.portal.service.persistence.ResourcePersistence;
039 import com.liferay.portal.service.persistence.UserFinder;
040 import com.liferay.portal.service.persistence.UserPersistence;
041
042 import com.liferay.portlet.wiki.model.WikiPageResource;
043 import com.liferay.portlet.wiki.service.WikiNodeLocalService;
044 import com.liferay.portlet.wiki.service.WikiNodeService;
045 import com.liferay.portlet.wiki.service.WikiPageLocalService;
046 import com.liferay.portlet.wiki.service.WikiPageResourceLocalService;
047 import com.liferay.portlet.wiki.service.WikiPageService;
048 import com.liferay.portlet.wiki.service.persistence.WikiNodePersistence;
049 import com.liferay.portlet.wiki.service.persistence.WikiPageFinder;
050 import com.liferay.portlet.wiki.service.persistence.WikiPagePersistence;
051 import com.liferay.portlet.wiki.service.persistence.WikiPageResourcePersistence;
052
053 import java.io.Serializable;
054
055 import java.util.List;
056
057 import javax.sql.DataSource;
058
059
071 public abstract class WikiPageResourceLocalServiceBaseImpl
072 extends BaseLocalServiceImpl implements WikiPageResourceLocalService,
073 IdentifiableBean {
074
079
080
087 @Indexable(type = IndexableType.REINDEX)
088 public WikiPageResource addWikiPageResource(
089 WikiPageResource wikiPageResource) throws SystemException {
090 wikiPageResource.setNew(true);
091
092 return wikiPageResourcePersistence.update(wikiPageResource, false);
093 }
094
095
101 public WikiPageResource createWikiPageResource(long resourcePrimKey) {
102 return wikiPageResourcePersistence.create(resourcePrimKey);
103 }
104
105
113 @Indexable(type = IndexableType.DELETE)
114 public WikiPageResource deleteWikiPageResource(long resourcePrimKey)
115 throws PortalException, SystemException {
116 return wikiPageResourcePersistence.remove(resourcePrimKey);
117 }
118
119
126 @Indexable(type = IndexableType.DELETE)
127 public WikiPageResource deleteWikiPageResource(
128 WikiPageResource wikiPageResource) throws SystemException {
129 return wikiPageResourcePersistence.remove(wikiPageResource);
130 }
131
132 public DynamicQuery dynamicQuery() {
133 Class<?> clazz = getClass();
134
135 return DynamicQueryFactoryUtil.forClass(WikiPageResource.class,
136 clazz.getClassLoader());
137 }
138
139
146 @SuppressWarnings("rawtypes")
147 public List dynamicQuery(DynamicQuery dynamicQuery)
148 throws SystemException {
149 return wikiPageResourcePersistence.findWithDynamicQuery(dynamicQuery);
150 }
151
152
165 @SuppressWarnings("rawtypes")
166 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
167 throws SystemException {
168 return wikiPageResourcePersistence.findWithDynamicQuery(dynamicQuery,
169 start, end);
170 }
171
172
186 @SuppressWarnings("rawtypes")
187 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
188 OrderByComparator orderByComparator) throws SystemException {
189 return wikiPageResourcePersistence.findWithDynamicQuery(dynamicQuery,
190 start, end, orderByComparator);
191 }
192
193
200 public long dynamicQueryCount(DynamicQuery dynamicQuery)
201 throws SystemException {
202 return wikiPageResourcePersistence.countWithDynamicQuery(dynamicQuery);
203 }
204
205 public WikiPageResource fetchWikiPageResource(long resourcePrimKey)
206 throws SystemException {
207 return wikiPageResourcePersistence.fetchByPrimaryKey(resourcePrimKey);
208 }
209
210
218 public WikiPageResource getWikiPageResource(long resourcePrimKey)
219 throws PortalException, SystemException {
220 return wikiPageResourcePersistence.findByPrimaryKey(resourcePrimKey);
221 }
222
223 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
224 throws PortalException, SystemException {
225 return wikiPageResourcePersistence.findByPrimaryKey(primaryKeyObj);
226 }
227
228
240 public List<WikiPageResource> getWikiPageResources(int start, int end)
241 throws SystemException {
242 return wikiPageResourcePersistence.findAll(start, end);
243 }
244
245
251 public int getWikiPageResourcesCount() throws SystemException {
252 return wikiPageResourcePersistence.countAll();
253 }
254
255
262 @Indexable(type = IndexableType.REINDEX)
263 public WikiPageResource updateWikiPageResource(
264 WikiPageResource wikiPageResource) throws SystemException {
265 return updateWikiPageResource(wikiPageResource, true);
266 }
267
268
276 @Indexable(type = IndexableType.REINDEX)
277 public WikiPageResource updateWikiPageResource(
278 WikiPageResource wikiPageResource, boolean merge)
279 throws SystemException {
280 wikiPageResource.setNew(false);
281
282 return wikiPageResourcePersistence.update(wikiPageResource, merge);
283 }
284
285
290 public WikiNodeLocalService getWikiNodeLocalService() {
291 return wikiNodeLocalService;
292 }
293
294
299 public void setWikiNodeLocalService(
300 WikiNodeLocalService wikiNodeLocalService) {
301 this.wikiNodeLocalService = wikiNodeLocalService;
302 }
303
304
309 public WikiNodeService getWikiNodeService() {
310 return wikiNodeService;
311 }
312
313
318 public void setWikiNodeService(WikiNodeService wikiNodeService) {
319 this.wikiNodeService = wikiNodeService;
320 }
321
322
327 public WikiNodePersistence getWikiNodePersistence() {
328 return wikiNodePersistence;
329 }
330
331
336 public void setWikiNodePersistence(WikiNodePersistence wikiNodePersistence) {
337 this.wikiNodePersistence = wikiNodePersistence;
338 }
339
340
345 public WikiPageLocalService getWikiPageLocalService() {
346 return wikiPageLocalService;
347 }
348
349
354 public void setWikiPageLocalService(
355 WikiPageLocalService wikiPageLocalService) {
356 this.wikiPageLocalService = wikiPageLocalService;
357 }
358
359
364 public WikiPageService getWikiPageService() {
365 return wikiPageService;
366 }
367
368
373 public void setWikiPageService(WikiPageService wikiPageService) {
374 this.wikiPageService = wikiPageService;
375 }
376
377
382 public WikiPagePersistence getWikiPagePersistence() {
383 return wikiPagePersistence;
384 }
385
386
391 public void setWikiPagePersistence(WikiPagePersistence wikiPagePersistence) {
392 this.wikiPagePersistence = wikiPagePersistence;
393 }
394
395
400 public WikiPageFinder getWikiPageFinder() {
401 return wikiPageFinder;
402 }
403
404
409 public void setWikiPageFinder(WikiPageFinder wikiPageFinder) {
410 this.wikiPageFinder = wikiPageFinder;
411 }
412
413
418 public WikiPageResourceLocalService getWikiPageResourceLocalService() {
419 return wikiPageResourceLocalService;
420 }
421
422
427 public void setWikiPageResourceLocalService(
428 WikiPageResourceLocalService wikiPageResourceLocalService) {
429 this.wikiPageResourceLocalService = wikiPageResourceLocalService;
430 }
431
432
437 public WikiPageResourcePersistence getWikiPageResourcePersistence() {
438 return wikiPageResourcePersistence;
439 }
440
441
446 public void setWikiPageResourcePersistence(
447 WikiPageResourcePersistence wikiPageResourcePersistence) {
448 this.wikiPageResourcePersistence = wikiPageResourcePersistence;
449 }
450
451
456 public CounterLocalService getCounterLocalService() {
457 return counterLocalService;
458 }
459
460
465 public void setCounterLocalService(CounterLocalService counterLocalService) {
466 this.counterLocalService = counterLocalService;
467 }
468
469
474 public ResourceLocalService getResourceLocalService() {
475 return resourceLocalService;
476 }
477
478
483 public void setResourceLocalService(
484 ResourceLocalService resourceLocalService) {
485 this.resourceLocalService = resourceLocalService;
486 }
487
488
493 public ResourceService getResourceService() {
494 return resourceService;
495 }
496
497
502 public void setResourceService(ResourceService resourceService) {
503 this.resourceService = resourceService;
504 }
505
506
511 public ResourcePersistence getResourcePersistence() {
512 return resourcePersistence;
513 }
514
515
520 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
521 this.resourcePersistence = resourcePersistence;
522 }
523
524
529 public ResourceFinder getResourceFinder() {
530 return resourceFinder;
531 }
532
533
538 public void setResourceFinder(ResourceFinder resourceFinder) {
539 this.resourceFinder = resourceFinder;
540 }
541
542
547 public UserLocalService getUserLocalService() {
548 return userLocalService;
549 }
550
551
556 public void setUserLocalService(UserLocalService userLocalService) {
557 this.userLocalService = userLocalService;
558 }
559
560
565 public UserService getUserService() {
566 return userService;
567 }
568
569
574 public void setUserService(UserService userService) {
575 this.userService = userService;
576 }
577
578
583 public UserPersistence getUserPersistence() {
584 return userPersistence;
585 }
586
587
592 public void setUserPersistence(UserPersistence userPersistence) {
593 this.userPersistence = userPersistence;
594 }
595
596
601 public UserFinder getUserFinder() {
602 return userFinder;
603 }
604
605
610 public void setUserFinder(UserFinder userFinder) {
611 this.userFinder = userFinder;
612 }
613
614 public void afterPropertiesSet() {
615 persistedModelLocalServiceRegistry.register("com.liferay.portlet.wiki.model.WikiPageResource",
616 wikiPageResourceLocalService);
617 }
618
619 public void destroy() {
620 persistedModelLocalServiceRegistry.unregister(
621 "com.liferay.portlet.wiki.model.WikiPageResource");
622 }
623
624
629 public String getBeanIdentifier() {
630 return _beanIdentifier;
631 }
632
633
638 public void setBeanIdentifier(String beanIdentifier) {
639 _beanIdentifier = beanIdentifier;
640 }
641
642 protected Class<?> getModelClass() {
643 return WikiPageResource.class;
644 }
645
646 protected String getModelClassName() {
647 return WikiPageResource.class.getName();
648 }
649
650
655 protected void runSQL(String sql) throws SystemException {
656 try {
657 DataSource dataSource = wikiPageResourcePersistence.getDataSource();
658
659 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
660 sql, new int[0]);
661
662 sqlUpdate.update();
663 }
664 catch (Exception e) {
665 throw new SystemException(e);
666 }
667 }
668
669 @BeanReference(type = WikiNodeLocalService.class)
670 protected WikiNodeLocalService wikiNodeLocalService;
671 @BeanReference(type = WikiNodeService.class)
672 protected WikiNodeService wikiNodeService;
673 @BeanReference(type = WikiNodePersistence.class)
674 protected WikiNodePersistence wikiNodePersistence;
675 @BeanReference(type = WikiPageLocalService.class)
676 protected WikiPageLocalService wikiPageLocalService;
677 @BeanReference(type = WikiPageService.class)
678 protected WikiPageService wikiPageService;
679 @BeanReference(type = WikiPagePersistence.class)
680 protected WikiPagePersistence wikiPagePersistence;
681 @BeanReference(type = WikiPageFinder.class)
682 protected WikiPageFinder wikiPageFinder;
683 @BeanReference(type = WikiPageResourceLocalService.class)
684 protected WikiPageResourceLocalService wikiPageResourceLocalService;
685 @BeanReference(type = WikiPageResourcePersistence.class)
686 protected WikiPageResourcePersistence wikiPageResourcePersistence;
687 @BeanReference(type = CounterLocalService.class)
688 protected CounterLocalService counterLocalService;
689 @BeanReference(type = ResourceLocalService.class)
690 protected ResourceLocalService resourceLocalService;
691 @BeanReference(type = ResourceService.class)
692 protected ResourceService resourceService;
693 @BeanReference(type = ResourcePersistence.class)
694 protected ResourcePersistence resourcePersistence;
695 @BeanReference(type = ResourceFinder.class)
696 protected ResourceFinder resourceFinder;
697 @BeanReference(type = UserLocalService.class)
698 protected UserLocalService userLocalService;
699 @BeanReference(type = UserService.class)
700 protected UserService userService;
701 @BeanReference(type = UserPersistence.class)
702 protected UserPersistence userPersistence;
703 @BeanReference(type = UserFinder.class)
704 protected UserFinder userFinder;
705 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
706 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
707 private String _beanIdentifier;
708 }