001
014
015 package com.liferay.portlet.bookmarks.service.impl;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.security.permission.ActionKeys;
020 import com.liferay.portal.service.ServiceContext;
021 import com.liferay.portlet.bookmarks.model.BookmarksEntry;
022 import com.liferay.portlet.bookmarks.service.base.BookmarksEntryServiceBaseImpl;
023 import com.liferay.portlet.bookmarks.service.permission.BookmarksEntryPermission;
024 import com.liferay.portlet.bookmarks.service.permission.BookmarksFolderPermission;
025
026
029 public class BookmarksEntryServiceImpl extends BookmarksEntryServiceBaseImpl {
030
031 public BookmarksEntry addEntry(
032 long groupId, long folderId, String name, String url,
033 String comments, ServiceContext serviceContext)
034 throws PortalException, SystemException {
035
036 BookmarksFolderPermission.check(
037 getPermissionChecker(), groupId, folderId, ActionKeys.ADD_ENTRY);
038
039 return bookmarksEntryLocalService.addEntry(
040 getUserId(), groupId, folderId, name, url, comments,
041 serviceContext);
042 }
043
044 public void deleteEntry(long entryId)
045 throws PortalException, SystemException {
046
047 BookmarksEntryPermission.check(
048 getPermissionChecker(), entryId, ActionKeys.DELETE);
049
050 bookmarksEntryLocalService.deleteEntry(entryId);
051 }
052
053 public BookmarksEntry getEntry(long entryId)
054 throws PortalException, SystemException {
055
056 BookmarksEntryPermission.check(
057 getPermissionChecker(), entryId, ActionKeys.VIEW);
058
059 return bookmarksEntryLocalService.getEntry(entryId);
060 }
061
062 public BookmarksEntry openEntry(long entryId)
063 throws PortalException, SystemException {
064
065 BookmarksEntryPermission.check(
066 getPermissionChecker(), entryId, ActionKeys.VIEW);
067
068 return bookmarksEntryLocalService.openEntry(
069 getGuestOrUserId(), entryId);
070 }
071
072 public BookmarksEntry updateEntry(
073 long entryId, long groupId, long folderId, String name, String url,
074 String comments, ServiceContext serviceContext)
075 throws PortalException, SystemException {
076
077 BookmarksEntryPermission.check(
078 getPermissionChecker(), entryId, ActionKeys.UPDATE);
079
080 return bookmarksEntryLocalService.updateEntry(
081 getUserId(), entryId, groupId, folderId, name, url, comments,
082 serviceContext);
083 }
084
085 }