diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogPublishOnThredds.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogPublishOnThredds.java index 5ae04e8..8d20220 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogPublishOnThredds.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogPublishOnThredds.java @@ -249,7 +249,7 @@ public class DialogPublishOnThredds extends Dialog { if(result.isOnError()){ - MessageBox.info("Error", result.getReportMessage(), null); + MessageBox.alert("Error", result.getReportMessage(), null); } if(result.isTransferringReportAvailable()){ diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java index 95d6c39..0a00774 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/GWTWorkspaceServiceImpl.java @@ -4184,7 +4184,6 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT if (isTestMode()){ - userId = 21150; //USER ID OF FRANCESCO listOfVres.add(new GcubeVRE("devVRE", "/gcube/devsec/devVRE")); listOfVres.add(new GcubeVRE("NextNext", "/gcube/devNext/NextNext")); return listOfVres; @@ -4218,19 +4217,21 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT * * @param folderToPublishId the folder to publish id * @param folderMetadataId the folder metadata id - * @param vreScope the vre scope + * @param vreTargetScope the vre scope * @param catalogueName the catalogue name * @return the transfer on thredds report * @throws Exception the exception */ @Override - public TransferOnThreddsReport publishOnThreddsCatalogue(String folderToPublishId, String folderMetadataId, String vreScope, String catalogueName) throws Exception{ - workspaceLogger.info("Publishing on thredds the folderId: "+folderToPublishId+", metafolderId: "+folderMetadataId +", vre scope: "+vreScope); - System.out.println("Publishing on thredds the folderId: "+folderToPublishId+", metafolderId: "+folderMetadataId +", vre scope: "+vreScope); + public TransferOnThreddsReport publishOnThreddsCatalogue(String folderToPublishId, String folderMetadataId, String vreTargetScope, String catalogueName) throws Exception{ + workspaceLogger.info("Publishing on thredds the folderId: "+folderToPublishId+", metafolderId: "+folderMetadataId +", vre target scope: "+vreTargetScope); + System.out.println("Publishing on thredds the folderId: "+folderToPublishId+", metafolderId: "+folderMetadataId +", vre target scope: "+vreTargetScope); try{ GCubeUser user = PortalContext.getConfiguration().getCurrentUser(this.getThreadLocalRequest()); - String wsUserToken = PortalContext.getConfiguration().getCurrentScope(this.getThreadLocalRequest()); - String targetScopeUserToken = PortalContext.getConfiguration().getCurrentUserToken(vreScope, user.getUsername()); + String wsScope = PortalContext.getConfiguration().getCurrentScope(this.getThreadLocalRequest()); + String wsUserToken = PortalContext.getConfiguration().getCurrentUserToken(wsScope, user.getUsername()); + + String targetScopeUserToken = PortalContext.getConfiguration().getCurrentUserToken(vreTargetScope, user.getUsername()); if (isTestMode()){ targetScopeUserToken = "89257623-0570-4fbe-a15b-458bb84f4902-98187548"; //TOKEN NEXTNEXT by FRANCESCO diff --git a/src/main/java/org/gcube/portlets/user/workspace/server/publish/PublishOnThredds.java b/src/main/java/org/gcube/portlets/user/workspace/server/publish/PublishOnThredds.java index ea56062..9e8fdf3 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/server/publish/PublishOnThredds.java +++ b/src/main/java/org/gcube/portlets/user/workspace/server/publish/PublishOnThredds.java @@ -72,11 +72,11 @@ public class PublishOnThredds { * * @param folderId the folder id * @param metadataFolderID the metadata folder id - * @param publishingUserToken the publishing user token + * @param publishingTargetScopeUserToken the publishing user token * @param catalogueName the catalogue name * @return the transfer on thredds report */ - public TransferOnThreddsReport publishFolder(final String folderId, final String metadataFolderID, final String publishingUserToken, final String catalogueName){ + public TransferOnThreddsReport publishFolder(final String folderId, final String metadataFolderID, final String publishingTargetScopeUserToken, final String catalogueName){ final String transferId = UUID.randomUUID().toString(); final TransferOnThreddsReport tr = new TransferOnThreddsReport(transferId, folderId, false, null); @@ -91,10 +91,10 @@ public class PublishOnThredds { try{ WsUtil.setTransferPublishingOnThredds(httpSession, tr); - System.out.println("Setting ws user token : "+publishingUserToken); + System.out.println("Setting ws user token : "+wsScopeUserToken); TokenSetter.setToken(wsScopeUserToken); - FolderConfiguration folderConfig=new FolderConfiguration(publishingUserToken,folderId,catalogueName); + FolderConfiguration folderConfig=new FolderConfiguration(publishingTargetScopeUserToken,folderId,catalogueName); folderConfig.setProvidedMetadata(false); if(metadataFolderID!=null){