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.BookmarksFolder;
22 import com.liferay.portlet.bookmarks.service.base.BookmarksFolderServiceBaseImpl;
23 import com.liferay.portlet.bookmarks.service.permission.BookmarksFolderPermission;
24
25
30 public class BookmarksFolderServiceImpl extends BookmarksFolderServiceBaseImpl {
31
32 public BookmarksFolder addFolder(
33 long parentFolderId, String name, String description,
34 ServiceContext serviceContext)
35 throws PortalException, SystemException {
36
37 BookmarksFolderPermission.check(
38 getPermissionChecker(), serviceContext.getScopeGroupId(),
39 parentFolderId, ActionKeys.ADD_FOLDER);
40
41 return bookmarksFolderLocalService.addFolder(
42 getUserId(), parentFolderId, name, description, serviceContext);
43 }
44
45 public void deleteFolder(long folderId)
46 throws PortalException, SystemException {
47
48 BookmarksFolderPermission.check(
49 getPermissionChecker(), folderId, ActionKeys.DELETE);
50
51 bookmarksFolderLocalService.deleteFolder(folderId);
52 }
53
54 public BookmarksFolder getFolder(long folderId)
55 throws PortalException, SystemException {
56
57 BookmarksFolderPermission.check(
58 getPermissionChecker(), folderId, ActionKeys.VIEW);
59
60 return bookmarksFolderLocalService.getFolder(folderId);
61 }
62
63 public BookmarksFolder updateFolder(
64 long folderId, long parentFolderId, String name,
65 String description, boolean mergeWithParentFolder,
66 ServiceContext serviceContext)
67 throws PortalException, SystemException {
68
69 BookmarksFolderPermission.check(
70 getPermissionChecker(), folderId, ActionKeys.UPDATE);
71
72 return bookmarksFolderLocalService.updateFolder(
73 folderId, parentFolderId, name, description, mergeWithParentFolder,
74 serviceContext);
75 }
76
77 }