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.BookmarksFolder;
29 import com.liferay.portlet.bookmarks.service.base.BookmarksFolderServiceBaseImpl;
30 import com.liferay.portlet.bookmarks.service.permission.BookmarksFolderPermission;
31
32
38 public class BookmarksFolderServiceImpl extends BookmarksFolderServiceBaseImpl {
39
40 public BookmarksFolder addFolder(
41 long plid, long parentFolderId, String name, String description,
42 boolean addCommunityPermissions, boolean addGuestPermissions)
43 throws PortalException, SystemException {
44
45 BookmarksFolderPermission.check(
46 getPermissionChecker(), plid, parentFolderId,
47 ActionKeys.ADD_FOLDER);
48
49 return bookmarksFolderLocalService.addFolder(
50 getUserId(), plid, parentFolderId, name, description,
51 addCommunityPermissions, addGuestPermissions);
52 }
53
54 public BookmarksFolder addFolder(
55 long plid, long parentFolderId, String name, String description,
56 String[] communityPermissions, String[] guestPermissions)
57 throws PortalException, SystemException {
58
59 BookmarksFolderPermission.check(
60 getPermissionChecker(), plid, parentFolderId,
61 ActionKeys.ADD_FOLDER);
62
63 return bookmarksFolderLocalService.addFolder(
64 getUserId(), plid, parentFolderId, name, description,
65 communityPermissions, guestPermissions);
66 }
67
68 public void deleteFolder(long folderId)
69 throws PortalException, SystemException {
70
71 BookmarksFolderPermission.check(
72 getPermissionChecker(), folderId, ActionKeys.DELETE);
73
74 bookmarksFolderLocalService.deleteFolder(folderId);
75 }
76
77 public BookmarksFolder getFolder(long folderId)
78 throws PortalException, SystemException {
79
80 BookmarksFolderPermission.check(
81 getPermissionChecker(), folderId, ActionKeys.VIEW);
82
83 return bookmarksFolderLocalService.getFolder(folderId);
84 }
85
86 public BookmarksFolder updateFolder(
87 long folderId, long parentFolderId, String name,
88 String description, boolean mergeWithParentFolder)
89 throws PortalException, SystemException {
90
91 BookmarksFolderPermission.check(
92 getPermissionChecker(), folderId, ActionKeys.UPDATE);
93
94 return bookmarksFolderLocalService.updateFolder(
95 folderId, parentFolderId, name, description, mergeWithParentFolder);
96 }
97
98 }