1
22
23 package com.liferay.portlet.bookmarks.service.impl;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portal.security.permission.ActionKeys;
28 import com.liferay.portal.service.ServiceContext;
29 import com.liferay.portlet.bookmarks.model.BookmarksEntry;
30 import com.liferay.portlet.bookmarks.service.base.BookmarksEntryServiceBaseImpl;
31 import com.liferay.portlet.bookmarks.service.permission.BookmarksEntryPermission;
32 import com.liferay.portlet.bookmarks.service.permission.BookmarksFolderPermission;
33
34
39 public class BookmarksEntryServiceImpl extends BookmarksEntryServiceBaseImpl {
40
41 public BookmarksEntry addEntry(
42 long folderId, String name, String url, String comments,
43 ServiceContext serviceContext)
44 throws PortalException, SystemException {
45
46 BookmarksFolderPermission.check(
47 getPermissionChecker(), folderId, ActionKeys.ADD_ENTRY);
48
49 return bookmarksEntryLocalService.addEntry(
50 getUserId(), folderId, name, url, comments, serviceContext);
51 }
52
53 public void deleteEntry(long entryId)
54 throws PortalException, SystemException {
55
56 BookmarksEntryPermission.check(
57 getPermissionChecker(), entryId, ActionKeys.DELETE);
58
59 bookmarksEntryLocalService.deleteEntry(entryId);
60 }
61
62 public BookmarksEntry getEntry(long entryId)
63 throws PortalException, SystemException {
64
65 BookmarksEntryPermission.check(
66 getPermissionChecker(), entryId, ActionKeys.VIEW);
67
68 return bookmarksEntryLocalService.getEntry(entryId);
69 }
70
71 public BookmarksEntry openEntry(long entryId)
72 throws PortalException, SystemException {
73
74 BookmarksEntryPermission.check(
75 getPermissionChecker(), entryId, ActionKeys.VIEW);
76
77 return bookmarksEntryLocalService.openEntry(entryId);
78 }
79
80 public BookmarksEntry updateEntry(
81 long entryId, long folderId, String name, String url,
82 String comments, ServiceContext serviceContext)
83 throws PortalException, SystemException {
84
85 BookmarksEntryPermission.check(
86 getPermissionChecker(), entryId, ActionKeys.UPDATE);
87
88 return bookmarksEntryLocalService.updateEntry(
89 getUserId(), entryId, folderId, name, url, comments,
90 serviceContext);
91 }
92
93 }