
META-INF.resources.display.table.jsp Maven / Gradle / Ivy
<%--
/**
* 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="/init.jsp" %>
<%
List results = (List)request.getAttribute("view.jsp-results");
int assetEntryIndex = ((Integer)request.getAttribute("view.jsp-assetEntryIndex")).intValue();
AssetEntry assetEntry = (AssetEntry)request.getAttribute("view.jsp-assetEntry");
AssetRenderer> assetRenderer = (AssetRenderer>)request.getAttribute("view.jsp-assetRenderer");
Group stageableGroup = themeDisplay.getScopeGroup();
if (stageableGroup.isLayout()) {
stageableGroup = layout.getGroup();
}
String title = (String)request.getAttribute("view.jsp-title");
if (Validator.isNull(title)) {
title = assetRenderer.getTitle(locale);
}
PortletURL editPortletURL = assetRenderer.getURLEdit(liferayPortletRequest, liferayPortletResponse);
boolean viewInContext = ((Boolean)request.getAttribute("view.jsp-viewInContext")).booleanValue();
String viewURL = AssetPublisherHelper.getAssetViewURL(liferayPortletRequest, liferayPortletResponse, assetEntry, viewInContext);
request.setAttribute("view.jsp-showIconLabel", false);
%>
<%
for (String metadataField : assetPublisherDisplayContext.getMetadataFields()) {
%>
<%
}
%>
<%= HtmlUtil.escape(title) %>
<%= HtmlUtil.escape(title) %>
<%
for (String metadataField : assetPublisherDisplayContext.getMetadataFields()) {
%>
<%
String value = null;
if (Objects.equals(metadataField, "create-date")) {
value = dateFormatDate.format(assetEntry.getCreateDate());
}
else if (Objects.equals(metadataField, "modified-date")) {
value = dateFormatDate.format(assetEntry.getModifiedDate());
}
else if (Objects.equals(metadataField, "publish-date")) {
if (assetEntry.getPublishDate() == null) {
value = StringPool.BLANK;
}
else {
value = dateFormatDate.format(assetEntry.getPublishDate());
}
}
else if (Objects.equals(metadataField, "expiration-date")) {
if (assetEntry.getExpirationDate() == null) {
value = StringPool.BLANK;
}
else {
value = dateFormatDate.format(assetEntry.getExpirationDate());
}
}
else if (Objects.equals(metadataField, "priority")) {
value = String.valueOf(assetEntry.getPriority());
}
else if (Objects.equals(metadataField, "author")) {
String userName = PortalUtil.getUserName(assetRenderer.getUserId(), assetRenderer.getUserName());
value = HtmlUtil.escape(userName);
}
else if (Objects.equals(metadataField, "view-count")) {
value = String.valueOf(assetEntry.getViewCount());
}
%>
<%
}
%>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy