From 373a7a21cf8605af17a2de84f88296279ffbdbbd Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Wed, 14 May 2014 10:54:04 +0000 Subject: [PATCH] fix for item renaming bug #843 git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerSocial@95665 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 2 +- pom.xml | 2 +- .../social/ApplicationNotificationsManager.java | 7 ++++--- .../social/NotificationsManager.java | 5 +++-- .../applicationsupportlayer/social/storage/FTPManager.java | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.classpath b/.classpath index b96f5b8..5cca4e3 100644 --- a/.classpath +++ b/.classpath @@ -20,7 +20,7 @@ - + diff --git a/pom.xml b/pom.xml index 710b6d5..ad2d414 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.gcube.applicationsupportlayer aslsocial - 0.9.1-SNAPSHOT + 0.10.0-SNAPSHOT jar Social Portal ASL Extension diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java index fe352ff..74a7b48 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/ApplicationNotificationsManager.java @@ -362,9 +362,10 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen * @throws InternalErrorException */ @Override - public boolean notifyItemRenaming(String userIdToNotify, String previousName, WorkspaceItem renamedItem) throws InternalErrorException { - String notifyText = "renamed " + previousName +" as " + renamedItem.getName() +" in your shared folder " + renamedItem.getParent().getName(); - if (renamedItem.getParent().isShared()) { + public boolean notifyItemRenaming(String userIdToNotify, String previousName, WorkspaceItem renamedItem, WorkspaceFolder rootSharedFolder) throws InternalErrorException { + String notifyText = "renamed " + previousName +" as " + renamedItem.getName() +" in your shared folder " + renamedItem.getPath().substring(0, renamedItem.getPath().lastIndexOf('/')); + + if (rootSharedFolder.isShared()) { WorkspaceSharedFolder sharedWSFolder = (WorkspaceSharedFolder) renamedItem.getParent(); if (sharedWSFolder.isVreFolder()) { notifyText = "renamed "+ previousName +" as " + renamedItem.getName() +" in the workspace group folder " + sharedWSFolder.getDisplayName(); diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java index 6465646..16464f5 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/NotificationsManager.java @@ -95,10 +95,11 @@ public interface NotificationsManager { * * @param userIdToNotify the user you want to notify * @param previousName the previous name of the folder - * @param renamedItem the renamed {@link WorkspaceItem} + * @param renamedItem the renamed {@link WorkspaceItem} + * @param rootSharedFolder the root shared {@link WorkspaceFolder} of the {@link WorkspaceItem} * @return true if the notification is correctly delivered, false otherwise */ - boolean notifyItemRenaming(String userIdToNotify, String previousName, WorkspaceItem renamedItem) throws Exception; + boolean notifyItemRenaming(String userIdToNotify, String previousName, WorkspaceItem renamedItem, WorkspaceFolder rootSharedFolder) throws Exception; /** * * @param userIdToNotify the user you want to notify diff --git a/src/main/java/org/gcube/applicationsupportlayer/social/storage/FTPManager.java b/src/main/java/org/gcube/applicationsupportlayer/social/storage/FTPManager.java index 1ae0705..cd3e504 100644 --- a/src/main/java/org/gcube/applicationsupportlayer/social/storage/FTPManager.java +++ b/src/main/java/org/gcube/applicationsupportlayer/social/storage/FTPManager.java @@ -117,9 +117,9 @@ public class FTPManager { } public String getBaseURL() throws Exception { - String httpBaseURL = endPoint.profile().runtime().hostedOn()+UPLOAD_FOLDER_NAME+"/"; + String httpBaseURL = endPoint.profile().runtime().hostedOn(); if (httpBaseURL != null) { - return httpBaseURL; + return httpBaseURL+UPLOAD_FOLDER_NAME+"/"; } else throw new ServiceConfigurationError("Could not find a valid FTP Server in the infrastructure"); }