long folderId = 0;
try {
ThemeDisplay themeDisplay = (ThemeDisplay) request
.getAttribute(WebKeys.THEME_DISPLAY);
ServiceContext serviceContext = new ServiceContext();
serviceContext.setScopeGroupId(themeDisplay.getScopeGroupId());
//To get the List of folders of an Organization
List<DLFolder> groupFolder = DLFolderLocalServiceUtil.getFolders(
themeDisplay.getScopeGroupId(),
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID);
//To create a folder in an Organization
DLFolder folder = DLFolderLocalServiceUtil.addFolder(
themeDisplay.getUserId(),
themeDisplay.getScopeGroupId(),
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
"Folder Name", "Folder Description",
serviceContext);
}
} catch (SystemException e) {
e.printStackTrace();
} catch (PortalException e) {
e.printStackTrace();
}
try {
ThemeDisplay themeDisplay = (ThemeDisplay) request
.getAttribute(WebKeys.THEME_DISPLAY);
ServiceContext serviceContext = new ServiceContext();
serviceContext.setScopeGroupId(themeDisplay.getScopeGroupId());
//To get the List of folders of an Organization
List<DLFolder> groupFolder = DLFolderLocalServiceUtil.getFolders(
themeDisplay.getScopeGroupId(),
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID);
//To create a folder in an Organization
DLFolder folder = DLFolderLocalServiceUtil.addFolder(
themeDisplay.getUserId(),
themeDisplay.getScopeGroupId(),
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
"Folder Name", "Folder Description",
serviceContext);
}
} catch (SystemException e) {
e.printStackTrace();
} catch (PortalException e) {
e.printStackTrace();
}
If you enjoyed this post, please spend a few seconds to share..
| Tweet |
| 

0 comments:
Post a Comment