Working on Feature #9760: WS-Thredds synch folder integration

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@154687 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2017-09-28 13:36:37 +00:00
parent 6d15e51493
commit a15bf1e17c
3 changed files with 13 additions and 12 deletions

View File

@ -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()){

View File

@ -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

View File

@ -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){