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.portlet.bookmarks.model.BookmarksEntry;
29 import com.liferay.portlet.bookmarks.service.base.BookmarksEntryServiceBaseImpl;
30 import com.liferay.portlet.bookmarks.service.permission.BookmarksEntryPermission;
31 import com.liferay.portlet.bookmarks.service.permission.BookmarksFolderPermission;
32
33
38 public class BookmarksEntryServiceImpl extends BookmarksEntryServiceBaseImpl {
39
40 public BookmarksEntry addEntry(
41 long folderId, String name, String url, String comments,
42 String[] tagsEntries, boolean addCommunityPermissions,
43 boolean addGuestPermissions)
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, tagsEntries,
51 addCommunityPermissions, addGuestPermissions);
52 }
53
54 public BookmarksEntry addEntry(
55 long folderId, String name, String url, String comments,
56 String[] tagsEntries, String[] communityPermissions,
57 String[] guestPermissions)
58 throws PortalException, SystemException {
59
60 BookmarksFolderPermission.check(
61 getPermissionChecker(), folderId, ActionKeys.ADD_ENTRY);
62
63 return bookmarksEntryLocalService.addEntry(
64 getUserId(), folderId, name, url, comments, tagsEntries,
65 communityPermissions, guestPermissions);
66 }
67
68 public void deleteEntry(long entryId)
69 throws PortalException, SystemException {
70
71 BookmarksEntryPermission.check(
72 getPermissionChecker(), entryId, ActionKeys.DELETE);
73
74 bookmarksEntryLocalService.deleteEntry(entryId);
75 }
76
77 public BookmarksEntry getEntry(long entryId)
78 throws PortalException, SystemException {
79
80 BookmarksEntryPermission.check(
81 getPermissionChecker(), entryId, ActionKeys.VIEW);
82
83 return bookmarksEntryLocalService.getEntry(entryId);
84 }
85
86 public BookmarksEntry openEntry(long entryId)
87 throws PortalException, SystemException {
88
89 BookmarksEntryPermission.check(
90 getPermissionChecker(), entryId, ActionKeys.VIEW);
91
92 return bookmarksEntryLocalService.openEntry(entryId);
93 }
94
95 public BookmarksEntry updateEntry(
96 long entryId, long folderId, String name, String url,
97 String comments, String[] tagsEntries)
98 throws PortalException, SystemException {
99
100 BookmarksEntryPermission.check(
101 getPermissionChecker(), entryId, ActionKeys.UPDATE);
102
103 return bookmarksEntryLocalService.updateEntry(
104 getUserId(), entryId, folderId, name, url, comments, tagsEntries);
105 }
106
107 }