From 61b2a2b0e588c296bf96100958ab75c50cdb2f7d Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Sun, 4 Feb 2018 18:29:04 +0000 Subject: [PATCH] share idea completed, upload dataset ongoing with workspace integration git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portal/sbd-uploadshare-portlet@162897 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../user/sbdportlets/UploadDataset.java | 2 +- src/main/webapp/WEB-INF/liferay-portlet.xml | 8 +- src/main/webapp/html/uploaddataset/view.jsp | 78 ++++++++++++++++++- src/main/webapp/js/main.js | 31 ++++++++ src/main/webapp/view.jsp | 21 ----- 5 files changed, 108 insertions(+), 32 deletions(-) delete mode 100644 src/main/webapp/view.jsp diff --git a/src/main/java/org/gcube/portlets/user/sbdportlets/UploadDataset.java b/src/main/java/org/gcube/portlets/user/sbdportlets/UploadDataset.java index c682095..6b81268 100644 --- a/src/main/java/org/gcube/portlets/user/sbdportlets/UploadDataset.java +++ b/src/main/java/org/gcube/portlets/user/sbdportlets/UploadDataset.java @@ -8,6 +8,6 @@ import com.liferay.util.bridges.mvc.MVCPortlet; * Portlet implementation class UploadDataset */ public class UploadDataset extends MVCPortlet { - + } diff --git a/src/main/webapp/WEB-INF/liferay-portlet.xml b/src/main/webapp/WEB-INF/liferay-portlet.xml index eef58ba..a024f46 100644 --- a/src/main/webapp/WEB-INF/liferay-portlet.xml +++ b/src/main/webapp/WEB-INF/liferay-portlet.xml @@ -2,15 +2,10 @@ - - SBD-UploadAndSharePortlets - /icon.png - /css/main.css - /js/main.js - upload-dataset /icon.png + false /css/main.css /js/main.js @@ -20,6 +15,7 @@ collaborate-with-us /icon.png + false /css/main.css /js/main.js diff --git a/src/main/webapp/html/uploaddataset/view.jsp b/src/main/webapp/html/uploaddataset/view.jsp index 94d448e..299c47d 100644 --- a/src/main/webapp/html/uploaddataset/view.jsp +++ b/src/main/webapp/html/uploaddataset/view.jsp @@ -1,7 +1,77 @@ <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%> +<%@ 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/ui" prefix="liferay-ui"%> +<%@ taglib uri="http://liferay.com/tld/theme" prefix="liferay-theme"%> +<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> +<%@page import="com.liferay.portal.kernel.servlet.SessionErrors"%> +<%@ taglib uri="http://liferay.com/tld/portlet" prefix="liferay-portlet" %> -
- -
\ No newline at end of file + +<% String wpExplorerId = "workspaceexplorerportlet_WAR_workspaceexplorerportlet"; %> + +<% if(SessionErrors.contains(renderRequest.getPortletSession(),"dataset-form-error")){%> + +<%} %> + + + + + + + + + + + +
+ + +Open Workspace + + + +
+ +
+
+ +  Back (Cancel) +
+ + + + + + + + Cancel + + + +
+
+ +
+ + + diff --git a/src/main/webapp/js/main.js b/src/main/webapp/js/main.js index e69de29..7c73b07 100644 --- a/src/main/webapp/js/main.js +++ b/src/main/webapp/js/main.js @@ -0,0 +1,31 @@ +//open the url in a liferay popup +function showWPPopup(url) { + var url = url; + // this is one way of calling a pop-up in liferay + // this way is specific to liferay + Liferay.Util.openWindow( + { + dialog: { + cache: false, + width:600, + height: 450, + modal: true + }, + id: 'testPopupIdUnique', + uri: url + } + ); +} + +function closeWPPopup() { + var dialog = Liferay.Util.getWindow('testPopupIdUnique'); + dialog.destroy(); // You can try toggle/hide whatever You want +} + +function fireEvent(eventName, eventValue) { + Liferay.Util.getOpener().Liferay.fire('getUserData',{ + name: eventValue + }); + console.log('fireEvent:done'); + closeWPPopup(); +} diff --git a/src/main/webapp/view.jsp b/src/main/webapp/view.jsp deleted file mode 100644 index 010ab44..0000000 --- a/src/main/webapp/view.jsp +++ /dev/null @@ -1,21 +0,0 @@ -<%-- -/** - * 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. - */ ---%> - -<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> - - - -This is the SBD-UploadAndSharePortlets. \ No newline at end of file