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
This commit is contained in:
Massimiliano Assante 2014-05-14 10:54:04 +00:00
parent 1b9175a3e0
commit 373a7a21cf
5 changed files with 11 additions and 9 deletions

View File

@ -20,7 +20,7 @@
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes> <attributes>
<attribute name="owner.project.facets" value="java"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>

View File

@ -10,7 +10,7 @@
<groupId>org.gcube.applicationsupportlayer</groupId> <groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslsocial</artifactId> <artifactId>aslsocial</artifactId>
<version>0.9.1-SNAPSHOT</version> <version>0.10.0-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Social Portal ASL Extension</name> <name>Social Portal ASL Extension</name>
<description> <description>

View File

@ -362,9 +362,10 @@ public class ApplicationNotificationsManager extends SocialPortalBridge implemen
* @throws InternalErrorException * @throws InternalErrorException
*/ */
@Override @Override
public boolean notifyItemRenaming(String userIdToNotify, String previousName, WorkspaceItem renamedItem) throws InternalErrorException { 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.getParent().getName(); String notifyText = "renamed " + previousName +" as " + renamedItem.getName() +" in your shared folder " + renamedItem.getPath().substring(0, renamedItem.getPath().lastIndexOf('/'));
if (renamedItem.getParent().isShared()) {
if (rootSharedFolder.isShared()) {
WorkspaceSharedFolder sharedWSFolder = (WorkspaceSharedFolder) renamedItem.getParent(); WorkspaceSharedFolder sharedWSFolder = (WorkspaceSharedFolder) renamedItem.getParent();
if (sharedWSFolder.isVreFolder()) { if (sharedWSFolder.isVreFolder()) {
notifyText = "renamed "+ previousName +" as " + renamedItem.getName() +" in the workspace group folder " + sharedWSFolder.getDisplayName(); notifyText = "renamed "+ previousName +" as " + renamedItem.getName() +" in the workspace group folder " + sharedWSFolder.getDisplayName();

View File

@ -95,10 +95,11 @@ public interface NotificationsManager {
* *
* @param userIdToNotify the user you want to notify * @param userIdToNotify the user you want to notify
* @param previousName the previous name of the folder * @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 * @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 * @param userIdToNotify the user you want to notify

View File

@ -117,9 +117,9 @@ public class FTPManager {
} }
public String getBaseURL() throws Exception { public String getBaseURL() throws Exception {
String httpBaseURL = endPoint.profile().runtime().hostedOn()+UPLOAD_FOLDER_NAME+"/"; String httpBaseURL = endPoint.profile().runtime().hostedOn();
if (httpBaseURL != null) { if (httpBaseURL != null) {
return httpBaseURL; return httpBaseURL+UPLOAD_FOLDER_NAME+"/";
} }
else throw new ServiceConfigurationError("Could not find a valid FTP Server in the infrastructure"); else throw new ServiceConfigurationError("Could not find a valid FTP Server in the infrastructure");
} }