Access Applications done

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/sbd-uploadshare-portlet@163174 82a268e6-3cf1-43bd-a215-b396298e98cf
master
Massimiliano Assante 6 years ago
parent d2c18da294
commit e930da1227

@ -0,0 +1,11 @@
package org.gcube.portlets.user.sbdportlets;
import com.liferay.util.bridges.mvc.MVCPortlet;
/**
* Portlet implementation class AccessApplication
*/
public class AccessApplication extends MVCPortlet {
}

@ -0,0 +1,53 @@
package org.gcube.portlets.user.sbdportlets;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import javax.portlet.PortletPreferences;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.portlet.DefaultConfigurationAction;
public class AccessApplicationAction extends DefaultConfigurationAction {
private static Log _log = LogFactoryUtil.getLog(AccessApplicationAction.class);
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
super.processAction(portletConfig, actionRequest, actionResponse);
PortletPreferences prefs = actionRequest.getPreferences();
String icondocURL = prefs.getValue("icondocURL", "0");
_log.info("icondocURL = " + icondocURL + " in ConfigurationAction.processAction() saved correctly");
String applicationName1Title = prefs.getValue("applicationName1-Title", "");
_log.info("applicationName1-Title = " + applicationName1Title + " in ConfigurationAction.processAction() saved correctly");
String applicationName2Title = prefs.getValue("applicationName2-Title", "");
_log.info("applicationName2-Title = " + applicationName2Title + " in ConfigurationAction.processAction() saved correctly");
String applicationName3Title = prefs.getValue("applicationName3-Title", "");
_log.info("applicationName3-Title = " + applicationName3Title + " in ConfigurationAction.processAction() saved correctly");
long applicationName1DocumentId = Long.parseLong(prefs.getValue("applicationName1-DocumentId", "0"));
_log.info("applicationName1-DocumentId = " + applicationName1DocumentId + " in ConfigurationAction.processAction() saved correctly");
long applicationName2DocumentId = Long.parseLong(prefs.getValue("applicationName2-DocumentId", "0"));
_log.info("applicationName2-DocumentId = " + applicationName2DocumentId + " in ConfigurationAction.processAction() saved correctly");
long applicationName3DocumentId = Long.parseLong(prefs.getValue("applicationName3-DocumentId", "0"));
_log.info("applicationName3-DocumentId = " + applicationName3DocumentId + " in ConfigurationAction.processAction() saved correctly");
String application1Url = prefs.getValue("application1-Url", "");
_log.info("application1-Url = " + application1Url + " in ConfigurationAction.processAction() saved correctly");
String application2Url = prefs.getValue("application2-Url", "");
_log.info("application2-Url = " + application2Url + " in ConfigurationAction.processAction() saved correctly");
String application3Url = prefs.getValue("application3-Url", "");
_log.info("application3-Url = " + application3Url + " in ConfigurationAction.processAction() saved correctly");
}
@Override
public String render(PortletConfig portletConfig,
RenderRequest renderRequest, RenderResponse renderResponse)
throws Exception {
return "/html/accessapplication/config.jsp";
}
}

@ -11,5 +11,6 @@
</category>
<category name="gCube Applications">
<portlet id="access-exploratory"></portlet>
<portlet id="access-application"></portlet>
</category>
</display>

@ -37,6 +37,18 @@
</css-class-wrapper>
</portlet>
<portlet>
<portlet-name>access-application</portlet-name>
<icon>/icon.png</icon>
<configuration-action-class>org.gcube.portlets.user.sbdportlets.AccessApplicationAction</configuration-action-class>
<header-portlet-css>/css/main.css</header-portlet-css>
<header-portlet-javascript>
/js/main.js
</header-portlet-javascript>
<css-class-wrapper>
access-application-portlet
</css-class-wrapper>
</portlet>
<role-mapper>
<role-name>administrator</role-name>
<role-link>Administrator</role-link>

@ -50,7 +50,7 @@
<portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
<title>Collaborate with us on your Research Idea</title>
<title>Submit your Idea</title>
<short-title>Collaborate With Us</short-title>
<keywords></keywords>
</portlet-info>
@ -88,7 +88,7 @@
<portlet-mode>config</portlet-mode>
</supports>
<portlet-info>
<title>Access Exploratory</title>
<title>Exploratories</title>
<short-title>Access Exploratory</short-title>
<keywords></keywords>
</portlet-info>
@ -105,4 +105,42 @@
<role-name>user</role-name>
</security-role-ref>
</portlet>
<portlet>
<portlet-name>access-application</portlet-name>
<display-name>Access Application</display-name>
<portlet-class>
org.gcube.portlets.user.sbdportlets.AccessApplication
</portlet-class>
<init-param>
<name>view-template</name>
<value>/html/accessapplication/view.jsp</value>
</init-param>
<init-param>
<name>config-template</name>
<value>/html/accessapplication/config.jsp</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>config</portlet-mode>
</supports>
<portlet-info>
<title>Applications</title>
<short-title>Access Application</short-title>
<keywords></keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
</portlet-app>

@ -0,0 +1,123 @@
<%@include file="init.jsp"%>
<liferay-portlet:actionURL portletConfiguration="true"
var="configurationURL" />
Here you can customise the icon to show besides the application name
<%
String icondocURL = GetterUtil.getString(portletPreferences.getValue("icondocURL", StringPool.BLANK));
String applicationName1Title = GetterUtil.getString(portletPreferences.getValue("applicationName1-Title", StringPool.BLANK));
String applicationName2Title = GetterUtil.getString(portletPreferences.getValue("applicationName2-Title", StringPool.BLANK));
String 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 application1Url = GetterUtil.getString(portletPreferences.getValue("application1-Url", StringPool.BLANK));
String application2Url = GetterUtil.getString(portletPreferences.getValue("application2-Url", StringPool.BLANK));
String application3Url = GetterUtil.getString(portletPreferences.getValue("application3-Url", StringPool.BLANK));
String displayName_cfg = "";
%>
<aui:form action="<%=configurationURL%>" method="post" name="fm">
<aui:input name="<%=Constants.CMD%>" type="hidden"
value="<%=Constants.UPDATE%>" />
<aui:input name="preferences--icondocURL--" type="text"
cssClass="text long-field" showRequiredLabel="true" label="Icon docId"
inlineField="true" inlineLabel="left" placeholder="Relative URL of the image"
helpMessage="Relative URL of the image taken from Liferay CMS of the icons"
value="<%=icondocURL%>" required="false">
</aui:input>
<p>Enter the application in the following:</p>
<!-- Application URL -->
<aui:field-wrapper cssClass="field-group">
<table>
<tr>
<td><aui:input name="preferences--applicationName1-Title--"
type="text" cssClass="text long-field" showRequiredLabel="true"
label="application Name 1" inlineField="true" inlineLabel="left"
placeholder="application"
helpMessage="Display Name of the application"
value="<%=applicationName1Title%>" required="false" /></td>
<td><aui:input
name="preferences--applicationName1-DocumentId--" type="text"
cssClass="text long-field" showRequiredLabel="true"
label="application Document Id 1" inlineField="true"
inlineLabel="left" placeholder="ID"
helpMessage="ID taken from Liferay CMS in this Site"
value="<%=applicationName1DocumentId%>" required="false">
<aui:validator name="digits"></aui:validator>
</aui:input></td>
<td><aui:input name="preferences--application1-Url--"
type="text" cssClass="text long-field" showRequiredLabel="true"
label="URL of the VRE 1" inlineField="true" inlineLabel="left"
placeholder="url" helpMessage="URL" value="<%=application1Url%>"
required="false">
</aui:input></td>
</tr>
</table>
</aui:field-wrapper>
<aui:field-wrapper cssClass="field-group">
<table>
<tr>
<td><aui:input name="preferences--applicationName2-Title--"
type="text" cssClass="text long-field" showRequiredLabel="true"
label="application Name 2" inlineField="true" inlineLabel="left"
placeholder="application"
helpMessage="Display Name of the application"
value="<%=applicationName2Title%>" required="false" /></td>
<td><aui:input
name="preferences--applicationName2-DocumentId--" type="text"
cssClass="text long-field" showRequiredLabel="true"
label="application Document Id 2" inlineField="true"
inlineLabel="left" placeholder="ID"
helpMessage="ID taken from Liferay CMS in this Site"
value="<%=applicationName2DocumentId%>" required="false">
<aui:validator name="digits"></aui:validator>
</aui:input></td>
<td><aui:input name="preferences--application2-Url--"
type="text" cssClass="text long-field" showRequiredLabel="true"
label="URL of the VRE 2" inlineField="true" inlineLabel="left"
placeholder="url" helpMessage="URL" value="<%=application2Url%>"
required="false">
</aui:input></td>
</tr>
</table>
</aui:field-wrapper>
<aui:field-wrapper cssClass="field-group">
<table>
<tr>
<td><aui:input name="preferences--applicationName3-Title--"
type="text" cssClass="text long-field" showRequiredLabel="true"
label="application Name 3" inlineField="true" inlineLabel="left"
placeholder="application"
helpMessage="Display Name of the application"
value="<%=applicationName3Title%>" required="false" /></td>
<td><aui:input
name="preferences--applicationName3-DocumentId--" type="text"
cssClass="text long-field" showRequiredLabel="true"
label="application Document Id 3" inlineField="true"
inlineLabel="left" placeholder="ID"
helpMessage="ID taken from Liferay CMS in this Site"
value="<%=applicationName3DocumentId%>" required="false">
<aui:validator name="digits"></aui:validator>
</aui:input></td>
<td><aui:input name="preferences--application3-Url--"
type="text" cssClass="text long-field" showRequiredLabel="true"
label="URL of the VRE 3" inlineField="true" inlineLabel="left"
placeholder="url" helpMessage="URL" value="<%=application3Url%>"
required="false">
</aui:input></td>
</tr>
</table>
</aui:field-wrapper>
<aui:button-row>
<aui:button type="submit" />
</aui:button-row>
</aui:form>

@ -0,0 +1,19 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %>
<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme" %>
<%@ page import="com.liferay.portal.kernel.util.Constants" %>
<%@ page import="com.liferay.portal.kernel.util.GetterUtil" %>
<%@ page import="com.liferay.portal.kernel.util.StringPool" %>
<%@ page import="com.liferay.portlet.journal.model.JournalArticle" %>
<%@ page import="com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil" %>
<%@ page import="com.liferay.portal.kernel.xml.Document" %>
<%@ page import="com.liferay.portal.kernel.xml.Node" %>
<%@ page import="com.liferay.portal.kernel.xml.SAXReaderUtil" %>
<%@ page import="com.liferay.portal.kernel.util.HtmlUtil" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<liferay-theme:defineObjects />
<portlet:defineObjects />

@ -0,0 +1,137 @@
<%@include file="init.jsp"%>
<%
long groupId = themeDisplay.getLayout().getGroupId();
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));
pageContext.setAttribute("application1Url",
GetterUtil.getString(portletPreferences.getValue("application1-Url", StringPool.BLANK)));
pageContext.setAttribute("application2Url",
GetterUtil.getString(portletPreferences.getValue("application2-Url", StringPool.BLANK)));
pageContext.setAttribute("application3Url",
GetterUtil.getString(portletPreferences.getValue("application3-Url", StringPool.BLANK)));
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();
}
%>
<c:if test="${not empty applicationName1Title}">
<div class="asset-abstract">
<h3 class="asset-title">
<a href="${application1Url}"><img alt="" src="${icondocURL}">
${applicationName1Title}</a>
</h3>
<div class="asset-content">
<div class="asset-summary" style="margin-left: 25px;">
<span id="asset-app-summarypre1"> <%
if (content1.length() > 225)
out.println(HtmlUtil.stripHtml(content1.substring(0, 222) + " ..."));
%>
<div>
<a
href="javascript:switchView('#asset-app-summarypre1', '#asset-app-summary-1');">Read
More » </a>
</div>
</span>
<div class="asset-more">
<div id="asset-app-summary-1" class="asset-summary"
style="display: none;"><%=content1%></div>
</div>
</div>
<div class="asset-metadata"></div>
</div>
</div>
</c:if>
<c:if test="${not empty applicationName2Title}">
<!-- SECOND -->
<div class="asset-abstract">
<h3 class="asset-title">
<a href="${application2Url}"><img alt="" src="${icondocURL}">
${applicationName2Title}</a>
</h3>
<div class="asset-content">
<div class="asset-summary" style="margin-left: 25px;">
<span id="asset-app-summarypre2"> <%
if (content2.length() > 225)
out.println(HtmlUtil.stripHtml(content2.substring(0, 222) + " ..."));
%>
<div>
<a
href="javascript:switchView('#asset-app-summarypre2', '#asset-app-summary-2');">Read
More » </a>
</div>
</span>
<div class="asset-more">
<div id="asset-app-summary-2" class="asset-summary"
style="display: none;"><%=content2%></div>
</div>
</div>
<div class="asset-metadata"></div>
</div>
</div>
</c:if>
<c:if test="${not empty applicationName3Title}">
<!-- THIRD -->
<div class="asset-abstract">
<h3 class="asset-title">
<a href="${application3Url}"><img alt="" src="${icondocURL}">
${applicationName3Title}</a>
</h3>
<div class="asset-content">
<div class="asset-summary" style="margin-left: 25px;">
<span id="asset-app-summarypre3"> <%
if (content3.length() > 225)
out.println(HtmlUtil.stripHtml(content3.substring(0, 222) + " ..."));
%>
<div>
<a
href="javascript:switchView('#asset-app-summarypre3', '#asset-app-summary-3');">Read
More » </a>
</div>
</span>
<div class="asset-more">
<div id="asset-app-summary-3" class="asset-summary"
style="display: none;"><%=content3%></div>
</div>
</div>
<div class="asset-metadata"></div>
</div>
</div>
</c:if>

@ -9,11 +9,17 @@
<portlet:defineObjects />
<liferay-theme:defineObjects />
<% if(SessionErrors.contains(renderRequest.getPortletSession(),"experiment-form-error")){%>
<liferay-ui:error key="experiment-form-error" message="Experiment idea form submit had an issue, Please try again." />
<%} %>
<%
if (SessionErrors.contains(renderRequest.getPortletSession(), "experiment-form-error")) {
%>
<liferay-ui:error key="experiment-form-error"
message="Experiment idea form submit had an issue, Please try again." />
<%
}
%>
<portlet:actionURL var="addIdeaActionURL" windowState="maximized" name="addIdea">
<portlet:actionURL var="addIdeaActionURL" windowState="maximized"
name="addIdea">
</portlet:actionURL>
<portlet:renderURL var="maximizedState"
@ -35,6 +41,14 @@
<c:otherwise>
<a class="btn btn-link btn-large" href="${normalState}"><i
class="icon icon-angle-left"></i>&nbsp;Back (Cancel)</a>
<p style="font-size: 15px; padding: 15px;">Please give us a description about the
dataset/method you want to insert in the catalogue. The SoBigData
research, technical and ethical boards will evaluate your application
before the actual upload. In particular, in case of datasets, please
visit also our <a href="http://146.48.83.51/moodle" target="_blank">
First aid for Responsible data Scientists</a>: we
provide resources and information to understand and check possible
ethical issues for your dataset.</p>
<div
style="width: 100%; text-align: left; padding: 10px; color: #3B5998;">
<aui:form action="<%=addIdeaActionURL%>" method="post" name="fm">
@ -50,7 +64,8 @@
<aui:input name="experiment_tags" label="Keywords (Comma separated)"
value="" required="false" style="width:90%;" />
<aui:button-row>
<a class="btn" href="${normalState}"><i class="icon-remove"></i> Cancel</a>
<a class="btn" href="${normalState}"><i class="icon-remove"></i>
Cancel</a>
<aui:button type="submit" value="Submit" />
</aui:button-row>
</aui:form>

@ -46,13 +46,24 @@
<a class="btn btn-link" href="${maximizedState}"><i
class="icon icon-cloud-upload icon-3x"></i></a>
</div>
</c:when>
<c:otherwise>
<a class="btn btn-link btn-large" href="${normalState}"><i
class="icon icon-angle-left"></i>&nbsp;Back (Cancel)</a>
<p style="font-size: 15px; padding: 15px;">
Please give us a description about the dataset/method you want to
insert in the catalogue. The SoBigData research, technical and
ethical boards will evaluate your application before the actual
upload. In particular, in case of datasets, please visit also our <a
href="http://146.48.83.51/moodle" target="_blank"> First aid for
Responsible data Scientists</a>: we provide resources and information to
understand and check possible ethical issues for your dataset.
</p>
<div
style="width: 100%; text-align: left; padding: 10px; color: #3B5998;">
<aui:form action="<%=addExperimentActionURL%>" method="post" name="fm">
<aui:form action="<%=addExperimentActionURL%>" method="post"
name="fm">
<aui:input name="method_name" label="Dataset/Method name" value=""
required="true" style="width:90%;" />
<aui:input type="textarea" rows="3" name="people_institutions"
@ -61,9 +72,11 @@
<aui:input type="textarea" rows="10" name="demo_tutorial"
label="Description + Demo/Tutorial, 2 pages max" value=""
required="true" style="width:90%;" />
<span> Additional Material:</span>
<a class="btn btn-primary"
href="javascript:showWPPopup('<%=wpExplorerPopupURL%>');" style="margin: 10px 0;"><i
class="icon-paper-clip icon-white"></i> Select file to attach</a>
href="javascript:showWPPopup('<%=wpExplorerPopupURL%>');"
style="margin: 10px 0;"><i class="icon-paper-clip icon-white"></i>
Select file to attach</a>
<div id="attachedFiles"></div>
<aui:input name="experiment_tags" label="Keywords (Comma separated)"
value="" required="false" style="width:90%;" />
@ -72,7 +85,8 @@
Cancel</a>
<aui:button type="submit" value="Submit" />
</aui:button-row>
<p>Please note: depending on the number of attachments it could take some time (seconds) to submit the request.</p>
<p>Please note: depending on the number of attachments it could
take some time (seconds) to submit the request.</p>
</aui:form>
</div>
</c:otherwise>

Loading…
Cancel
Save