Initial import.
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/accept-invite-portlet@158973 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
42d0df1ead
commit
991a6ac013
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="owner.project.facets" value="java"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
|
</classpath>
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>accept-invite-portlet</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||||
|
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
|
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||||
|
<nature>com.liferay.ide.core.liferayNature</nature>
|
||||||
|
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="hide" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
|
||||||
|
<classpathentry kind="output" path=""/>
|
||||||
|
</classpath>
|
|
@ -0,0 +1,4 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding//src/main/java=UTF-8
|
||||||
|
encoding//src/main/resources=UTF-8
|
||||||
|
encoding/<project>=UTF-8
|
|
@ -0,0 +1,8 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.8
|
|
@ -0,0 +1,3 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
validateFragments=false
|
||||||
|
validation.use-project-settings=true
|
|
@ -0,0 +1,4 @@
|
||||||
|
activeProfiles=Liferay-v6.2-CE-(Tomcat-7)-(2)
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
|
<wb-module deploy-name="accept-invite-portlet-portlet">
|
||||||
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
|
<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/resources"/>
|
||||||
|
<dependent-module archiveName="invites-common-library-1.5.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/invites-common-library/invites-common-library">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
|
<dependent-module archiveName="email-templates-library-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/email-templates-library/email-templates-library">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
|
<property name="context-root" value="accept-invite-portlet"/>
|
||||||
|
<property name="java-output-path" value="/accept-invite-portlet/target/classes"/>
|
||||||
|
</wb-module>
|
||||||
|
</project-modules>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<faceted-project>
|
||||||
|
<fixed facet="wst.jsdt.web"/>
|
||||||
|
<installed facet="jst.web" version="2.5"/>
|
||||||
|
<installed facet="liferay.portlet" version="6.0"/>
|
||||||
|
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||||
|
<installed facet="java" version="1.8"/>
|
||||||
|
</faceted-project>
|
|
@ -0,0 +1 @@
|
||||||
|
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
|
|
@ -0,0 +1 @@
|
||||||
|
Window
|
|
@ -0,0 +1,2 @@
|
||||||
|
disabled=06target
|
||||||
|
eclipse.preferences.version=1
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
"plugins": {
|
||||||
|
"guess-types": {
|
||||||
|
|
||||||
|
},
|
||||||
|
"outline": {
|
||||||
|
|
||||||
|
},
|
||||||
|
"liferay": {
|
||||||
|
|
||||||
|
},
|
||||||
|
"yui3": {
|
||||||
|
|
||||||
|
},
|
||||||
|
"aui2.0.x": {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libs": [
|
||||||
|
"ecma5",
|
||||||
|
"browser"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,204 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<artifactId>maven-parent</artifactId>
|
||||||
|
<groupId>org.gcube.tools</groupId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<relativePath />
|
||||||
|
</parent>
|
||||||
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
<artifactId>accept-invite-portlet</artifactId>
|
||||||
|
<packaging>war</packaging>
|
||||||
|
<name>accept-invite-portlet Portlet</name>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<description>
|
||||||
|
accept-invite-portlet manage the sent invitations
|
||||||
|
</description>
|
||||||
|
<scm>
|
||||||
|
<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/${project.artifactId}</connection>
|
||||||
|
<developerConnection>scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/${project.artifactId}</developerConnection>
|
||||||
|
<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/admin/${project.artifactId}</url>
|
||||||
|
</scm>
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>Liferay-v6.2-CE-(Tomcat-7)-(2)</id>
|
||||||
|
<properties>
|
||||||
|
<liferay.version>6.2.5</liferay.version>
|
||||||
|
<liferay.maven.plugin.version>6.2.10.12</liferay.maven.plugin.version>
|
||||||
|
<liferay.auto.deploy.dir>/Users/massi/portal/liferay-portal-6.2-ce-ga6/deploy</liferay.auto.deploy.dir>
|
||||||
|
<liferay.app.server.deploy.dir>/Users/massi/portal/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps</liferay.app.server.deploy.dir>
|
||||||
|
<liferay.app.server.lib.global.dir>/Users/massi/portal/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext</liferay.app.server.lib.global.dir>
|
||||||
|
<liferay.app.server.portal.dir>/Users/massi/portal/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT</liferay.app.server.portal.dir>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.distribution</groupId>
|
||||||
|
<artifactId>maven-portal-bom</artifactId>
|
||||||
|
<version>LATEST</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portal</groupId>
|
||||||
|
<artifactId>social-networking-library</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.dvos</groupId>
|
||||||
|
<artifactId>usermanagement-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.common.portal</groupId>
|
||||||
|
<artifactId>portal-manager</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portal</groupId>
|
||||||
|
<artifactId>invites-common-library</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.liferay.portal</groupId>
|
||||||
|
<artifactId>portal-service</artifactId>
|
||||||
|
<version>${liferay.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.liferay.portal</groupId>
|
||||||
|
<artifactId>util-bridges</artifactId>
|
||||||
|
<version>${liferay.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.liferay.portal</groupId>
|
||||||
|
<artifactId>util-taglib</artifactId>
|
||||||
|
<version>${liferay.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.liferay.portal</groupId>
|
||||||
|
<artifactId>util-java</artifactId>
|
||||||
|
<version>${liferay.version}</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.portlet</groupId>
|
||||||
|
<artifactId>portlet-api</artifactId>
|
||||||
|
<version>2.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>servlet-api</artifactId>
|
||||||
|
<version>2.4</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet.jsp</groupId>
|
||||||
|
<artifactId>jsp-api</artifactId>
|
||||||
|
<version>2.0</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>jstl</artifactId>
|
||||||
|
<version>1.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-aop</artifactId>
|
||||||
|
<version>3.0.7.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-beans</artifactId>
|
||||||
|
<version>3.0.7.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
<version>3.0.7.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-core</artifactId>
|
||||||
|
<version>3.0.7.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-expression</artifactId>
|
||||||
|
<version>3.0.7.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-web</artifactId>
|
||||||
|
<version>3.0.7.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-webmvc</artifactId>
|
||||||
|
<version>3.0.7.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-webmvc-portlet</artifactId>
|
||||||
|
<version>3.0.7.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.liferay.maven.plugins</groupId>
|
||||||
|
<artifactId>liferay-maven-plugin</artifactId>
|
||||||
|
<version>${liferay.maven.plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>generate-sources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>build-css</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
|
||||||
|
<appServerDeployDir>${liferay.app.server.deploy.dir}</appServerDeployDir>
|
||||||
|
<appServerLibGlobalDir>${liferay.app.server.lib.global.dir}</appServerLibGlobalDir>
|
||||||
|
<appServerPortalDir>${liferay.app.server.portal.dir}</appServerPortalDir>
|
||||||
|
<liferayVersion>${liferay.version}</liferayVersion>
|
||||||
|
<pluginType>portlet</pluginType>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
<configuration>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
<source>1.8</source>
|
||||||
|
<target>1.8</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
<configuration>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,173 @@
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.gcube.portlets.user.acceptinvite;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import javax.portlet.PortalContext;
|
||||||
|
import javax.portlet.RenderRequest;
|
||||||
|
import javax.portlet.RenderResponse;
|
||||||
|
import javax.portlet.ResourceRequest;
|
||||||
|
import javax.portlet.ResourceResponse;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
|
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
|
||||||
|
import org.gcube.portal.databook.server.DatabookStore;
|
||||||
|
import org.gcube.portal.databook.shared.Invite;
|
||||||
|
import org.gcube.portal.databook.shared.InviteStatus;
|
||||||
|
import org.gcube.portal.databook.shared.ex.InviteIDNotFoundException;
|
||||||
|
import org.gcube.portal.databook.shared.ex.InviteStatusNotFoundException;
|
||||||
|
import org.gcube.portal.invites.InvitesManager;
|
||||||
|
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
|
||||||
|
import org.gcube.vomanagement.usermanagement.exception.UserRetrievalFault;
|
||||||
|
import org.gcube.vomanagement.usermanagement.impl.LiferayUserManager;
|
||||||
|
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.portlet.bind.annotation.RenderMapping;
|
||||||
|
import org.springframework.web.portlet.bind.annotation.ResourceMapping;
|
||||||
|
|
||||||
|
import com.liferay.portal.kernel.exception.PortalException;
|
||||||
|
import com.liferay.portal.kernel.exception.SystemException;
|
||||||
|
import com.liferay.portal.kernel.json.JSONArray;
|
||||||
|
import com.liferay.portal.kernel.json.JSONFactoryUtil;
|
||||||
|
import com.liferay.portal.kernel.json.JSONObject;
|
||||||
|
import com.liferay.portal.kernel.log.Log;
|
||||||
|
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||||
|
import com.liferay.portal.kernel.util.ParamUtil;
|
||||||
|
import com.liferay.portal.model.Group;
|
||||||
|
import com.liferay.portal.service.GroupLocalServiceUtil;
|
||||||
|
import com.liferay.portal.util.PortalUtil;
|
||||||
|
|
||||||
|
@Controller(value = "PortletViewController")
|
||||||
|
@RequestMapping("VIEW")
|
||||||
|
public class PortletViewController {
|
||||||
|
private static Log _log = LogFactoryUtil.getLog(PortletViewController.class);
|
||||||
|
|
||||||
|
private static String PAGE_NOT_AUTHORIZED = "not-authorized";
|
||||||
|
private static String PAGE_INVITE_NOTFOUND = "invite-notfound";
|
||||||
|
private static String PAGE_VRE_NOTFOUND = "vre-notfound";
|
||||||
|
private static String PAGE_INVITE_EXPIRED = "invite-expired";
|
||||||
|
private static String PAGE_INVITE_PROCESS = "view";
|
||||||
|
|
||||||
|
public static String INVITE_INSTANCE = "inviteInstance";
|
||||||
|
|
||||||
|
private static DatabookStore store;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the unique instance of the store
|
||||||
|
*/
|
||||||
|
public static synchronized DatabookStore getStore() {
|
||||||
|
if (store == null) {
|
||||||
|
store = new DBCassandraAstyanaxImpl();
|
||||||
|
}
|
||||||
|
return store;
|
||||||
|
}
|
||||||
|
|
||||||
|
// .append(PortalContext.getConfiguration().getSiteLandingPagePath(request))
|
||||||
|
@RenderMapping
|
||||||
|
public String handleRenderRequest(RenderRequest request,RenderResponse response, Model model) {
|
||||||
|
|
||||||
|
HttpServletRequest httpReq = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(request));
|
||||||
|
|
||||||
|
final String INVITE_ID_ENCODED = new String(Base64.encodeBase64(InvitesManager.INVITEID_ATTR.getBytes()));
|
||||||
|
final String SITE_ID_ENCODED = new String(Base64.encodeBase64(InvitesManager.SITEID_ATTR.getBytes()));
|
||||||
|
if (httpReq.getParameter(INVITE_ID_ENCODED) == null || SITE_ID_ENCODED == null)
|
||||||
|
return PAGE_NOT_AUTHORIZED;
|
||||||
|
String inviteIdEncoded = (String) httpReq.getParameter(INVITE_ID_ENCODED);
|
||||||
|
String siteIdEncoded = (String) httpReq.getParameter(SITE_ID_ENCODED);
|
||||||
|
String inviteId= new String(Base64.decodeBase64(inviteIdEncoded));
|
||||||
|
String groupId = new String(Base64.decodeBase64(siteIdEncoded));
|
||||||
|
|
||||||
|
_log.info("GOT inviteId=" + inviteId);
|
||||||
|
_log.info("siteId=" + groupId);
|
||||||
|
|
||||||
|
Group site = null;
|
||||||
|
try {
|
||||||
|
site = GroupLocalServiceUtil.getGroup(Long.parseLong(groupId));
|
||||||
|
} catch (Exception e1) {
|
||||||
|
e1.printStackTrace();
|
||||||
|
return PAGE_VRE_NOTFOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
Invite invite = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
invite = getStore().readInvite(inviteId);
|
||||||
|
} catch (InviteIDNotFoundException | InviteStatusNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return PAGE_INVITE_NOTFOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (invite.getStatus() == InviteStatus.ACCEPTED)
|
||||||
|
return PAGE_INVITE_EXPIRED;
|
||||||
|
|
||||||
|
|
||||||
|
GCubeUser invitedUser = null;
|
||||||
|
try {
|
||||||
|
invitedUser = new LiferayUserManager().getUserByEmail(invite.getInvitedEmail());
|
||||||
|
model.addAttribute("invitedUser", invitedUser);
|
||||||
|
} catch (UserManagementSystemException | UserRetrievalFault e) {
|
||||||
|
_log.info("No user account exist with this email: " + invite.getInvitedEmail());
|
||||||
|
}
|
||||||
|
|
||||||
|
//we set the invite instance retrieved in the model
|
||||||
|
model.addAttribute(INVITE_INSTANCE, invite);
|
||||||
|
model.addAttribute("vreName", site.getName());
|
||||||
|
model.addAttribute("vreFriendlyURL", site.getFriendlyURL());
|
||||||
|
model.addAttribute("groupId", site.getGroupId());
|
||||||
|
|
||||||
|
return PAGE_INVITE_PROCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ResourceMapping(value="findState")
|
||||||
|
public void findStateForCountry(ResourceRequest request, ResourceResponse response) throws IOException {
|
||||||
|
String countryName = ParamUtil.getString(request, "countryName");
|
||||||
|
|
||||||
|
JSONArray stateArray = JSONFactoryUtil.createJSONArray();
|
||||||
|
JSONObject stateObject,stateObject2;
|
||||||
|
if(countryName.equalsIgnoreCase("india"))
|
||||||
|
{
|
||||||
|
stateObject = JSONFactoryUtil.createJSONObject();
|
||||||
|
stateObject.put("stateId", "1");
|
||||||
|
stateObject.put("name", "Delhi");
|
||||||
|
|
||||||
|
stateObject2 = JSONFactoryUtil.createJSONObject();
|
||||||
|
stateObject2.put("stateId", "2");
|
||||||
|
stateObject2.put("name", "Gujrat");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
|
||||||
|
stateObject = JSONFactoryUtil.createJSONObject();
|
||||||
|
stateObject.put("stateId", "21");
|
||||||
|
stateObject.put("name", "LA");
|
||||||
|
|
||||||
|
stateObject2 = JSONFactoryUtil.createJSONObject();
|
||||||
|
stateObject2.put("stateId", "22");
|
||||||
|
stateObject2.put("name", "California");
|
||||||
|
}
|
||||||
|
stateArray.put(stateObject);
|
||||||
|
stateArray.put(stateObject2);
|
||||||
|
response.getWriter().println(stateArray);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
|
||||||
|
<portlet:defineObjects />
|
||||||
|
|
||||||
|
<div class="portlet-content">
|
||||||
|
<h3 class="alert alert-error">Invite Expired</h3>
|
||||||
|
The invite you received has been accepted already.<br /> <br />If
|
||||||
|
you were trying to access a VRE make sure you are member, you can ask
|
||||||
|
to be member in the <a href="/explore">Explore page</a> of this
|
||||||
|
gateway. Please click <a href="/explore">here</a> to do so. <br> <br />
|
||||||
|
<div class="separator">
|
||||||
|
<!-- -->
|
||||||
|
<br /> If you need support for manage your invitation please go to <a
|
||||||
|
href="http://www.d4science.org/contact-us" target="_blank">http://www.d4science.org/contact-us</a>
|
||||||
|
to ask for D4Science Help Desk support. <br>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,17 @@
|
||||||
|
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
|
||||||
|
<portlet:defineObjects />
|
||||||
|
|
||||||
|
<div class="portlet-content">
|
||||||
|
<h3 class="alert alert-error">Invite Not Found</h3>
|
||||||
|
The invite you received could not be found. <br>
|
||||||
|
<div class="separator">
|
||||||
|
<!-- -->
|
||||||
|
</div>
|
||||||
|
If you believe this requires support please go to <a
|
||||||
|
href="http://www.d4science.org/contact-us" target="_blank">http://www.d4science.org/contact-us</a>
|
||||||
|
to ask for D4Science Help Desk support. <br> <br />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
|
@ -0,0 +1,21 @@
|
||||||
|
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
|
||||||
|
<portlet:defineObjects />
|
||||||
|
|
||||||
|
<div class="portlet-content">
|
||||||
|
<h3 class="alert alert-error">Forbidden</h3>
|
||||||
|
You do not have permission to access this page. <br>
|
||||||
|
<br>
|
||||||
|
If you need support for manage your invitation please go to <a
|
||||||
|
href="http://www.d4science.org/contact-us" target="_blank">http://www.d4science.org/contact-us</a> to ask for D4Science Help Desk support. <br>
|
||||||
|
<br />If you were trying to access a VRE make sure you are member,
|
||||||
|
you can ask to be member in the <a
|
||||||
|
href="/explore">Explore page</a> of this gateway. Please click <a
|
||||||
|
href="/explore">here</a> to do so. <br>
|
||||||
|
<br />
|
||||||
|
<div class="separator">
|
||||||
|
<!-- -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
|
@ -0,0 +1,78 @@
|
||||||
|
<%@ page contentType="text/html" pageEncoding="UTF-8"%>
|
||||||
|
<%@ page import="javax.portlet.*"%>
|
||||||
|
<%@ page import="org.gcube.common.portal.*"%>
|
||||||
|
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
|
||||||
|
<%@ 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"%>
|
||||||
|
|
||||||
|
<portlet:defineObjects />
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||||
|
|
||||||
|
<portlet:resourceURL id="findState" var="findState"></portlet:resourceURL>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
$( "#country" ).change(function() {
|
||||||
|
$.ajax({
|
||||||
|
url: "${findState}" ,
|
||||||
|
type: 'POST',
|
||||||
|
datatype:'json',
|
||||||
|
data: {
|
||||||
|
countryName: $("#country").val()
|
||||||
|
},
|
||||||
|
success: function(data){
|
||||||
|
var content= JSON.parse(data);
|
||||||
|
$('#state').html('');// to clear the previous option
|
||||||
|
$.each(content, function(i, state) {
|
||||||
|
$('#state').append($('<option>').text(state.name).attr('value', state.stateId));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<h1>Hello!<br></h1>
|
||||||
|
|
||||||
|
<p class="lead">
|
||||||
|
You have recently received an invitation from
|
||||||
|
<c:out escapeXml="true" value="${inviteInstance.senderFullName}" />
|
||||||
|
to join the
|
||||||
|
<a href="/web<c:out escapeXml="true" value="${vreFriendlyURL}" />" target="_blank"><c:out escapeXml="true" value="${vreName}" /></a> Virtual Research Environment.
|
||||||
|
This invite is valid for the email address:
|
||||||
|
<a href="mailto:<c:out escapeXml="true" value="${inviteInstance.invitedEmail}" />">
|
||||||
|
<c:out escapeXml="true" value="${inviteInstance.invitedEmail}" /></a> only.
|
||||||
|
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${empty invitedUser}">
|
||||||
|
var1 is empty or null.
|
||||||
|
<br />
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>
|
||||||
|
<p class="lead">
|
||||||
|
If you already have a <a href="http://www.d4science.org" target="_blank">D4Science</a> account click here: <button class="btn btn-large btn-primary" type="button">Accept invite</button>
|
||||||
|
</p>
|
||||||
|
</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<c:out escapeXml="true" value="${inviteInstance} " />
|
||||||
|
|
||||||
|
|
||||||
|
<b>Change the Country State Change By Ajax</b>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
Country:
|
||||||
|
<select id="country" name="country">
|
||||||
|
<option value="select">Select Country</option>
|
||||||
|
<option value="india">India</option>
|
||||||
|
<option value="usa">USA</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
State:
|
||||||
|
<select id="state" name="state">
|
||||||
|
</select>
|
|
@ -0,0 +1,17 @@
|
||||||
|
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
|
||||||
|
<portlet:defineObjects />
|
||||||
|
|
||||||
|
<div class="portlet-content">
|
||||||
|
<h3 class="alert alert-error">VRE not Found</h3>
|
||||||
|
The VRE addressed by this invite could not be found. <br>
|
||||||
|
<div class="separator">
|
||||||
|
<!-- -->
|
||||||
|
</div>
|
||||||
|
If you believe this requires support please go to <a
|
||||||
|
href="http://www.d4science.org/contact-us" target="_blank">http://www.d4science.org/contact-us</a>
|
||||||
|
to ask for D4Science Help Desk support. <br> <br />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.2.0//EN" "http://www.liferay.com/dtd/liferay-display_6_2_0.dtd">
|
||||||
|
|
||||||
|
<display>
|
||||||
|
<category name="category.sample">
|
||||||
|
<portlet id="accept-invite-portlet" />
|
||||||
|
</category>
|
||||||
|
</display>
|
|
@ -0,0 +1,9 @@
|
||||||
|
name=accept-invite-portlet
|
||||||
|
module-group-id=liferay
|
||||||
|
module-incremental-version=1
|
||||||
|
tags=
|
||||||
|
short-description=
|
||||||
|
change-log=
|
||||||
|
page-url=http://www.liferay.com
|
||||||
|
author=Liferay, Inc.
|
||||||
|
licenses=LGPL
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.2.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_2_0.dtd">
|
||||||
|
|
||||||
|
<liferay-portlet-app>
|
||||||
|
<portlet>
|
||||||
|
<portlet-name>accept-invite-portlet</portlet-name>
|
||||||
|
<icon>/icon.png</icon>
|
||||||
|
<requires-namespaced-parameters> false </requires-namespaced-parameters>
|
||||||
|
<header-portlet-css>/css/main.css</header-portlet-css>
|
||||||
|
<header-portlet-javascript>https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js</header-portlet-javascript>
|
||||||
|
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
|
||||||
|
</portlet>
|
||||||
|
<role-mapper>
|
||||||
|
<role-name>administrator</role-name>
|
||||||
|
<role-link>Administrator</role-link>
|
||||||
|
</role-mapper>
|
||||||
|
<role-mapper>
|
||||||
|
<role-name>guest</role-name>
|
||||||
|
<role-link>Guest</role-link>
|
||||||
|
</role-mapper>
|
||||||
|
<role-mapper>
|
||||||
|
<role-name>power-user</role-name>
|
||||||
|
<role-link>Power User</role-link>
|
||||||
|
</role-mapper>
|
||||||
|
<role-mapper>
|
||||||
|
<role-name>user</role-name>
|
||||||
|
<role-link>User</role-link>
|
||||||
|
</role-mapper>
|
||||||
|
</liferay-portlet-app>
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0">
|
||||||
|
<portlet>
|
||||||
|
<portlet-name>accept-invite-portlet</portlet-name>
|
||||||
|
<display-name>accept-invite-portlet</display-name>
|
||||||
|
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
|
||||||
|
<init-param>
|
||||||
|
<name>contextConfigLocation</name>
|
||||||
|
<value>/WEB-INF/spring-context/portlet/accept-invite-portlet-portlet.xml</value>
|
||||||
|
</init-param>
|
||||||
|
<expiration-cache>0</expiration-cache>
|
||||||
|
<supports>
|
||||||
|
<mime-type>text/html</mime-type>
|
||||||
|
</supports>
|
||||||
|
<portlet-info>
|
||||||
|
<title>Accept invite</title>
|
||||||
|
<short-title>Accept invite</short-title>
|
||||||
|
<keywords>accept-invite-portlet</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,19 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<beans
|
||||||
|
xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||||
|
xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"
|
||||||
|
>
|
||||||
|
<context:annotation-config />
|
||||||
|
|
||||||
|
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||||
|
<property name="contentType" value="text/html;charset=UTF-8" />
|
||||||
|
<property name="prefix" value="/WEB-INF/jsp/" />
|
||||||
|
<property name="suffix" value=".jsp" />
|
||||||
|
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
|
||||||
|
</bean>
|
||||||
|
</beans>
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<beans
|
||||||
|
xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
|
||||||
|
>
|
||||||
|
<context:component-scan base-package="org.gcube.portlets.user.**" />
|
||||||
|
</beans>
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<web-app
|
||||||
|
version="2.5"
|
||||||
|
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||||
|
>
|
||||||
|
<context-param>
|
||||||
|
<param-name>contextConfigLocation</param-name>
|
||||||
|
<param-value>/WEB-INF/spring-context/portlet-application-context.xml</param-value>
|
||||||
|
</context-param>
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>ViewRendererServlet</servlet-name>
|
||||||
|
<servlet-class>org.springframework.web.servlet.ViewRendererServlet</servlet-class>
|
||||||
|
<load-on-startup>1</load-on-startup>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>ViewRendererServlet</servlet-name>
|
||||||
|
<url-pattern>/WEB-INF/servlet/view</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
<listener>
|
||||||
|
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||||
|
</listener>
|
||||||
|
</web-app>
|
Binary file not shown.
After Width: | Height: | Size: 467 B |
Loading…
Reference in New Issue