Example usage for com.liferay.portal.kernel.util WebKeys DOCUMENT_LIBRARY_FOLDERS

List of usage examples for com.liferay.portal.kernel.util WebKeys DOCUMENT_LIBRARY_FOLDERS

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util WebKeys DOCUMENT_LIBRARY_FOLDERS.

Prototype

String DOCUMENT_LIBRARY_FOLDERS

To view the source code for com.liferay.portal.kernel.util WebKeys DOCUMENT_LIBRARY_FOLDERS.

Click Source Link

Usage

From source file:com.liferay.document.library.web.internal.portlet.action.InfoPanelMVCResourceCommand.java

License:Open Source License

@Override
protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
        throws Exception {

    resourceRequest.setAttribute(WebKeys.DOCUMENT_LIBRARY_FILE_ENTRIES,
            ActionUtil.getFileEntries(resourceRequest));
    resourceRequest.setAttribute(WebKeys.DOCUMENT_LIBRARY_FILE_SHORTCUTS,
            ActionUtil.getFileShortcuts(resourceRequest));
    resourceRequest.setAttribute(WebKeys.DOCUMENT_LIBRARY_FOLDERS, ActionUtil.getFolders(resourceRequest));

    include(resourceRequest, resourceResponse, "/document_library/info_panel.jsp");
}

From source file:com.liferay.document.library.web.internal.portlet.action.MoveEntryMVCRenderCommand.java

License:Open Source License

@Override
public String render(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException {

    try {//from   w w  w  .j  a  v  a  2s  . c o  m
        List<FileEntry> fileEntries = ActionUtil.getFileEntries(renderRequest);

        renderRequest.setAttribute(WebKeys.DOCUMENT_LIBRARY_FILE_ENTRIES, fileEntries);

        FileEntry fileEntry = ActionUtil.getFileEntry(renderRequest);

        renderRequest.setAttribute(WebKeys.DOCUMENT_LIBRARY_FILE_ENTRY, fileEntry);

        List<FileShortcut> fileShortcuts = ActionUtil.getFileShortcuts(renderRequest);

        renderRequest.setAttribute(WebKeys.DOCUMENT_LIBRARY_FILE_SHORTCUTS, fileShortcuts);

        List<Folder> folders = ActionUtil.getFolders(renderRequest);

        renderRequest.setAttribute(WebKeys.DOCUMENT_LIBRARY_FOLDERS, folders);
    } catch (Exception e) {
        if (e instanceof NoSuchFileEntryException || e instanceof PrincipalException) {

            SessionErrors.add(renderRequest, e.getClass());

            return "/document_library/error.jsp";
        } else {
            throw new PortletException(e);
        }
    }

    return "/document_library/move_entries.jsp";
}