added getLandingPage path method
git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/join-vre@126232 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4744b7401f
commit
87dd94afda
|
@ -4,7 +4,7 @@
|
|||
<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.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/invites-common-library/invites-common-library">
|
||||
<dependent-module archiveName="invites-common-library-1.2.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"/>
|
||||
|
|
|
@ -25,4 +25,6 @@ public interface JoinService extends RemoteService {
|
|||
void addMembershipRequest(String scope, String optionalMessage);
|
||||
|
||||
boolean registerUser(String scope, long vreId, boolean isInvitation);
|
||||
|
||||
String isExistingInvite(long siteId);
|
||||
}
|
||||
|
|
|
@ -24,4 +24,6 @@ public interface JoinServiceAsync {
|
|||
|
||||
void registerUser(String scope, long vreId, boolean isInvitation,
|
||||
AsyncCallback<Boolean> callback);
|
||||
|
||||
void isExistingInvite(long siteId, AsyncCallback<String> callback);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class JoinVRE implements EntryPoint {
|
|||
vreId = Long.parseLong(getSiteLiferayId());
|
||||
}
|
||||
catch (Exception ex) {
|
||||
logger.log(Level.WARNING, "org id is not a number " + ex.getMessage());
|
||||
logger.log(Level.WARNING, "site id is not a number " + ex.getMessage());
|
||||
return;
|
||||
}
|
||||
joinService.getSelectedVRE(vreId, new AsyncCallback<VRE>() {
|
||||
|
@ -70,7 +70,7 @@ public class JoinVRE implements EntryPoint {
|
|||
default: //Not belonging
|
||||
logger.log(Level.INFO, "User is NOT Belonging");
|
||||
rp = displayVREs();
|
||||
rp.requestMembership(vre, vre.getinfraScope(), false);
|
||||
checkInvitation(vre, vre.getId(), rp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -90,4 +90,24 @@ public class JoinVRE implements EntryPoint {
|
|||
private String getSiteLiferayId() {
|
||||
return Window.Location.getParameter(GET_OID_PARAMETER);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param vre
|
||||
* @param groupId
|
||||
* @param rp
|
||||
*/
|
||||
private void checkInvitation(final VRE vre, final long groupId, final ResponsivePanel rp) {
|
||||
joinService.isExistingInvite(groupId, new AsyncCallback<String>() {
|
||||
@Override
|
||||
public void onSuccess(String result) {
|
||||
//result != null = there exist an invite
|
||||
rp.requestMembership(vre, vre.getinfraScope(), result != null);
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Window.alert("Server error");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -74,15 +74,16 @@ public class ResponsivePanel extends Composite {
|
|||
}
|
||||
|
||||
public void requestMembership(VRE vre, String scope, boolean isInvitation) {
|
||||
if (vre.isUponRequest()) {
|
||||
if (vre.isUponRequest() && !isInvitation) {
|
||||
RequestMembershipDialog modal = new RequestMembershipDialog(vre);
|
||||
modal.show();
|
||||
} else {
|
||||
AccessVREDialog modal = new AccessVREDialog(vre, isInvitation);
|
||||
modal.show();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.gcube.application.framework.core.session.SessionManager;
|
|||
import org.gcube.common.portal.CustomAttributeKeys;
|
||||
import org.gcube.common.portal.GCubePortalConstants;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.portal.custom.communitymanager.SiteManagerUtil;
|
||||
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
|
||||
import org.gcube.portal.databook.server.DBCassandraAstyanaxImpl;
|
||||
import org.gcube.portal.databook.server.DatabookStore;
|
||||
|
@ -38,12 +37,10 @@ import org.gcube.vomanagement.usermanagement.model.MembershipRequestStatus;
|
|||
import org.gcube.vomanagement.usermanagement.model.VirtualGroup;
|
||||
|
||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||
import com.liferay.portal.kernel.cache.CacheRegistryUtil;
|
||||
import com.liferay.portal.kernel.exception.PortalException;
|
||||
import com.liferay.portal.kernel.exception.SystemException;
|
||||
import com.liferay.portal.kernel.log.Log;
|
||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||
import com.liferay.portal.kernel.management.PortalManager;
|
||||
import com.liferay.portal.model.Group;
|
||||
import com.liferay.portal.model.VirtualHost;
|
||||
import com.liferay.portal.service.LayoutSetLocalServiceUtil;
|
||||
|
@ -458,4 +455,20 @@ public class JoinServiceImpl extends RemoteServiceServlet implements JoinService
|
|||
//_log.trace("getPortalBasicUrl: " +toReturn + "request.getServerPort: " + request.getServerPort());
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String isExistingInvite(long groupId) {
|
||||
GroupManager gm = new LiferayGroupManager();
|
||||
String email = getASLSession().getUserEmailAddress();
|
||||
String infraScope = null;
|
||||
try {
|
||||
infraScope = gm.getInfrastructureScope(groupId);
|
||||
} catch (UserManagementSystemException | GroupRetrievalFault e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
_log.debug("checking if invite exists for " + email + " on " +infraScope);
|
||||
initStore();
|
||||
return store.isExistingInvite(infraScope, email);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue