Massimiliano Assante 8 years ago
parent 0c2ba66188
commit 565b82ba8d

@ -0,0 +1 @@
{"ide":{"scriptPaths":[]},"plugins":{"aui":{},"liferay":{},"yui":{}},"libs":["ecma5","browser"]}

@ -1,11 +1,8 @@
package org.gcube.portlets.user.gcubeloggedin.client; package org.gcube.portlets.user.gcubeloggedin.client;
import org.gcube.portlets.user.gcubeloggedin.client.ui.AboutView; import org.gcube.portlets.user.gcubeloggedin.client.ui.AboutView;
import org.gcube.portlets.user.gcubeloggedin.client.ui.LoadingText;
import org.gcube.portlets.user.gcubeloggedin.shared.VObject; import org.gcube.portlets.user.gcubeloggedin.shared.VObject;
import com.github.gwtbootstrap.client.ui.Hero;
import com.github.gwtbootstrap.client.ui.Paragraph;
import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window.Location; import com.google.gwt.user.client.Window.Location;

@ -6,6 +6,10 @@ import org.gcube.portlets.user.gcubeloggedin.shared.VREClient;
import org.gcube.portlets.widgets.sessionchecker.client.CheckSession; import org.gcube.portlets.widgets.sessionchecker.client.CheckSession;
import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.Heading;
import com.github.gwtbootstrap.client.ui.Hero;
import com.github.gwtbootstrap.client.ui.Image;
import com.github.gwtbootstrap.client.ui.Paragraph;
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler;
import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickEvent;
@ -17,16 +21,16 @@ import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window; import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.Location; import com.google.gwt.user.client.Window.Location;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.Widget;
public class AboutView extends Composite { public class AboutView extends Composite {
private static int MAX_CHAR_DESC = 700; private static int MAX_CHAR_DESC = 400;
private static String SEE_LESS = "See less";
private static String SEE_MORE = "See more";
private static AboutViewUiBinder uiBinder = GWT private static AboutViewUiBinder uiBinder = GWT
.create(AboutViewUiBinder.class); .create(AboutViewUiBinder.class);
@ -38,31 +42,33 @@ public class AboutView extends Composite {
} }
private WarningAlert wa; private WarningAlert wa;
private String vreDescription; private String vreDescription;
private String vreImage; @UiField Image vreImage;
@UiField HTMLPanel htmlPanel; @UiField Heading vreName;
@UiField HTML description; @UiField HTML description;
@UiField Anchor backButton;
@UiField Anchor leaveButton;
@UiField Button seeMore; @UiField Button seeMore;
@UiField Button leaveButton;
@UiField Hero mainPanel;
private LoggedinServiceAsync loggedinService; private LoggedinServiceAsync loggedinService;
public AboutView(VObject vobj, LoggedinServiceAsync loggedinService) { public AboutView(VObject vobj, LoggedinServiceAsync loggedinService) {
initWidget(uiBinder.createAndBindUi(this)); initWidget(uiBinder.createAndBindUi(this));
this.loggedinService = loggedinService; this.loggedinService = loggedinService;
vreImage = vobj.getImageURL(); this.vreDescription = vobj.getDescription();
vreName.setText(vobj.getName());
vreImage.setUrl(vobj.getImageURL());
String desc = vreDescription = vobj.getDescription(); String desc = vreDescription = vobj.getDescription();
if (desc.length() > MAX_CHAR_DESC) { if (desc.length() > MAX_CHAR_DESC) {
desc = desc.substring(0, MAX_CHAR_DESC) + " ..."; desc = desc.substring(0, MAX_CHAR_DESC) + " ...";
//description.getElement().setInnerHTML(desc);
description.setHTML(desc);
description.addStyleName("vre-description");
seeMore.setVisible(true); seeMore.setVisible(true);
seeMore.setText(SEE_MORE);
} }
description.setHTML("<img class=\"imageVRE\" src=\"" + vreImage + "\" />" + desc);
leaveButton.setStyleName("leave-group");
if (vobj instanceof VREClient && !vobj.isMandatory()) { if (vobj instanceof VREClient && !vobj.isMandatory()) {
leaveButton.setVisible(true);
wa = new WarningAlert("Are you sure you want to leave this group? " wa = new WarningAlert("Are you sure you want to leave this group? "
+ "By leaving this group you will no longer receive updates and lose the workspace folder related to the group.", this); + "By leaving this group you will no longer receive updates and lose the workspace folder related to the group.", this);
} }
@ -76,30 +82,32 @@ public class AboutView extends Composite {
} }
} }
boolean open = false;
@UiHandler("seeMore") @UiHandler("seeMore")
void onSeeMoreClick(ClickEvent e) { void onSeemore(ClickEvent e) {
description.setHTML("<img class=\"imageVRE\" src=\"" + vreImage + "\" />" + vreDescription); GWT.log(seeMore.getText());
seeMore.removeFromParent(); if (!open) {
} description.setHTML(vreDescription);
seeMore.setText(SEE_LESS);
@UiHandler("backButton") open = true;
void onClick(ClickEvent e) { } else {
description.setHTML(vreDescription.substring(0, MAX_CHAR_DESC) + " ...");
seeMore.setText(SEE_MORE);
open = false;
}
} }
@UiHandler("leaveButton") @UiHandler("leaveButton")
void onUnsubscribe(ClickEvent e) { void onUnsubscribe(ClickEvent e) {
mainPanel.add(wa);
htmlPanel.add(wa);
} }
protected void abandonGroup() { protected void abandonGroup() {
htmlPanel.remove(wa); mainPanel.remove(wa);
final Widget loading = getLoadingHTML(); final Widget loading = getLoadingHTML();
htmlPanel.add(loading); mainPanel.add(loading);
loggedinService.removeUserFromVRE(new AsyncCallback<String>() { loggedinService.removeUserFromVRE(new AsyncCallback<String>() {
@Override @Override
public void onSuccess(String result) { public void onSuccess(String result) {
@ -111,7 +119,7 @@ public class AboutView extends Composite {
} }
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
htmlPanel.remove(loading); mainPanel.remove(loading);
Window.alert("We're sorry we couldn't reach the server, try again later ... " + caught.getMessage()); Window.alert("We're sorry we couldn't reach the server, try again later ... " + caught.getMessage());
} }
}); });

@ -1,19 +1,20 @@
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent"> <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui"> xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
<b:Hero ui:field="mainPanel">
<b:Image ui:field="vreImage" />
<!-- The Caption is optional -->
<b:Caption>
<b:Heading size="3" ui:field="vreName">Thumbnail label</b:Heading>
<g:HTML ui:field="description">
</g:HTML>
<g:HTMLPanel ui:field="htmlPanel" styleName="envhome-frame"> <b:ControlGroup>
<div id="vre-header-container"> <b:Paragraph>
<ul id="vre-header"> <b:Button type="LINK" visible="false" ui:field="seeMore">See more</b:Button>
<li> <b:Button type="LINK" visible="false" ui:field="leaveButton">Leave this group</b:Button>
<g:Anchor ui:field="backButton" href="#"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></g:Anchor> </b:Paragraph>
</li> </b:ControlGroup>
<li id="removable-item-li"> </b:Caption>
<g:Anchor ui:field="leaveButton" href="#">Leave Group</g:Anchor> </b:Hero>
</li>
</ul>
</div>
<g:HTML ui:field="description" styleName="description"></g:HTML>
<b:Button ui:field="seeMore" type="LINK" visible="false" >See more</b:Button>
</g:HTMLPanel>
</ui:UiBinder> </ui:UiBinder>

@ -79,9 +79,17 @@ public class LoggedinServiceImpl extends RemoteServiceServlet implements Loggedi
String friendlyURL = ScopeServiceImpl.extractOrgFriendlyURL(portalURL); String friendlyURL = ScopeServiceImpl.extractOrgFriendlyURL(portalURL);
if (friendlyURL == null) {//the URL is not a portal URL, we are in devmode. if (friendlyURL == null) {//the URL is not a portal URL, we are in devmode.
return new VREClient("Test", "", "" + return new VREClient("Test VRE Name", "", "" +
"Fishery and Aquaculture Resources Management (FARM) Virtual Organisation</b> The FARM Virtual Organisation is the <b><i>dynamic group of individuals</i></b> and/or <b><i>institutions</i></b> defined around a set of <b><i>sharing rules</i></b> in which <b><i>resource providers</i></b> and <b><i>consumers</i></b> specify clearly and carefully just what is shared, who is allowed to share, and the conditions under which sharing occurs to serve the needs of the <b><i>Fisheries and Aquaculture Resources Management</i></b>. This VO is conceived to support various application scenarios arising in the FARM Community including the production of Fisheries and Aquaculture Country Profiles, the management of catch statistics including harmonisation, the dynamic generation of biodiversity maps and species distribution maps. This Virtual Organisation currently consists of:<ul> <li> approximately <b><i>13 gCube nodes</i></b>, i.e. machines dedicated to run the gCube system;</li> <li> approximately <b><i>89 running instances</i></b>, i.e. running gCube services supporting the operation of the infrastructure;</li> <li> approximately <b><i>25 collections</i></b>, i.e. set of D4Science Information Objects including Earth images, AquaMaps, Graphs on catch statistics;</li> <li> approximately <b><i>66 metadata collections</i></b>, i.e. set of Metadata Objects describing the Information Objects through various features and schemas;</li> <li> approximately <b><i>58 other resources</i></b> including transformation programs, index types, etc.</li></ul></div>" + "Fishery and Aquaculture Resources Management (FARM) Virtual Organisation</b> The FARM Virtual Organisation is the <b><i>dynamic group of individuals</i></b> and/or <b><i>institutions</i></b> defined around a set of <b><i>sharing rules</i></b> in which <b><i>resource providers</i></b> and <b><i>consumers</i></b> specify clearly and carefully just what is shared, who is allowed to share, and the conditions under which sharing occurs to serve the needs of the <b><i>Fisheries and Aquaculture Resources Management</i></b>. "
"", "", "", UserBelongingClient.BELONGING, false, true); + " This VO is conceived to support various application scenarios arising in the FARM Community including the production of Fisheries and Aquaculture Country Profiles, "
+ "the management of catch statistics including harmonisation, the dynamic generation of biodiversity maps and species distribution maps."
+ " This Virtual Organisation currently consists of:<ul> <li> approximately <b><i>13 gCube nodes</i></b>, "
+ "i.e. machines dedicated to run the gCube system;</li> "
+ " <li> approximately <b><i>89 running instances</i></b>, i.e. running gCube services supporting the operation of the infrastructure;</li> "
+ " <li> approximately <b><i>25 collections</i></b>, i.e. set of D4Science Information Objects including Earth images, AquaMaps, Graphs on catch statistics;</li> "
+ " <li> approximately <b><i>66 metadata collections</i></b>, i.e. set of Metadata Objects describing the Information Objects through various features and schemas;</li> "
+ " <li> approximately <b><i>58 other resources</i></b> including transformation programs, index types, etc.</li></ul></div>"
, "http://placehold.it/300x200", "", UserBelongingClient.BELONGING, false, true);
} }
_log.trace("getting Selected Research Environment"); _log.trace("getting Selected Research Environment");
GroupManager gm = new LiferayGroupManager(); GroupManager gm = new LiferayGroupManager();

@ -1,70 +1,10 @@
/** Add css rules here for your application. */ #LoggedinDiv div.hero-unit {
padding: 0 10px;
#vre-header-container { background-color: #fff;
border-bottom: 1px solid #ccc; margin: 0;
}
#vre-header-container ul {
margin: 6px 2px 0px;
padding: 1px;
height: 23px;
}
#vre-header li {
display: inline;
list-style-type: none;
border-right: 1px solid #ccc;
padding: 7px 20px 4px;
} }
#vre-header li a { div.gwt-HTML.vre-description {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 14px; font-size: 14px;
color: #666; line-height: 22px;
text-decoration: none;
} }
#vre-header li a span {
background-image: url('images/home.png');
background-repeat: no-repeat;
background-position: 50% 80%;
}
#vre-header li a:hover {
color: #A94440;
opacity: 0.8;
}
.description {
padding: 10px;
}
table {
border-collapse: separate !important;
border-spacing: 0;
}
.envhome-frame {
background: #FFF;
border-radius: 6px !important;
-moz-border-radius: 6px !important;
-webkit-border-radius: 6px !important;
border: 1px solid #DBDBDB;
}
.imageVRE {
float: left;
width: 150px;
margin-right: 5px;
}
.leaveButton {
border: 1px solid #EBCCD1;
border-radius: 4px;
margin: 20px;
padding: 15px;
background-color: #F2DEDE;
color: #A94440;
font-family: 'Helvetica Neue', Arial, sans-serif;
font-size: 14px;
}
Loading…
Cancel
Save