All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.document_library.select_file_entry.jsp Maven / Gradle / Ivy

The newest version!
<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
--%>

<%@ include file="/document_library/init.jsp" %>

<%
Folder folder = (Folder)request.getAttribute(WebKeys.DOCUMENT_LIBRARY_FOLDER);

long folderId = BeanParamUtil.getLong(folder, request, "folderId", DLFolderConstants.DEFAULT_PARENT_FOLDER_ID);

long groupId = BeanParamUtil.getLong(folder, request, "groupId");
String eventName = ParamUtil.getString(request, "eventName", liferayPortletResponse.getNamespace() + "selectFileEntry_" + groupId);

if (folder != null) {
	DLBreadcrumbUtil.addPortletBreadcrumbEntries(folder, request, renderResponse);
}

PortletURL portletURL = renderResponse.createRenderURL();

portletURL.setParameter("mvcRenderCommandName", "/document_library/select_file_entry");
portletURL.setParameter("groupId", String.valueOf(groupId));
portletURL.setParameter("folderId", String.valueOf(folderId));

SearchContainer dlSearchContainer = new SearchContainer(liferayPortletRequest, null, null, "curEntry", SearchContainer.DEFAULT_DELTA, portletURL, null, null);

int foldersAndFileEntriesAndFileShortcutsCount = DLAppServiceUtil.getFoldersAndFileEntriesAndFileShortcutsCount(groupId, folderId, WorkflowConstants.STATUS_APPROVED, true);

dlSearchContainer.setTotal(foldersAndFileEntriesAndFileShortcutsCount);

List foldersAndFileEntriesAndFileShortcuts = DLAppServiceUtil.getFoldersAndFileEntriesAndFileShortcuts(groupId, folderId, WorkflowConstants.STATUS_APPROVED, true, dlSearchContainer.getStart(), dlSearchContainer.getEnd(), dlSearchContainer.getOrderByComparator());

dlSearchContainer.setResults(foldersAndFileEntriesAndFileShortcuts);
%>

<%@ include file="/document_library/cast_result.jspf" %> <% try{ DLAppServiceUtil.getFoldersFileEntriesCount(curFolder.getRepositoryId(), Arrays.asList(curFolder.getFolderId()), WorkflowConstants.STATUS_APPROVED); DLAppServiceUtil.getFoldersCount(curFolder.getRepositoryId(), curFolder.getFolderId()); } catch (com.liferay.portal.kernel.repository.RepositoryException re) { rowURL = null; } catch (com.liferay.portal.kernel.security.auth.PrincipalException pe) { rowURL = null; } %> <%= HtmlUtil.escape(curFolder.getName()) %> <% Map data = new HashMap(); data.put("entryid", fileEntry.getFileEntryId()); data.put("entryname", fileEntry.getTitle()); %> <%= HtmlUtil.escape(fileEntry.getTitle()) %>
<%= HtmlUtil.escape(fileEntry.getDescription()) %>
Liferay.Util.selectEntityHandler('#selectFileEntryFm', '<%= HtmlUtil.escapeJS(eventName) %>');