%
/**
* Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
%>
<%
PortletURL portletURL = renderResponse.createRenderURL();
boolean previous = false;
for (int j = 0; j < metadataFields.length; j++) {
String value = null;
if (metadataFields[j].equals("create-date")) {
value = dateFormatDate.format(asset.getCreateDate());
}
else if (metadataFields[j].equals("modified-date")) {
value = dateFormatDate.format(asset.getModifiedDate());
}
else if (metadataFields[j].equals("publish-date")) {
if (asset.getPublishDate() == null) {
value = StringPool.BLANK;
}
else {
value = dateFormatDate.format(asset.getPublishDate());
}
}
else if (metadataFields[j].equals("expiration-date")) {
if (asset.getExpirationDate() == null) {
value = StringPool.BLANK;
}
else {
value = dateFormatDate.format(asset.getExpirationDate());
}
}
else if (metadataFields[j].equals("priority")) {
value = LanguageUtil.get(pageContext, "priority") + StringPool.COLON + StringPool.SPACE + asset.getPriority();
}
else if (metadataFields[j].equals("author")) {
value = LanguageUtil.get(pageContext, "by") + StringPool.SPACE + asset.getUserName();
}
else if (metadataFields[j].equals("view-count")) {
int viewCount = asset.getViewCount();
value = viewCount + StringPool.SPACE + LanguageUtil.get(pageContext, (viewCount == 1) ? "view" : "views");
}
else if (metadataFields[j].equals("tags")) {
value = "tags";
}
if (Validator.isNotNull(value)) {
if (previous && !(value.equals("tags") && asset.getEntries().isEmpty() )) {
%>
<%
}
previous = true;
%>
">
<%= value %>
<%
}
}
%>