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