sbd-uploadshare-portlet/src/main/webapp/html/accessexploratory/view.jsp

137 lines
4.9 KiB
Plaintext
Raw Blame History

<%@include file="init.jsp"%>
<%
long groupId = themeDisplay.getLayout().getGroupId();
pageContext.setAttribute("icondocURL",
GetterUtil.getString(portletPreferences.getValue("icondocURL", StringPool.BLANK)));
pageContext.setAttribute("exploratoryName1Title",
GetterUtil.getString(portletPreferences.getValue("exploratoryName1-Title", StringPool.BLANK)));
pageContext.setAttribute("exploratoryName2Title",
GetterUtil.getString(portletPreferences.getValue("exploratoryName2-Title", StringPool.BLANK)));
pageContext.setAttribute("exploratoryName3Title",
GetterUtil.getString(portletPreferences.getValue("exploratoryName3-Title", StringPool.BLANK)));
long exploratoryName1DocumentId = GetterUtil
.getLong(portletPreferences.getValue("exploratoryName1-DocumentId", StringPool.BLANK));
long exploratoryName2DocumentId = GetterUtil
.getLong(portletPreferences.getValue("exploratoryName2-DocumentId", StringPool.BLANK));
long exploratoryName3DocumentId = GetterUtil
.getLong(portletPreferences.getValue("exploratoryName3-DocumentId", StringPool.BLANK));
pageContext.setAttribute("exploratory1Url",
GetterUtil.getString(portletPreferences.getValue("exploratory1-Url", StringPool.BLANK)));
pageContext.setAttribute("exploratory2Url",
GetterUtil.getString(portletPreferences.getValue("exploratory2-Url", StringPool.BLANK)));
pageContext.setAttribute("exploratory3Url",
GetterUtil.getString(portletPreferences.getValue("exploratory3-Url", StringPool.BLANK)));
String content1 = "";
if (exploratoryName1DocumentId > 0) {
JournalArticle article = JournalArticleLocalServiceUtil.getArticle(groupId,
"" + exploratoryName1DocumentId);
Document document = SAXReaderUtil.read(article.getContent());
Node node = document.selectSingleNode("/root/static-content");
content1 = node.getText();
}
String content2 = "";
if (exploratoryName2DocumentId > 0) {
JournalArticle article = JournalArticleLocalServiceUtil.getArticle(groupId,
"" + exploratoryName2DocumentId);
Document document = SAXReaderUtil.read(article.getContent());
Node node = document.selectSingleNode("/root/static-content");
content2 = node.getText();
}
String content3 = "";
if (exploratoryName3DocumentId > 0) {
JournalArticle article = JournalArticleLocalServiceUtil.getArticle(groupId,
"" + exploratoryName3DocumentId);
Document document = SAXReaderUtil.read(article.getContent());
Node node = document.selectSingleNode("/root/static-content");
content3 = node.getText();
}
%>
<c:if test="${not empty exploratoryName1Title}">
<div class="asset-abstract">
<h3 class="asset-title">
<a href="${exploratory1Url}"><img alt="" src="${icondocURL}">
${exploratoryName1Title}</a>
</h3>
<div class="asset-content">
<div class="asset-summary" style="margin-left: 25px;">
<span id="asset-summarypre1"> <%
if (content1.length() > 225)
out.println(HtmlUtil.stripHtml(content1.substring(0, 222) + " ..."));
%>
<div>
<a
href="javascript:switchView('#asset-summarypre1', '#asset-summary-1');">Read
More <20> </a>
</div>
</span>
<div class="asset-more">
<div id="asset-summary-1" class="asset-summary"
style="display: none;"><%=content1%></div>
</div>
</div>
<div class="asset-metadata"></div>
</div>
</div>
</c:if>
<!-- SECOND -->
<c:if test="${not empty exploratoryName2Title}">
<div class="asset-abstract">
<h3 class="asset-title">
<a href="${exploratory2Url}"><img alt="" src="${icondocURL}">
${exploratoryName2Title}</a>
</h3>
<div class="asset-content">
<div class="asset-summary" style="margin-left: 25px;">
<span id="asset-summarypre2"> <%
if (content2.length() > 225)
out.println(HtmlUtil.stripHtml(content2.substring(0, 222) + " ..."));
%>
<div>
<a
href="javascript:switchView('#asset-summarypre2', '#asset-summary-2');">Read
More <20> </a>
</div>
</span>
<div class="asset-more">
<div id="asset-summary-2" class="asset-summary"
style="display: none;"><%=content2%></div>
</div>
</div>
<div class="asset-metadata"></div>
</div>
</div>
</c:if>
<!-- THIRD -->
<c:if test="${not empty exploratoryName3Title}">
<div class="asset-abstract">
<h3 class="asset-title">
<a href="${exploratory3Url}"><img alt="" src="${icondocURL}">
${exploratoryName3Title}</a>
</h3>
<div class="asset-content">
<div class="asset-summary" style="margin-left: 25px;">
<span id="asset-summarypre3"> <%
if (content3.length() > 225)
out.println(HtmlUtil.stripHtml(content3.substring(0, 222) + " ..."));
%>
<div>
<a
href="javascript:switchView('#asset-summarypre3', '#asset-summary-3');">Read
More <20> </a>
</div>
</span>
<div class="asset-more">
<div id="asset-summary-3" class="asset-summary"
style="display: none;"><%=content3%></div>
</div>
</div>
<div class="asset-metadata"></div>
</div>
</div>
</c:if>