@Override public int getTrashContainerModelsCount(long classPK) throws PortalException { BookmarksFolder folder = BookmarksFolderLocalServiceUtil.getFolder(classPK); return BookmarksFolderLocalServiceUtil.getFoldersCount( folder.getGroupId(), classPK, WorkflowConstants.STATUS_IN_TRASH); }
@Override public int getContainerModelsCount(long classPK, long parentContainerModelId) throws PortalException { return BookmarksFolderLocalServiceUtil.getFoldersCount( getGroupId(classPK), parentContainerModelId); }
public static String getAbsolutePath(PortletRequest portletRequest, long folderId) throws PortalException { ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY); if (folderId == BookmarksFolderConstants.DEFAULT_PARENT_FOLDER_ID) { return themeDisplay.translate("home"); } BookmarksFolder folder = BookmarksFolderLocalServiceUtil.fetchBookmarksFolder(folderId); List<BookmarksFolder> folders = folder.getAncestors(); StringBundler sb = new StringBundler((folders.size() * 3) + 5); sb.append(themeDisplay.translate("home")); sb.append(StringPool.SPACE); Collections.reverse(folders); for (BookmarksFolder curFolder : folders) { sb.append(StringPool.RAQUO_CHAR); sb.append(StringPool.SPACE); sb.append(curFolder.getName()); } sb.append(StringPool.RAQUO_CHAR); sb.append(StringPool.SPACE); sb.append(folder.getName()); return sb.toString(); }
protected void initActionableDynamicQuery(ActionableDynamicQuery actionableDynamicQuery) { actionableDynamicQuery.setBaseLocalService( com.liferay.bookmarks.service.BookmarksFolderLocalServiceUtil.getService()); actionableDynamicQuery.setClassLoader(getClassLoader()); actionableDynamicQuery.setModelClass(BookmarksFolder.class); actionableDynamicQuery.setPrimaryKeyPropertyName("folderId"); }
@Override public boolean hasPermission(PermissionChecker permissionChecker, long classPK, String actionId) throws Exception { BookmarksFolder folder = BookmarksFolderLocalServiceUtil.getFolder(classPK); return BookmarksFolderPermissionChecker.contains(permissionChecker, folder, actionId); }
@Override public ActionableDynamicQuery getActionableDynamicQuery() { ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery(); actionableDynamicQuery.setBaseLocalService( com.liferay.bookmarks.service.BookmarksFolderLocalServiceUtil.getService()); actionableDynamicQuery.setClassLoader(getClassLoader()); actionableDynamicQuery.setModelClass(BookmarksFolder.class); actionableDynamicQuery.setPrimaryKeyPropertyName("folderId"); return actionableDynamicQuery; }
@Override public AssetRenderer getAssetRenderer(long classPK, int type) throws PortalException { BookmarksFolder folder = BookmarksFolderLocalServiceUtil.getFolder(classPK); BookmarksFolderAssetRenderer bookmarksFolderAssetRenderer = new BookmarksFolderAssetRenderer(folder); bookmarksFolderAssetRenderer.setAssetRendererType(type); bookmarksFolderAssetRenderer.setServletContext(_servletContext); return bookmarksFolderAssetRenderer; }
@Override public List<TrashRenderer> getTrashContainerModelTrashRenderers(long classPK, int start, int end) throws PortalException { List<TrashRenderer> trashRenderers = new ArrayList<TrashRenderer>(); BookmarksFolder folder = BookmarksFolderLocalServiceUtil.getFolder(classPK); List<BookmarksFolder> folders = BookmarksFolderLocalServiceUtil.getFolders( folder.getGroupId(), classPK, WorkflowConstants.STATUS_IN_TRASH, start, end); for (BookmarksFolder curFolder : folders) { TrashHandler trashHandler = TrashHandlerRegistryUtil.getTrashHandler(BookmarksFolder.class.getName()); TrashRenderer trashRenderer = trashHandler.getTrashRenderer(curFolder.getPrimaryKey()); trashRenderers.add(trashRenderer); } return trashRenderers; }
@Override public List<ContainerModel> getContainerModels( long classPK, long parentContainerModelId, int start, int end) throws PortalException { List<BookmarksFolder> folders = BookmarksFolderLocalServiceUtil.getFolders( getGroupId(classPK), parentContainerModelId, start, end); List<ContainerModel> containerModels = new ArrayList<ContainerModel>(folders.size()); for (BookmarksFolder curFolder : folders) { containerModels.add(curFolder); } return containerModels; }
@Override public ContainerModel getContainerModel(long containerModelId) throws PortalException { return BookmarksFolderLocalServiceUtil.getFolder(containerModelId); }
@Override protected void addSubscriptionContainerModel(long containerModelId) throws Exception { BookmarksFolderLocalServiceUtil.subscribeFolder( user.getUserId(), group.getGroupId(), containerModelId); }