%@include file="init.jsp"%>
<%@ page import="org.gcube.portlets.user.sbd.Utils" %>
<%@ page import="com.liferay.portal.model.User" %>
<%@ page import="com.liferay.portal.util.PortalUtil" %>
<%
long groupId = themeDisplay.getLayout().getGroupId();
User currentUser = PortalUtil.getUser( request );
pageContext.setAttribute("icondocURL",
GetterUtil.getString(portletPreferences.getValue("icondocURL", StringPool.BLANK)));
pageContext.setAttribute("applicationName1Title",
GetterUtil.getString(portletPreferences.getValue("applicationName1-Title", StringPool.BLANK)));
pageContext.setAttribute("applicationName2Title",
GetterUtil.getString(portletPreferences.getValue("applicationName2-Title", StringPool.BLANK)));
pageContext.setAttribute("applicationName3Title",
GetterUtil.getString(portletPreferences.getValue("applicationName3-Title", StringPool.BLANK)));
long applicationName1DocumentId = GetterUtil
.getLong(portletPreferences.getValue("applicationName1-DocumentId", StringPool.BLANK));
long applicationName2DocumentId = GetterUtil
.getLong(portletPreferences.getValue("applicationName2-DocumentId", StringPool.BLANK));
long applicationName3DocumentId = GetterUtil
.getLong(portletPreferences.getValue("applicationName3-DocumentId", StringPool.BLANK));
String url1 = GetterUtil.getString(portletPreferences.getValue("application1-Url", StringPool.BLANK));
pageContext.setAttribute("application1Url", Utils.getVREFriendlyURL(currentUser, url1));
String url2 = GetterUtil.getString(portletPreferences.getValue("application2-Url", StringPool.BLANK));
pageContext.setAttribute("application2Url", Utils.getVREFriendlyURL(currentUser, url2));
String url3 = GetterUtil.getString(portletPreferences.getValue("application3-Url", StringPool.BLANK));
pageContext.setAttribute("application3Url", Utils.getVREFriendlyURL(currentUser, url3));
String content1 = "";
if (applicationName1DocumentId > 0) {
JournalArticle article = JournalArticleLocalServiceUtil.getArticle(groupId,
"" + applicationName1DocumentId);
Document document = SAXReaderUtil.read(article.getContent());
Node node = document.selectSingleNode("/root/static-content");
content1 = node.getText();
}
String content2 = "";
if (applicationName2DocumentId > 0) {
JournalArticle article = JournalArticleLocalServiceUtil.getArticle(groupId,
"" + applicationName2DocumentId);
Document document = SAXReaderUtil.read(article.getContent());
Node node = document.selectSingleNode("/root/static-content");
content2 = node.getText();
}
String content3 = "";
if (applicationName3DocumentId > 0) {
JournalArticle article = JournalArticleLocalServiceUtil.getArticle(groupId,
"" + applicationName3DocumentId);
Document document = SAXReaderUtil.read(article.getContent());
Node node = document.selectSingleNode("/root/static-content");
content3 = node.getText();
}
%>
<%
if (content1.length() > 225)
out.println(HtmlUtil.stripHtml(content1.substring(0, 222) + " ..."));
%>
<%
if (content2.length() > 225)
out.println(HtmlUtil.stripHtml(content2.substring(0, 222) + " ..."));
%>
<%
if (content3.length() > 225)
out.println(HtmlUtil.stripHtml(content3.substring(0, 222) + " ..."));
%>