added ToU display for Invites
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/join-vre@150734 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
278159a4df
commit
1ae3bf20cf
|
@ -1,12 +1,12 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" output="target/join-vre-3.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
<classpathentry kind="src" output="target/join-vre-3.4.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry excluding="**" kind="src" output="target/join-vre-3.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/join-vre-3.4.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -34,10 +34,10 @@
|
||||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/join-vre-3.3.0-SNAPSHOT/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/join-vre-3.4.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.7
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
org.eclipse.jdt.core.compiler.source=1.7
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
|
|
|
@ -4,6 +4,12 @@
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
|
<dependent-module archiveName="email-templates-library-1.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/email-templates-library/email-templates-library">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
|
<dependent-module archiveName="invites-common-library-1.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/invites-common-library/invites-common-library">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
|
||||||
<property name="context-root" value="join-vre"/>
|
<property name="context-root" value="join-vre"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<faceted-project>
|
<faceted-project>
|
||||||
<fixed facet="wst.jsdt.web"/>
|
<fixed facet="wst.jsdt.web"/>
|
||||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||||
<installed facet="java" version="1.7"/>
|
|
||||||
<installed facet="liferay.portlet" version="6.0"/>
|
<installed facet="liferay.portlet" version="6.0"/>
|
||||||
<installed facet="jst.web" version="3.0"/>
|
<installed facet="jst.web" version="3.0"/>
|
||||||
|
<installed facet="java" version="1.8"/>
|
||||||
</faceted-project>
|
</faceted-project>
|
||||||
|
|
15
pom.xml
15
pom.xml
|
@ -13,7 +13,7 @@
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>join-vre</artifactId>
|
<artifactId>join-vre</artifactId>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
<version>3.3.0-SNAPSHOT</version>
|
<version>3.4.0-SNAPSHOT</version>
|
||||||
<name>gCube Join VRE Portlet</name>
|
<name>gCube Join VRE Portlet</name>
|
||||||
<description>Display the available VRE to Join</description>
|
<description>Display the available VRE to Join</description>
|
||||||
<scm>
|
<scm>
|
||||||
|
@ -23,9 +23,9 @@
|
||||||
</scm>
|
</scm>
|
||||||
<properties>
|
<properties>
|
||||||
<!-- Convenience property to set the GWT version -->
|
<!-- Convenience property to set the GWT version -->
|
||||||
<gwtVersion>2.7.0</gwtVersion>
|
<gwtVersion>2.8.1</gwtVersion>
|
||||||
<distroDirectory>distro</distroDirectory>
|
<distroDirectory>distro</distroDirectory>
|
||||||
<maven.compiler.source>1.7</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
|
||||||
<liferay.version>6.2.5</liferay.version>
|
<liferay.version>6.2.5</liferay.version>
|
||||||
|
@ -62,10 +62,9 @@
|
||||||
<version>[1.0.0-SNAPSHOT,)</version>
|
<version>[1.0.0-SNAPSHOT,)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.gwt</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>gwt-dev</artifactId>
|
<artifactId>terms-of-use-library</artifactId>
|
||||||
<version>${gwtVersion}</version>
|
<version>[1.0.0-SNAPSHOT,)</version>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google</groupId>
|
<groupId>com.google</groupId>
|
||||||
|
@ -93,7 +92,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.core</groupId>
|
<groupId>org.gcube.core</groupId>
|
||||||
<artifactId>common-scope-maps</artifactId>
|
<artifactId>common-scope-maps</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.dvos</groupId>
|
<groupId>org.gcube.dvos</groupId>
|
||||||
|
|
|
@ -29,5 +29,7 @@ public interface JoinService extends RemoteService {
|
||||||
|
|
||||||
String isExistingInvite(long siteId);
|
String isExistingInvite(long siteId);
|
||||||
|
|
||||||
UserInfo readInvite(String inviteId);
|
String getTermsOfUse(long siteId);
|
||||||
|
|
||||||
|
UserInfo readInvite(String inviteId, long siteId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,5 +28,7 @@ public interface JoinServiceAsync {
|
||||||
|
|
||||||
void isExistingInvite(long siteId, AsyncCallback<String> callback);
|
void isExistingInvite(long siteId, AsyncCallback<String> callback);
|
||||||
|
|
||||||
void readInvite(String inviteId, AsyncCallback<UserInfo> callback);
|
void readInvite(String inviteId, long siteId, AsyncCallback<UserInfo> callback);
|
||||||
|
|
||||||
|
void getTermsOfUse(long siteId, AsyncCallback<String> callback);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,13 +9,16 @@ import com.github.gwtbootstrap.client.ui.HelpBlock;
|
||||||
import com.github.gwtbootstrap.client.ui.Icon;
|
import com.github.gwtbootstrap.client.ui.Icon;
|
||||||
import com.github.gwtbootstrap.client.ui.Modal;
|
import com.github.gwtbootstrap.client.ui.Modal;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.dom.client.Element;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.uibinder.client.UiHandler;
|
import com.google.gwt.uibinder.client.UiHandler;
|
||||||
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.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
public class AccessVREDialog extends Composite {
|
public class AccessVREDialog extends Composite {
|
||||||
|
@ -30,25 +33,59 @@ public class AccessVREDialog extends Composite {
|
||||||
@UiField Button close;
|
@UiField Button close;
|
||||||
@UiField Button confirmRequest;
|
@UiField Button confirmRequest;
|
||||||
@UiField HelpBlock helpBlock;
|
@UiField HelpBlock helpBlock;
|
||||||
|
@UiField HelpBlock touGatewayBlock;
|
||||||
@UiField Icon loading;
|
@UiField Icon loading;
|
||||||
|
@UiField HTML touText;
|
||||||
|
|
||||||
VRE myVRE = null;
|
VRE myVRE = null;
|
||||||
public AccessVREDialog(final VRE vre) {
|
public AccessVREDialog(final VRE vre) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
this.myVRE = vre;
|
this.myVRE = vre;
|
||||||
|
|
||||||
String text = "You are about to enter the " + vre.getName() + ", please confirm your request.";
|
|
||||||
helpBlock.setText(text);
|
|
||||||
String buttonText = "Confirm Request";
|
|
||||||
confirmRequest.setText(buttonText);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void show() {
|
public void show() {
|
||||||
String headerText = "Join VRE request for " + myVRE.getName();
|
joinService.getTermsOfUse(this.myVRE.getId(), new AsyncCallback<String>() {
|
||||||
m.setTitle(headerText);
|
@Override
|
||||||
m.show();
|
public void onFailure(Throwable caught) {
|
||||||
|
m.setTitle("Ops, an error occurred please check your connection and try again");
|
||||||
|
confirmRequest.setText("Try again");
|
||||||
|
confirmRequest.addClickHandler(new ClickHandler() {
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
Location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
m.show();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onSuccess(String result) {
|
||||||
|
if (result == null) { //no terms of use
|
||||||
|
String headerText = "Join VRE request for " + myVRE.getName();
|
||||||
|
String text = "You are about to enter " + myVRE.getName() + ", please confirm your request.";
|
||||||
|
m.setTitle(headerText);
|
||||||
|
helpBlock.setHTML(text);
|
||||||
|
touGatewayBlock.setVisible(true);
|
||||||
|
String buttonText = "Confirm Request";
|
||||||
|
confirmRequest.setText(buttonText);
|
||||||
|
}
|
||||||
|
else {// terms of use exist
|
||||||
|
String headerText = "Terms of Use for " + myVRE.getName();
|
||||||
|
String text = "By using <b>" + myVRE.getName() + "</b> VRE services, you are agreeing to these terms. Please read them carefully:";
|
||||||
|
m.setTitle(headerText);
|
||||||
|
helpBlock.setHTML(text);
|
||||||
|
String buttonText = "Accept Terms of Use";
|
||||||
|
confirmRequest.setText(buttonText);
|
||||||
|
m.addStyleName("modal-custom");
|
||||||
|
((Element)m.getElement().getChildNodes().getItem(1)).addClassName("modal-body-custom");
|
||||||
|
touText.setHTML(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
m.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@UiHandler("close")
|
@UiHandler("close")
|
||||||
void handleClick(ClickEvent e) {
|
void handleClick(ClickEvent e) {
|
||||||
m.hide();
|
m.hide();
|
||||||
|
@ -59,12 +96,12 @@ public class AccessVREDialog extends Composite {
|
||||||
loading.setVisible(true);
|
loading.setVisible(true);
|
||||||
confirmRequest.setEnabled(false);
|
confirmRequest.setEnabled(false);
|
||||||
joinService.registerUser(myVRE.getinfraScope(), myVRE.getId(), IS_INVITATION, new AsyncCallback<Boolean>() {
|
joinService.registerUser(myVRE.getinfraScope(), myVRE.getId(), IS_INVITATION, new AsyncCallback<Boolean>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Boolean result) {
|
public void onSuccess(Boolean result) {
|
||||||
Location.assign(myVRE.getFriendlyURL());
|
Location.assign(myVRE.getFriendlyURL());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
confirmRequest.removeFromParent();
|
confirmRequest.removeFromParent();
|
||||||
|
|
|
@ -8,15 +8,15 @@
|
||||||
<b:HelpBlock ui:field="helpBlock"></b:HelpBlock>
|
<b:HelpBlock ui:field="helpBlock"></b:HelpBlock>
|
||||||
<b:Icon type="COG" size="FOUR_TIMES" spin="true" ui:field="loading"
|
<b:Icon type="COG" size="FOUR_TIMES" spin="true" ui:field="loading"
|
||||||
visible="false" />
|
visible="false" />
|
||||||
<b:HelpBlock>
|
<b:HelpBlock ui:field="touGatewayBlock" visible="false">
|
||||||
By entering this VRE you agree to the terms indicated in the
|
By entering this VRE you agree to the terms indicated in the
|
||||||
<a href="/terms-of-use" target="_blank">Terms of Use</a>
|
<a href="/terms-of-use" target="_blank">Terms of Use</a>
|
||||||
of this gateway.
|
of this gateway.
|
||||||
</b:HelpBlock>
|
</b:HelpBlock>
|
||||||
|
<g:HTML ui:field="touText"></g:HTML>
|
||||||
<b:ModalFooter>
|
<b:ModalFooter>
|
||||||
<b:Button type="PRIMARY" ui:field="confirmRequest">Confirm Request</b:Button>
|
<b:Button type="PRIMARY" ui:field="confirmRequest">Confirm Request</b:Button>
|
||||||
<b:Button type="DEFAULT" ui:field="close">Close</b:Button>
|
<b:Button type="DEFAULT" ui:field="close">Cancel</b:Button>
|
||||||
</b:ModalFooter>
|
</b:ModalFooter>
|
||||||
</b:Modal>
|
</b:Modal>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.github.gwtbootstrap.client.ui.Image;
|
||||||
import com.github.gwtbootstrap.client.ui.Modal;
|
import com.github.gwtbootstrap.client.ui.Modal;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.dom.client.Element;
|
||||||
import com.google.gwt.event.dom.client.ClickEvent;
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
|
@ -19,6 +20,7 @@ import com.google.gwt.uibinder.client.UiHandler;
|
||||||
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.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
public class AccessViaInviteDialog extends Composite {
|
public class AccessViaInviteDialog extends Composite {
|
||||||
|
@ -27,11 +29,13 @@ public class AccessViaInviteDialog extends Composite {
|
||||||
private static AccessViaInviteDialogUiBinder uiBinder = GWT.create(AccessViaInviteDialogUiBinder.class);
|
private static AccessViaInviteDialogUiBinder uiBinder = GWT.create(AccessViaInviteDialogUiBinder.class);
|
||||||
|
|
||||||
interface AccessViaInviteDialogUiBinder extends
|
interface AccessViaInviteDialogUiBinder extends
|
||||||
UiBinder<Widget, AccessViaInviteDialog> {
|
UiBinder<Widget, AccessViaInviteDialog> {
|
||||||
}
|
}
|
||||||
@UiField Modal m;
|
@UiField Modal m;
|
||||||
@UiField Button close;
|
@UiField Button close;
|
||||||
@UiField Button confirmRequest;
|
@UiField Button confirmRequest;
|
||||||
|
@UiField HelpBlock touGatewayBlock;
|
||||||
|
@UiField HTML touText;
|
||||||
@UiField HelpBlock helpBlock;
|
@UiField HelpBlock helpBlock;
|
||||||
@UiField Icon loading;
|
@UiField Icon loading;
|
||||||
@UiField Image avatarImage;
|
@UiField Image avatarImage;
|
||||||
|
@ -44,18 +48,36 @@ public class AccessViaInviteDialog extends Composite {
|
||||||
helpBlock.setText(text);
|
helpBlock.setText(text);
|
||||||
String buttonText = "Accept invite";
|
String buttonText = "Accept invite";
|
||||||
confirmRequest.setText(buttonText);
|
confirmRequest.setText(buttonText);
|
||||||
|
|
||||||
joinService.readInvite(inviteId, new AsyncCallback<UserInfo>() {
|
joinService.readInvite(inviteId, vre.getId(), new AsyncCallback<UserInfo>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(UserInfo invitingUser) {
|
public void onSuccess(UserInfo invitingUser) {
|
||||||
helpBlock.setText("You have been invited by " +invitingUser.getFullName() + ", to accept the invite, please click on the accept invite button below.");
|
|
||||||
avatarImage.setUrl(invitingUser.getAvatarId());
|
|
||||||
avatarImage.setVisible(true);
|
|
||||||
confirmRequest.setType(ButtonType.PRIMARY);
|
|
||||||
confirmRequest.setEnabled(true);
|
|
||||||
loading.removeFromParent();
|
loading.removeFromParent();
|
||||||
|
if (invitingUser.getAccountURL() == null) { //no terms of use
|
||||||
|
helpBlock.setText("You have been invited by " +invitingUser.getFullName() + ", to accept the invite, please click on the accept invite button below.");
|
||||||
|
avatarImage.setUrl(invitingUser.getAvatarId());
|
||||||
|
avatarImage.setVisible(true);
|
||||||
|
touGatewayBlock.setVisible(true);
|
||||||
|
confirmRequest.setType(ButtonType.PRIMARY);
|
||||||
|
confirmRequest.setEnabled(true);
|
||||||
|
} else {
|
||||||
|
helpBlock.setText("You have been invited by " +invitingUser.getFullName() + ", to accept the invite, please click on the accept invite button below.");
|
||||||
|
avatarImage.setUrl(invitingUser.getAvatarId());
|
||||||
|
avatarImage.setVisible(true);
|
||||||
|
String headerText = "Terms of Use for " + myVRE.getName();
|
||||||
|
String text = "By using <b>" + myVRE.getName() + "</b> VRE services, you are agreeing to these terms. Please read them carefully:";
|
||||||
|
m.setTitle(headerText);
|
||||||
|
touGatewayBlock.setHTML(text);
|
||||||
|
String buttonText = "Accept Terms of Use";
|
||||||
|
confirmRequest.setText(buttonText);
|
||||||
|
confirmRequest.setType(ButtonType.PRIMARY);
|
||||||
|
confirmRequest.setEnabled(true);
|
||||||
|
m.addStyleName("modal-custom");
|
||||||
|
((Element)m.getElement().getChildNodes().getItem(1)).addClassName("modal-body-custom");
|
||||||
|
touText.setHTML(invitingUser.getAccountURL());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
loading.removeFromParent();
|
loading.removeFromParent();
|
||||||
|
@ -79,12 +101,12 @@ public class AccessViaInviteDialog extends Composite {
|
||||||
loading.setVisible(true);
|
loading.setVisible(true);
|
||||||
confirmRequest.setEnabled(false);
|
confirmRequest.setEnabled(false);
|
||||||
joinService.registerUser(myVRE.getinfraScope(), myVRE.getId(), IS_INVITATION, new AsyncCallback<Boolean>() {
|
joinService.registerUser(myVRE.getinfraScope(), myVRE.getId(), IS_INVITATION, new AsyncCallback<Boolean>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Boolean result) {
|
public void onSuccess(Boolean result) {
|
||||||
Location.assign(myVRE.getFriendlyURL());
|
Location.assign(myVRE.getFriendlyURL());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
confirmRequest.removeFromParent();
|
confirmRequest.removeFromParent();
|
||||||
|
|
|
@ -1,19 +1,33 @@
|
||||||
<!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">
|
||||||
|
<ui:style>
|
||||||
|
.circleImage {
|
||||||
|
border-radius: 100px;
|
||||||
|
-webkit-border-radius: 100px;
|
||||||
|
-moz-border-radius: 100px;
|
||||||
|
}
|
||||||
|
.alignCenter {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</ui:style>
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<b:Modal ui:field="m" title="My Modal" backdrop="STATIC"
|
<b:Modal ui:field="m" title="My Modal" backdrop="STATIC"
|
||||||
keyboard="true" animation="true">
|
keyboard="true" animation="true">
|
||||||
<b:HelpBlock ui:field="helpBlock" />
|
<b:HelpBlock ui:field="helpBlock" />
|
||||||
<b:Icon type="COG" size="THREE_TIMES" spin="true" ui:field="loading"
|
<b:Icon type="COG" size="THREE_TIMES" spin="true" ui:field="loading"
|
||||||
visible="true" />
|
visible="true" />
|
||||||
<b:Image ui:field="avatarImage" visible="false" width="150px"></b:Image>
|
<g:SimplePanel addStyleNames="{style.alignCenter}">
|
||||||
<b:HelpBlock>
|
<b:Image ui:field="avatarImage" visible="false" width="150px"
|
||||||
<div style="margin-top: 50px"> </div>
|
addStyleNames="{style.circleImage}"></b:Image>
|
||||||
|
</g:SimplePanel>
|
||||||
|
<b:HelpBlock ui:field="touGatewayBlock" visible="false">
|
||||||
By entering this VRE you agree to the terms indicated in the
|
By entering this VRE you agree to the terms indicated in the
|
||||||
<a href="/terms-of-use" target="_blank">Terms of Use</a>
|
<a href="/terms-of-use" target="_blank">Terms of Use</a>
|
||||||
of this gateway.
|
of this gateway.
|
||||||
</b:HelpBlock>
|
</b:HelpBlock>
|
||||||
|
<g:HTML ui:field="touText"></g:HTML>
|
||||||
|
|
||||||
<b:ModalFooter>
|
<b:ModalFooter>
|
||||||
<b:Button type="DEFAULT" ui:field="confirmRequest" enabled="false"></b:Button>
|
<b:Button type="DEFAULT" ui:field="confirmRequest" enabled="false"></b:Button>
|
||||||
|
|
|
@ -15,6 +15,10 @@ import org.gcube.portal.databook.server.DatabookStore;
|
||||||
import org.gcube.portal.databook.shared.Invite;
|
import org.gcube.portal.databook.shared.Invite;
|
||||||
import org.gcube.portal.databook.shared.InviteStatus;
|
import org.gcube.portal.databook.shared.InviteStatus;
|
||||||
import org.gcube.portal.databook.shared.UserInfo;
|
import org.gcube.portal.databook.shared.UserInfo;
|
||||||
|
import org.gcube.portal.tou.TermsOfUse;
|
||||||
|
import org.gcube.portal.tou.TermsOfUseImpl;
|
||||||
|
import org.gcube.portal.tou.exceptions.ToUNotFoundException;
|
||||||
|
import org.gcube.portal.tou.model.ToU;
|
||||||
import org.gcube.portlets.user.joinvre.client.JoinService;
|
import org.gcube.portlets.user.joinvre.client.JoinService;
|
||||||
import org.gcube.portlets.user.joinvre.shared.UserBelonging;
|
import org.gcube.portlets.user.joinvre.shared.UserBelonging;
|
||||||
import org.gcube.portlets.user.joinvre.shared.VRE;
|
import org.gcube.portlets.user.joinvre.shared.VRE;
|
||||||
|
@ -40,6 +44,7 @@ import com.liferay.portal.kernel.exception.PortalException;
|
||||||
import com.liferay.portal.kernel.exception.SystemException;
|
import com.liferay.portal.kernel.exception.SystemException;
|
||||||
import com.liferay.portal.kernel.log.Log;
|
import com.liferay.portal.kernel.log.Log;
|
||||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||||
|
import com.liferay.portal.kernel.util.WebKeys;
|
||||||
import com.liferay.portal.model.Group;
|
import com.liferay.portal.model.Group;
|
||||||
import com.liferay.portal.model.VirtualHost;
|
import com.liferay.portal.model.VirtualHost;
|
||||||
import com.liferay.portal.service.GroupLocalServiceUtil;
|
import com.liferay.portal.service.GroupLocalServiceUtil;
|
||||||
|
@ -49,7 +54,7 @@ import com.liferay.portal.service.VirtualHostLocalServiceUtil;
|
||||||
import com.liferay.portal.util.PortalUtil;
|
import com.liferay.portal.util.PortalUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
* @author Massimiliano Assante, CNR_ISTI
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class JoinServiceImpl extends RemoteServiceServlet implements JoinService {
|
public class JoinServiceImpl extends RemoteServiceServlet implements JoinService {
|
||||||
|
@ -78,6 +83,47 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserInfo readInvite(final String inviteId, final long siteId) {
|
||||||
|
initStore();
|
||||||
|
try {
|
||||||
|
Invite invite = store.readInvite(inviteId);
|
||||||
|
GCubeUser inviter = new LiferayUserManager().getUserByUsername(invite.getSenderUserId());
|
||||||
|
return new UserInfo(
|
||||||
|
inviter.getUsername(),
|
||||||
|
inviter.getFullname(),
|
||||||
|
inviter.getUserAvatarURL(),
|
||||||
|
"",
|
||||||
|
getTermsOfUse(siteId), // we use accountURL for the terms of use in this case
|
||||||
|
true, false, null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* check if a terms of use exists for the given Site (VRE), returns null is non existent
|
||||||
|
* @return a String containing the ToU to accept or null if no ToU exists
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getTermsOfUse(long siteId) {
|
||||||
|
|
||||||
|
TermsOfUse tou = new TermsOfUseImpl();
|
||||||
|
try {
|
||||||
|
long groupId = new LiferayGroupManager().getGroup(siteId).getGroupId();
|
||||||
|
ToU terms = tou.getToUGroup(groupId);
|
||||||
|
return terms.getContent();
|
||||||
|
}
|
||||||
|
catch (ToUNotFoundException ex) {
|
||||||
|
_log.debug("Terms of Use not found for this VRE id " + siteId);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
_log.error("An error occurred while trying to fetch the ToU for VRE id " + siteId);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param session the Asl Session
|
* @param session the Asl Session
|
||||||
|
@ -244,8 +290,7 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VRE getSelectedVRE(Long groupId) {
|
public VRE getSelectedVRE(Long groupId) {
|
||||||
_log.debug("*getting Selected Research Environment from referral, site id = " + groupId);
|
_log.debug("*getting Selected Research Environment from referral, site id = " + groupId);
|
||||||
|
|
||||||
VRE toReturn = null;
|
VRE toReturn = null;
|
||||||
try {
|
try {
|
||||||
GroupManager gm = new LiferayGroupManager();
|
GroupManager gm = new LiferayGroupManager();
|
||||||
|
@ -373,6 +418,8 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
||||||
LoginServiceUtil.notifyUserSelfRegistration(currUser.getUsername(), scope, getThreadLocalRequest());
|
LoginServiceUtil.notifyUserSelfRegistration(currUser.getUsername(), scope, getThreadLocalRequest());
|
||||||
_log.info("notifyUserSelfRegistration sent");
|
_log.info("notifyUserSelfRegistration sent");
|
||||||
}
|
}
|
||||||
|
new TermsOfUseImpl().hasAcceptedToU(currUser.getUsername(), groupId);
|
||||||
|
_log.info("hasAcceptedToU OK for " + currUser.getUsername());
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -410,23 +457,7 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
||||||
_log.debug("checking if invite exists for " + email + " on " +infraScope);
|
_log.debug("checking if invite exists for " + email + " on " +infraScope);
|
||||||
return store.isExistingInvite(infraScope, email);
|
return store.isExistingInvite(infraScope, email);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public UserInfo readInvite(String inviteId) {
|
|
||||||
initStore();
|
|
||||||
try {
|
|
||||||
Invite invite = store.readInvite(inviteId);
|
|
||||||
GCubeUser inviter = new LiferayUserManager().getUserByUsername(invite.getSenderUserId());
|
|
||||||
return new UserInfo(
|
|
||||||
inviter.getUsername(),
|
|
||||||
inviter.getFullname(),
|
|
||||||
inviter.getUserAvatarURL(),
|
|
||||||
"", "", true, false, null);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -454,4 +485,5 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module rename-to='JoinVRE'>
|
<module rename-to='explore'>
|
||||||
<inherits name='com.google.gwt.user.User' />
|
<inherits name='com.google.gwt.user.User' />
|
||||||
<inherits name="com.google.gwt.logging.Logging" />
|
<inherits name="com.google.gwt.logging.Logging" />
|
||||||
|
|
||||||
<inherits name='com.google.gwt.activity.Activity' />
|
<inherits name='com.google.gwt.activity.Activity' />
|
||||||
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
<inherits name="com.github.gwtbootstrap.Bootstrap" />
|
||||||
<inherits name='org.gcube.portal.databook.GCubeSocialNetworking' />
|
<inherits name='org.gcube.portal.databook.GCubeSocialNetworking' />
|
||||||
<!-- <set-property name="user.agent" value="gecko1_8" /> -->
|
<!-- <set-property name="user.agent" value="gecko1_8" /> -->
|
||||||
|
|
||||||
<!-- Specify the app entry point class. -->
|
<!-- Specify the app entry point class. -->
|
||||||
<entry-point class='org.gcube.portlets.user.joinvre.client.JoinVRE' />
|
<entry-point class='org.gcube.portlets.user.joinvre.client.JoinVRE' />
|
||||||
|
|
||||||
<set-property name="gwt.logging.enabled" value="TRUE" />
|
<set-property name="gwt.logging.enabled" value="TRUE" />
|
||||||
|
|
||||||
<!-- Specify the paths for translatable code -->
|
<!-- Specify the paths for translatable code -->
|
||||||
<source path='client' />
|
<source path='client' />
|
||||||
<source path='shared' />
|
<source path='shared' />
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
@media only screen and (min-width: 800px) {
|
|
||||||
.aui .row-fluid .span3 {
|
|
||||||
width: 19% !important;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -9,14 +9,12 @@
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
|
||||||
<!-- -->
|
|
||||||
<!-- Consider inlining CSS to reduce the number of requested files -->
|
|
||||||
<!-- -->
|
|
||||||
<link type="text/css" rel="stylesheet" href="JoinVRE.css">
|
|
||||||
|
|
||||||
<title>Join VRE Project</title>
|
<title>Join VRE Project</title>
|
||||||
|
|
||||||
<script type="text/javascript" src="JoinVRE/JoinVRE.nocache.js"></script>
|
<link type="text/css" rel="stylesheet" href="explore.css">
|
||||||
|
|
||||||
|
|
||||||
|
<script type="text/javascript" src="explore/explore.nocache.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
<portlet:defineObjects />
|
<portlet:defineObjects />
|
||||||
--%>
|
--%>
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JoinVRE/js/jquery-1.10.1.min.js"></script>
|
<script type="text/javascript" src="<%=request.getContextPath()%>/explore/js/jquery-1.10.1.min.js"></script>
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/JoinVRE/js/bootstrap.min.js"></script>
|
<script type="text/javascript" src="<%=request.getContextPath()%>/explore/js/bootstrap.min.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/JoinVRE/JoinVRE.nocache.js"></script>
|
<script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/explore/explore.nocache.js"></script>
|
||||||
<div id="JoinVRE-Container"></div>
|
<div id="JoinVRE-Container"></div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name=joinvre
|
name=joinvre
|
||||||
module-group-id=liferay
|
module-group-id=liferay
|
||||||
module-incremental-version=2
|
module-incremental-version=3
|
||||||
tags=
|
tags=
|
||||||
short-description=
|
short-description=
|
||||||
change-log=
|
change-log=
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<instanceable>false</instanceable>
|
<instanceable>false</instanceable>
|
||||||
<ajaxable>false</ajaxable>
|
<ajaxable>false</ajaxable>
|
||||||
<!-- LOCATION CSS HERE -->
|
<!-- LOCATION CSS HERE -->
|
||||||
<header-portlet-css>/JoinVRE.css</header-portlet-css>
|
<header-portlet-css>/explore.css</header-portlet-css>
|
||||||
|
<css-class-wrapper>join-vre-wrapper</css-class-wrapper>
|
||||||
</portlet>
|
</portlet>
|
||||||
</liferay-portlet-app>
|
</liferay-portlet-app>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
<servlet-mapping>
|
<servlet-mapping>
|
||||||
<servlet-name>JoinVRE</servlet-name>
|
<servlet-name>JoinVRE</servlet-name>
|
||||||
<url-pattern>/JoinVRE/JoinService</url-pattern>
|
<url-pattern>/explore/JoinService</url-pattern>
|
||||||
</servlet-mapping>
|
</servlet-mapping>
|
||||||
|
|
||||||
<!-- Default page to serve -->
|
<!-- Default page to serve -->
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
body {
|
||||||
|
border: 5px solid white;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (min-width: 800px) {
|
||||||
|
.aui .row-fluid .span3 {
|
||||||
|
width: 19% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 1024px) {
|
||||||
|
.modal-custom {
|
||||||
|
width: 75% !important;
|
||||||
|
margin-left: -38% !important;
|
||||||
|
}
|
||||||
|
.modal-body-custom {
|
||||||
|
height: 500px !important;
|
||||||
|
}
|
||||||
|
.modal-header-custom>.close {
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 800px) and (max-width: 1024px) {
|
||||||
|
.modal-custom {
|
||||||
|
width: 85% !important;
|
||||||
|
margin-left: -42% !important;
|
||||||
|
}
|
||||||
|
.modal-body-custom {
|
||||||
|
height: 450px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 600px) and (max-width: 800px) {
|
||||||
|
.modal-body-custom {
|
||||||
|
height: 350px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: 300px) and (max-width: 600px) {
|
||||||
|
.modal-body-custom {
|
||||||
|
height: 300px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-custom {
|
||||||
|
min-width: 300px !important;
|
||||||
|
top: 3% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal-body-custom {
|
||||||
|
max-height: 50% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue