Compare commits

...

10 Commits

7 changed files with 67 additions and 32 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/vre-deploy-4.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/vre-deploy-4.4.0/WEB-INF/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/vre-deploy-4.3.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/vre-deploy-4.4.0/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -41,5 +41,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/vre-deploy-4.3.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/vre-deploy-4.4.0/WEB-INF/classes"/>
</classpath>

View File

@ -3,7 +3,9 @@ org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7

View File

@ -1,10 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="vre-deploy">
<wb-module deploy-name="vre-deploy">
<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="/" 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"/>
<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="vre-deploy"/>
</wb-module>
</wb-module>
</project-modules>

View File

@ -4,6 +4,15 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v4.5.0] - 2022-03-08
- Feature #24402 increased waiting time between LR Site Creation and LR Site user assignments (manager, designer)
## [v4.4.0] - 2021-07-08
- #21781 migrated to new AccessTokenProvider class
- #21157 removed home library dep, using shub for messaging
## [v4.3.1] - 2021-02-02

11
pom.xml
View File

@ -13,7 +13,7 @@
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>vre-deploy</artifactId>
<packaging>war</packaging>
<version>4.3.1</version>
<version>4.5.0</version>
<name>gCube VRE Deploy Wizard Portlet</name>
<description>
gCube VRE Deploy Wizard Portlet.
@ -40,7 +40,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.6.0</version>
<version>3.6.4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -52,6 +52,7 @@
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
@ -77,15 +78,9 @@
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-client-library</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>oidc-library-portal</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -38,15 +38,15 @@ import org.gcube.applicationsupportlayer.social.NotificationsManager;
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingSite;
import org.gcube.applicationsupportlayer.social.shared.SocialNetworkingUser;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.authorization.library.provider.UmaJWTProvider;
import org.gcube.common.homelibrary.home.HomeLibrary;
import org.gcube.common.homelibrary.home.workspace.Workspace;
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.resources.gcore.GenericResource;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
import org.gcube.common.storagehub.client.dsl.Util;
import org.gcube.common.storagehub.client.dsl.VREFolderManager;
import org.gcube.common.storagehub.client.plugins.AbstractPlugin;
import org.gcube.common.storagehub.client.proxies.MessageManagerClient;
import org.gcube.common.storagehub.model.acls.AccessType;
import org.gcube.informationsystem.publisher.RegistryPublisher;
import org.gcube.informationsystem.publisher.RegistryPublisherFactory;
@ -577,25 +577,23 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
GCubeUser userDesigner = um.getUserByUsername(designer);
userManager = um.getUserByUsername(manager);
Workspace workspace = HomeLibrary.getUserWorkspace(getASLSession().getUsername());
ArrayList<String> toSend = new ArrayList<String>();
toSend.add(designer);
String subject = "Definition approved and deployed";
String body = "Dear "+userDesigner.getFirstName()+", \n\n" + userManager.getFullname() + " has approved the deployment of the group you requested: " + vreName +".";
body+=".\n\nThis group has been deployed successfully and is already available for you on this portal. Please, check your list.";
String messageId = workspace.getWorkspaceMessageManager().sendMessageToPortalLogins(subject, body, new ArrayList<String>(), toSend);
MessageManagerClient client = AbstractPlugin.messages().build();
String messageId = client.sendMessage(toSend, subject, body, null);
NotificationsManager nnm = new ApplicationNotificationsManager(
new SocialNetworkingSite(getThreadLocalRequest()),
getASLSession().getScope(),
new SocialNetworkingUser(getASLSession().getUsername(), getASLSession().getUserEmailAddress(), getASLSession().getUserFullName(), "")
);
if (nnm.notifyMessageReceived(designer, messageId, subject, body))
log.trace("Sending Definition create notification: " + subject + " OK");
log.debug("Sending Definition create notification: " + subject + " OK");
} catch (Exception e) {
e.printStackTrace();
}
//log.info("--- Trying to share a news for this VRE");
//shareCreatedVRENews(designer, manager, name, description);
log.info("onAfterCreate VRE: " + vreScope);
long currGroupId = PortalContext.getConfiguration().getCurrentGroupId(getThreadLocalRequest());
@ -687,7 +685,7 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
private void createVRESharedGroupFolder(UserManager uMan, org.gcube.vomanagement.usermanagement.model.GCubeGroup vreCreated, String designer, String manager, String description) throws Exception {
GroupManager gm = new LiferayGroupManager();
String previousToken = SecurityTokenProvider.instance.get();
String previousUMAToken = UmaJWTProvider.instance.get();
String previousUMAToken = AccessTokenProvider.instance.get();
//get the super user
log.info("Getting super user with role {}", GatewayRolesNames.INFRASTRUCTURE_MANAGER.getRoleName());
//get the super user
@ -727,7 +725,7 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
log.info("Created the VRE Folder on storageHub: {} ", vreFolderName);
UmaJWTProvider.instance.set(previousUMAToken);
AccessTokenProvider.instance.set(previousUMAToken);
SecurityTokenProvider.instance.set(previousToken);
@ -936,10 +934,15 @@ public class VREDeployerServiceImpl extends RemoteServiceServlet implements Vre
+ "now assigning the designer and manager to the Site (VRE), sleeping "+ WAITING_TIME_Seconds + " seconds to allow operations on Keycloak ...");
//the creation of groups on Keycloak is asynchronous, if we send an add user to group before the group is actually created on keycloak it would fails, so we wait
Thread.sleep(WAITING_TIME_Seconds / 2 * 1000);
log.info("\n still waiting ... 10 seconds more ... ");
Thread.sleep(WAITING_TIME_Seconds / 2 * 1000);
int waitingTime = WAITING_TIME_Seconds / 2 * 1000;
log.info("\n going in waiting before assing users for " +waitingTime + " seconds ");
Thread.sleep(waitingTime);
log.info("\n still waiting ... " +waitingTime + " seconds ");
Thread.sleep(waitingTime);
log.info("\n still waiting ... " +waitingTime + " seconds ");
Thread.sleep(waitingTime);
log.info("\n waiting finished going to assign the users to this VRE");
RoleManager rm = new LiferayRoleManager();
if (manager.compareTo(currUser) != 0) {

View File

@ -16,8 +16,7 @@
<link type="text/css" rel="stylesheet" href="Vredeployer.css" />
<title>VRE Deployer</title>
<script src='gxt/flash/swfobject.js'></script>
<script type="text/javascript" src="vredeployer/vredeployer.nocache.js"></script>
<!-- <script type="text/javascript" src="vredeployer/vredeployer.nocache.js"></script> -->
</head>