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.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.wiki.model.WikiPageResource;
036 import com.liferay.portlet.wiki.service.WikiNodeLocalService;
037 import com.liferay.portlet.wiki.service.WikiNodeService;
038 import com.liferay.portlet.wiki.service.WikiPageLocalService;
039 import com.liferay.portlet.wiki.service.WikiPageResourceLocalService;
040 import com.liferay.portlet.wiki.service.WikiPageService;
041 import com.liferay.portlet.wiki.service.persistence.WikiNodePersistence;
042 import com.liferay.portlet.wiki.service.persistence.WikiPageFinder;
043 import com.liferay.portlet.wiki.service.persistence.WikiPagePersistence;
044 import com.liferay.portlet.wiki.service.persistence.WikiPageResourcePersistence;
045
046 import java.util.List;
047
048 import javax.sql.DataSource;
049
050
066 public abstract class WikiPageResourceLocalServiceBaseImpl
067 implements WikiPageResourceLocalService {
068
075 public WikiPageResource addWikiPageResource(
076 WikiPageResource wikiPageResource) throws SystemException {
077 wikiPageResource.setNew(true);
078
079 return wikiPageResourcePersistence.update(wikiPageResource, false);
080 }
081
082
088 public WikiPageResource createWikiPageResource(long resourcePrimKey) {
089 return wikiPageResourcePersistence.create(resourcePrimKey);
090 }
091
092
099 public void deleteWikiPageResource(long resourcePrimKey)
100 throws PortalException, SystemException {
101 wikiPageResourcePersistence.remove(resourcePrimKey);
102 }
103
104
110 public void deleteWikiPageResource(WikiPageResource wikiPageResource)
111 throws SystemException {
112 wikiPageResourcePersistence.remove(wikiPageResource);
113 }
114
115
122 @SuppressWarnings("rawtypes")
123 public List dynamicQuery(DynamicQuery dynamicQuery)
124 throws SystemException {
125 return wikiPageResourcePersistence.findWithDynamicQuery(dynamicQuery);
126 }
127
128
141 @SuppressWarnings("rawtypes")
142 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
143 throws SystemException {
144 return wikiPageResourcePersistence.findWithDynamicQuery(dynamicQuery,
145 start, end);
146 }
147
148
162 @SuppressWarnings("rawtypes")
163 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
164 OrderByComparator orderByComparator) throws SystemException {
165 return wikiPageResourcePersistence.findWithDynamicQuery(dynamicQuery,
166 start, end, orderByComparator);
167 }
168
169
176 public long dynamicQueryCount(DynamicQuery dynamicQuery)
177 throws SystemException {
178 return wikiPageResourcePersistence.countWithDynamicQuery(dynamicQuery);
179 }
180
181
189 public WikiPageResource getWikiPageResource(long resourcePrimKey)
190 throws PortalException, SystemException {
191 return wikiPageResourcePersistence.findByPrimaryKey(resourcePrimKey);
192 }
193
194
206 public List<WikiPageResource> getWikiPageResources(int start, int end)
207 throws SystemException {
208 return wikiPageResourcePersistence.findAll(start, end);
209 }
210
211
217 public int getWikiPageResourcesCount() throws SystemException {
218 return wikiPageResourcePersistence.countAll();
219 }
220
221
228 public WikiPageResource updateWikiPageResource(
229 WikiPageResource wikiPageResource) throws SystemException {
230 wikiPageResource.setNew(false);
231
232 return wikiPageResourcePersistence.update(wikiPageResource, true);
233 }
234
235
243 public WikiPageResource updateWikiPageResource(
244 WikiPageResource wikiPageResource, boolean merge)
245 throws SystemException {
246 wikiPageResource.setNew(false);
247
248 return wikiPageResourcePersistence.update(wikiPageResource, merge);
249 }
250
251
256 public WikiNodeLocalService getWikiNodeLocalService() {
257 return wikiNodeLocalService;
258 }
259
260
265 public void setWikiNodeLocalService(
266 WikiNodeLocalService wikiNodeLocalService) {
267 this.wikiNodeLocalService = wikiNodeLocalService;
268 }
269
270
275 public WikiNodeService getWikiNodeService() {
276 return wikiNodeService;
277 }
278
279
284 public void setWikiNodeService(WikiNodeService wikiNodeService) {
285 this.wikiNodeService = wikiNodeService;
286 }
287
288
293 public WikiNodePersistence getWikiNodePersistence() {
294 return wikiNodePersistence;
295 }
296
297
302 public void setWikiNodePersistence(WikiNodePersistence wikiNodePersistence) {
303 this.wikiNodePersistence = wikiNodePersistence;
304 }
305
306
311 public WikiPageLocalService getWikiPageLocalService() {
312 return wikiPageLocalService;
313 }
314
315
320 public void setWikiPageLocalService(
321 WikiPageLocalService wikiPageLocalService) {
322 this.wikiPageLocalService = wikiPageLocalService;
323 }
324
325
330 public WikiPageService getWikiPageService() {
331 return wikiPageService;
332 }
333
334
339 public void setWikiPageService(WikiPageService wikiPageService) {
340 this.wikiPageService = wikiPageService;
341 }
342
343
348 public WikiPagePersistence getWikiPagePersistence() {
349 return wikiPagePersistence;
350 }
351
352
357 public void setWikiPagePersistence(WikiPagePersistence wikiPagePersistence) {
358 this.wikiPagePersistence = wikiPagePersistence;
359 }
360
361
366 public WikiPageFinder getWikiPageFinder() {
367 return wikiPageFinder;
368 }
369
370
375 public void setWikiPageFinder(WikiPageFinder wikiPageFinder) {
376 this.wikiPageFinder = wikiPageFinder;
377 }
378
379
384 public WikiPageResourceLocalService getWikiPageResourceLocalService() {
385 return wikiPageResourceLocalService;
386 }
387
388
393 public void setWikiPageResourceLocalService(
394 WikiPageResourceLocalService wikiPageResourceLocalService) {
395 this.wikiPageResourceLocalService = wikiPageResourceLocalService;
396 }
397
398
403 public WikiPageResourcePersistence getWikiPageResourcePersistence() {
404 return wikiPageResourcePersistence;
405 }
406
407
412 public void setWikiPageResourcePersistence(
413 WikiPageResourcePersistence wikiPageResourcePersistence) {
414 this.wikiPageResourcePersistence = wikiPageResourcePersistence;
415 }
416
417
422 public CounterLocalService getCounterLocalService() {
423 return counterLocalService;
424 }
425
426
431 public void setCounterLocalService(CounterLocalService counterLocalService) {
432 this.counterLocalService = counterLocalService;
433 }
434
435
440 public ResourceLocalService getResourceLocalService() {
441 return resourceLocalService;
442 }
443
444
449 public void setResourceLocalService(
450 ResourceLocalService resourceLocalService) {
451 this.resourceLocalService = resourceLocalService;
452 }
453
454
459 public ResourceService getResourceService() {
460 return resourceService;
461 }
462
463
468 public void setResourceService(ResourceService resourceService) {
469 this.resourceService = resourceService;
470 }
471
472
477 public ResourcePersistence getResourcePersistence() {
478 return resourcePersistence;
479 }
480
481
486 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
487 this.resourcePersistence = resourcePersistence;
488 }
489
490
495 public ResourceFinder getResourceFinder() {
496 return resourceFinder;
497 }
498
499
504 public void setResourceFinder(ResourceFinder resourceFinder) {
505 this.resourceFinder = resourceFinder;
506 }
507
508
513 public UserLocalService getUserLocalService() {
514 return userLocalService;
515 }
516
517
522 public void setUserLocalService(UserLocalService userLocalService) {
523 this.userLocalService = userLocalService;
524 }
525
526
531 public UserService getUserService() {
532 return userService;
533 }
534
535
540 public void setUserService(UserService userService) {
541 this.userService = userService;
542 }
543
544
549 public UserPersistence getUserPersistence() {
550 return userPersistence;
551 }
552
553
558 public void setUserPersistence(UserPersistence userPersistence) {
559 this.userPersistence = userPersistence;
560 }
561
562
567 public UserFinder getUserFinder() {
568 return userFinder;
569 }
570
571
576 public void setUserFinder(UserFinder userFinder) {
577 this.userFinder = userFinder;
578 }
579
580
585 protected void runSQL(String sql) throws SystemException {
586 try {
587 DataSource dataSource = wikiPageResourcePersistence.getDataSource();
588
589 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
590 sql, new int[0]);
591
592 sqlUpdate.update();
593 }
594 catch (Exception e) {
595 throw new SystemException(e);
596 }
597 }
598
599 @BeanReference(type = WikiNodeLocalService.class)
600 protected WikiNodeLocalService wikiNodeLocalService;
601 @BeanReference(type = WikiNodeService.class)
602 protected WikiNodeService wikiNodeService;
603 @BeanReference(type = WikiNodePersistence.class)
604 protected WikiNodePersistence wikiNodePersistence;
605 @BeanReference(type = WikiPageLocalService.class)
606 protected WikiPageLocalService wikiPageLocalService;
607 @BeanReference(type = WikiPageService.class)
608 protected WikiPageService wikiPageService;
609 @BeanReference(type = WikiPagePersistence.class)
610 protected WikiPagePersistence wikiPagePersistence;
611 @BeanReference(type = WikiPageFinder.class)
612 protected WikiPageFinder wikiPageFinder;
613 @BeanReference(type = WikiPageResourceLocalService.class)
614 protected WikiPageResourceLocalService wikiPageResourceLocalService;
615 @BeanReference(type = WikiPageResourcePersistence.class)
616 protected WikiPageResourcePersistence wikiPageResourcePersistence;
617 @BeanReference(type = CounterLocalService.class)
618 protected CounterLocalService counterLocalService;
619 @BeanReference(type = ResourceLocalService.class)
620 protected ResourceLocalService resourceLocalService;
621 @BeanReference(type = ResourceService.class)
622 protected ResourceService resourceService;
623 @BeanReference(type = ResourcePersistence.class)
624 protected ResourcePersistence resourcePersistence;
625 @BeanReference(type = ResourceFinder.class)
626 protected ResourceFinder resourceFinder;
627 @BeanReference(type = UserLocalService.class)
628 protected UserLocalService userLocalService;
629 @BeanReference(type = UserService.class)
630 protected UserService userService;
631 @BeanReference(type = UserPersistence.class)
632 protected UserPersistence userPersistence;
633 @BeanReference(type = UserFinder.class)
634 protected UserFinder userFinder;
635 }