
META-INF.resources.document_library.file_entry_action.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" %>
<%
ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
FileEntry fileEntry = null;
FileShortcut fileShortcut = null;
if (row != null) {
Object result = row.getObject();
if (result instanceof AssetEntry) {
AssetEntry assetEntry = (AssetEntry)result;
if (assetEntry.getClassName().equals(DLFileEntryConstants.getClassName())) {
fileEntry = DLAppLocalServiceUtil.getFileEntry(assetEntry.getClassPK());
}
else {
fileShortcut = DLAppLocalServiceUtil.getFileShortcut(assetEntry.getClassPK());
}
}
else if (result instanceof FileEntry) {
fileEntry = (FileEntry)result;
}
else if (result instanceof FileShortcut) {
fileShortcut = (FileShortcut)result;
}
else if (result instanceof TrashEntry) {
TrashEntry trashEntry = (TrashEntry)result;
String className = trashEntry.getClassName();
if (className.equals(DLFileEntryConstants.getClassName())) {
fileEntry = DLAppLocalServiceUtil.getFileEntry(trashEntry.getClassPK());
}
else {
fileShortcut = DLAppLocalServiceUtil.getFileShortcut(trashEntry.getClassPK());
}
}
}
else if (request.getAttribute("info_panel.jsp-fileEntry") != null) {
fileEntry = (FileEntry)request.getAttribute("info_panel.jsp-fileEntry");
}
else if (request.getAttribute("info_panel.jsp-fileShortcut") != null) {
fileShortcut = (FileShortcut)request.getAttribute("info_panel.jsp-fileShortcut");
}
DLViewFileVersionDisplayContext dlViewFileVersionDisplayContext = null;
if (fileShortcut == null) {
dlViewFileVersionDisplayContext = dlDisplayContextProvider.getDLViewFileVersionDisplayContext(request, response, fileEntry.getFileVersion());
}
else {
dlViewFileVersionDisplayContext = dlDisplayContextProvider.getDLViewFileVersionDisplayContext(request, response, fileShortcut);
}
DLVisualizationHelper dlVisualizationHelper = new DLVisualizationHelper(dlRequestHelper);
%>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy