1
14
15 package com.liferay.portlet.bookmarks.service.impl;
16
17 import com.liferay.portal.PortalException;
18 import com.liferay.portal.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 folderId, String name, String url, String comments,
35 ServiceContext serviceContext)
36 throws PortalException, SystemException {
37
38 BookmarksFolderPermission.check(
39 getPermissionChecker(), folderId, ActionKeys.ADD_ENTRY);
40
41 return bookmarksEntryLocalService.addEntry(
42 getUserId(), folderId, name, url, comments, serviceContext);
43 }
44
45 public void deleteEntry(long entryId)
46 throws PortalException, SystemException {
47
48 BookmarksEntryPermission.check(
49 getPermissionChecker(), entryId, ActionKeys.DELETE);
50
51 bookmarksEntryLocalService.deleteEntry(entryId);
52 }
53
54 public BookmarksEntry getEntry(long entryId)
55 throws PortalException, SystemException {
56
57 BookmarksEntryPermission.check(
58 getPermissionChecker(), entryId, ActionKeys.VIEW);
59
60 return bookmarksEntryLocalService.getEntry(entryId);
61 }
62
63 public BookmarksEntry openEntry(long entryId)
64 throws PortalException, SystemException {
65
66 BookmarksEntryPermission.check(
67 getPermissionChecker(), entryId, ActionKeys.VIEW);
68
69 return bookmarksEntryLocalService.openEntry(entryId);
70 }
71
72 public BookmarksEntry updateEntry(
73 long entryId, long folderId, String name, String url,
74 String comments, ServiceContext serviceContext)
75 throws PortalException, SystemException {
76
77 BookmarksEntryPermission.check(
78 getPermissionChecker(), entryId, ActionKeys.UPDATE);
79
80 return bookmarksEntryLocalService.updateEntry(
81 getUserId(), entryId, folderId, name, url, comments,
82 serviceContext);
83 }
84
85 }