diff --git a/source/java/org/alfresco/wcm/sandbox/SandboxInfo.java b/source/java/org/alfresco/wcm/sandbox/SandboxInfo.java
index d7c6c6bc79..dfea085bee 100644
--- a/source/java/org/alfresco/wcm/sandbox/SandboxInfo.java
+++ b/source/java/org/alfresco/wcm/sandbox/SandboxInfo.java
@@ -59,6 +59,16 @@ public interface SandboxInfo
public String getCreator();
+ /**
+ * The sandbox root relative path - eg. for WCM, typically /www
+ */
+ public String getSandboxRootPath();
+
+ /**
+ * The webapps root relative path - eg. for WCM, typically /www/avm_webapps
+ */
+ public String getWebAppsPath();
+
/**
* A list of ids of the stores within this sandbox.
* The "main" store should come first in this list;
diff --git a/source/java/org/alfresco/wcm/sandbox/SandboxInfoImpl.java b/source/java/org/alfresco/wcm/sandbox/SandboxInfoImpl.java
index 4640f6e50a..df442e0c4c 100644
--- a/source/java/org/alfresco/wcm/sandbox/SandboxInfoImpl.java
+++ b/source/java/org/alfresco/wcm/sandbox/SandboxInfoImpl.java
@@ -26,6 +26,7 @@ package org.alfresco.wcm.sandbox;
import java.util.Date;
+import org.alfresco.config.JNDIConstants;
import org.alfresco.service.namespace.QName;
/**
@@ -82,6 +83,16 @@ public class SandboxInfoImpl implements SandboxInfo
{
return this.creator;
}
+
+ public String getSandboxRootPath()
+ {
+ return "/"+JNDIConstants.DIR_DEFAULT_WWW;
+ }
+
+ public String getWebAppsPath()
+ {
+ return JNDIConstants.DIR_DEFAULT_WWW_APPBASE;
+ }
/**
* A list of names of the stores within this sandbox.
diff --git a/source/java/org/alfresco/wcm/sandbox/SandboxService.java b/source/java/org/alfresco/wcm/sandbox/SandboxService.java
index 17142d94fc..c46c92956e 100644
--- a/source/java/org/alfresco/wcm/sandbox/SandboxService.java
+++ b/source/java/org/alfresco/wcm/sandbox/SandboxService.java
@@ -175,28 +175,33 @@ public interface SandboxService
*
* Note: This will list new/modified/deleted items from the directory and below. The destination path will be dervied.
*
- * @param avmSrcPath source sandbox path (an AVM path)
+ * @param sbStoreId sandbox store id
+ * @param relativePath relative path to filter by (eg. /www/avm_webapps/ROOT/MyFolderToList)
* @param includeDeleted if true, include deleted items as well as new/modified items
* @return List list of changed items
*/
- public List listChangedItemsDir(String avmSrcPath, boolean includeDeleted);
+ public List listChangedItemsDir(String sbStoreId, String relativePath, boolean includeDeleted);
/**
* List changed (new/modified/deleted) items between any two sandbox paths
*
- * @param avmSrcPath source sandbox path (an AVM path)
- * @param avmDstPath destination sandbox path (an AVM path)
+ * @param srcSandboxStoreId source sandbox store id
+ * @param srcRelativePath source relative path to filter by (eg. /www/avm_webapps/ROOT/MyFolderToList)
+ * @param dstSandboxStoreId destination sandbox store id
+ * @param dstRelativePath destination relative path to filter by (eg. /www/avm_webapps/ROOT/MyFolderToList)
* @param includeDeleted if true, include deleted items as well as new/modified items
* @return List list of changed items
*/
- public List listChangedItems(String avmSrcPath, String avmDstPath, boolean includeDeleted);
+ public List listChangedItems(String srcSandboxStoreId, String srcRelativePath, String dstSandboxStoreId, String dstRelativePath, boolean includeDeleted);
/**
* Submit all changed items for given sandbox (eg. from user sandbox to staging sandbox)
*
- * Note: This will submit new/modified/deleted items from the root directory and below, including all web apps
+ * Note: This will submit new/modified/deleted items from the sandbox root directory (eg. /www) and below, including all web apps
*
- * @param sbStoreId sandbox store id
+ * @param sbStoreId sandbox store id
+ * @param submitLabel label for submitted snapshot
+ * @param submitComment comment for submitted snapshot
*/
public void submitAll(String sbStoreId, String submitLabel, String submitComment);
@@ -205,8 +210,10 @@ public interface SandboxService
*
* Note: This will submit new/modified/deleted items for the given web app
*
- * @param sbStoreId sandbox store id
- * @param webApp web app to filter by
+ * @param sbStoreId sandbox store id
+ * @param webApp web app to filter by
+ * @param submitLabel label for submitted snapshot
+ * @param submitComment comment for submitted snapshot
*/
public void submitAllWebApp(String sbStoreId, String webApp, String submitLabel, String submitComment);
@@ -215,31 +222,48 @@ public interface SandboxService
*
* Note: This will submit new/modified/deleted items from the directory and below
*
- * @param avmDirectoryPath path to filter by
+ * @param sbStoreId sandbox store id
+ * @param relativePath relative path to filter by (eg. /www/avm_webapps/ROOT/MyFolderToRevert)
+ * @param submitLabel label for submitted snapshot
+ * @param submitComment comment for submitted snapshot
*/
- public void submitAllDir(String avmDirectoryPath, String submitLabel, String submitComment);
+ public void submitAllDir(String sbStoreId, String relativePath, String submitLabel, String submitComment);
+
+ /**
+ * Submit list of changed items for given sandbox path (eg. in user sandbox)
+ *
+ * @param sbStoreId sandbox store id
+ * @param itemPaths list of items, as relative paths (eg. /www/avm_webapps/ROOT/MyFolderToRevert)
+ * @param submitLabel label for submitted snapshot
+ * @param submitComment comment for submitted snapshot
+ */
+ public void submitList(String sbStoreId, List relativePaths, String submitLabel, String submitComment);
/**
* Submit list of changed items for given sandbox (eg. from user sandbox to staging sandbox)
*
- * @param sbStoreId sandbox store id
- * @param items list of AVM node descriptors
+ * @param sbStoreId sandbox store id
+ * @param itemNodes list of items, as AVM node descriptors
+ * @param submitLabel label for submitted snapshot
+ * @param submitComment comment for submitted snapshot
*/
- public void submitList(String sbStoreId, List items, String submitLabel, String submitComment);
+ public void submitListNodes(String sbStoreId, List items, String submitLabel, String submitComment);
/**
* Submit list of changed items for given sandbox (eg. from user sandbox to staging sandbox)
*
* @param sbStoreId sandbox store id
- * @param items list of AVM node descriptors
+ * @param items list of items, as AVM node descriptors
* @param expirationDates map of for those items set with an expiration date, or can be null (if no expiration dates)
+ * @param submitLabel label for submitted snapshot
+ * @param submitComment comment for submitted snapshot
*/
- public void submitList(String sbStoreId, List items, Map expirationDates, final String submitLabel, final String submitComment);
+ public void submitListNodes(String sbStoreId, List items, Map expirationDates, String submitLabel, String submitComment);
/**
* Revert all changed items for given sandbox (eg. in user sandbox)
*
- * Note: This will revert new/modified/deleted items from the root directory and below, including all web apps
+ * Note: This will revert new/modified/deleted items from the sandbox root directory (eg. /www) and below, including all web apps
*
* @param sbStoreId sandbox store id
*/
@@ -260,16 +284,17 @@ public interface SandboxService
*
* Note: This will revert new/modified/deleted items from the directory and below
*
- * @param avmDirectoryPath path to filter by
+ * @param sbStoreId sandbox store id
+ * @param relativePath relative path to filter by (eg. /www/avm_webapps/ROOT/MyFolderToRevert)
*/
- public void revertAllDir(String avmDirectoryPath);
+ public void revertAllDir(String sbStoreId, String relativePath);
/**
* Revert list of changed items for given sandbox (eg. in user sandbox)
*
* @param items list of AVM node descriptors
*/
- public void revertList(String sbStoreId, List items);
+ public void revertListNodes(String sbStoreId, List items);
/**
* Revert sandbox to a specific snapshot version ID (ie. for staging sandbox)
diff --git a/source/java/org/alfresco/wcm/sandbox/SandboxServiceImpl.java b/source/java/org/alfresco/wcm/sandbox/SandboxServiceImpl.java
index 2a5f5b4660..231fb7ddb0 100644
--- a/source/java/org/alfresco/wcm/sandbox/SandboxServiceImpl.java
+++ b/source/java/org/alfresco/wcm/sandbox/SandboxServiceImpl.java
@@ -354,9 +354,8 @@ public class SandboxServiceImpl extends WCMUtil implements SandboxService
{
ParameterCheck.mandatoryString("sbStoreId", sbStoreId);
- // no filtering
- String avmDirectoryPath = sbStoreId+":/";
- return listChangedItemsDir(avmDirectoryPath, includeDeleted);
+ String avmDirectoryPath = WCMUtil.buildStoreRootPath(sbStoreId); // currently :/www
+ return listChangedItemsDir(sbStoreId, WCMUtil.getStoreRelativePath(avmDirectoryPath), includeDeleted);
}
/* (non-Javadoc)
@@ -369,49 +368,49 @@ public class SandboxServiceImpl extends WCMUtil implements SandboxService
// filter by current webapp
String avmDirectoryPath = WCMUtil.buildStoreWebappPath(sbStoreId, webApp);
- return listChangedItemsDir(avmDirectoryPath, includeDeleted);
+ return listChangedItemsDir(sbStoreId, WCMUtil.getStoreRelativePath(avmDirectoryPath), includeDeleted);
}
/* (non-Javadoc)
- * @see org.alfresco.wcm.sandbox.SandboxService#listChangedItemsDir(java.lang.String, boolean)
+ * @see org.alfresco.wcm.sandbox.SandboxService#listChangedItemsDir(java.lang.String, java.lang.String, boolean)
*/
- public List listChangedItemsDir(String avmDirectoryPath, boolean includeDeleted)
+ public List listChangedItemsDir(String sbStoreId, String relativePath, boolean includeDeleted)
{
- ParameterCheck.mandatoryString("avmDirectoryPath", avmDirectoryPath);
-
- String sandboxId = WCMUtil.getSandboxStoreId(avmDirectoryPath);
+ ParameterCheck.mandatoryString("sbStoreId", sbStoreId);
+ ParameterCheck.mandatoryString("relativePath", relativePath);
// TODO - allow list for any sandbox
- if (! WCMUtil.isUserStore(sandboxId))
+ if (! WCMUtil.isUserStore(sbStoreId))
{
- throw new AlfrescoRuntimeException("Not an author sandbox: "+sandboxId);
+ throw new AlfrescoRuntimeException("Not an author sandbox: "+sbStoreId);
}
-
+
// build the paths to the stores to compare - filter by given directory path
- String wpStoreId = WCMUtil.getWebProjectStoreId(sandboxId);
+ String wpStoreId = WCMUtil.getWebProjectStoreId(sbStoreId);
String stagingSandboxId = WCMUtil.buildStagingStoreName(wpStoreId);
- String relativePath = WCMUtil.getStoreRelativePath(avmDirectoryPath);
-
- String srcPath = sandboxId + AVM_STORE_SEPARATOR + relativePath;
- String dstPath = stagingSandboxId + AVM_STORE_SEPARATOR + relativePath;
-
- return listChangedItems(srcPath, dstPath, includeDeleted);
+ return listChangedItems(sbStoreId, relativePath, stagingSandboxId, relativePath, includeDeleted);
}
/* (non-Javadoc)
- * @see org.alfresco.wcm.sandbox.SandboxService#listChangedItems(java.lang.String, java.lang.String, boolean)
+ * @see org.alfresco.wcm.sandbox.SandboxService#listChangedItems(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean)
*/
- public List listChangedItems(String avmSrcPath, String avmDstPath, boolean includeDeleted)
+ public List listChangedItems(String srcSandboxStoreId, String srcRelativePath, String dstSandboxStoreId, String dstRelativePath, boolean includeDeleted)
{
+ ParameterCheck.mandatoryString("srcSandboxStoreId", srcSandboxStoreId);
+ ParameterCheck.mandatoryString("srcRelativePath", srcRelativePath);
+
+ ParameterCheck.mandatoryString("dstSandboxStoreId", dstSandboxStoreId);
+ ParameterCheck.mandatoryString("dstRelativePath", dstRelativePath);
+
+ String avmSrcPath = srcSandboxStoreId + AVM_STORE_SEPARATOR + srcRelativePath;
+ String avmDstPath = dstSandboxStoreId + AVM_STORE_SEPARATOR + dstRelativePath;
+
return listChangedItems(-1, avmSrcPath, -1, avmDstPath, includeDeleted);
}
private List listChangedItems(int srcVersion, String srcPath, int dstVersion, String dstPath, boolean includeDeleted)
{
- ParameterCheck.mandatoryString("srcPath", srcPath);
- ParameterCheck.mandatoryString("dstPath", dstPath);
-
long start = System.currentTimeMillis();
List diffs = avmSyncService.compare(srcVersion, srcPath, dstVersion, dstPath, nameMatcher);
@@ -444,8 +443,8 @@ public class SandboxServiceImpl extends WCMUtil implements SandboxService
{
ParameterCheck.mandatoryString("sbStoreId", sbStoreId);
- String avmDirectoryPath = sbStoreId+":/";
- submitAllDir(avmDirectoryPath, submitLabel, submitComment);
+ String avmDirectoryPath = WCMUtil.buildStoreRootPath(sbStoreId); // currently :/www
+ submitAllDir(sbStoreId, WCMUtil.getStoreRelativePath(avmDirectoryPath), submitLabel, submitComment);
}
/* (non-Javadoc)
@@ -457,35 +456,55 @@ public class SandboxServiceImpl extends WCMUtil implements SandboxService
ParameterCheck.mandatoryString("webApp", webApp);
String avmDirectoryPath = WCMUtil.buildStoreWebappPath(sbStoreId, webApp);
- submitAllDir(avmDirectoryPath, submitLabel, submitComment);
+ submitAllDir(sbStoreId, WCMUtil.getStoreRelativePath(avmDirectoryPath), submitLabel, submitComment);
}
/* (non-Javadoc)
- * @see org.alfresco.wcm.sandbox.SandboxService#submitAllDir(java.lang.String, java.lang.String, java.lang.String)
+ * @see org.alfresco.wcm.sandbox.SandboxService#submitAllDir(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
*/
- public void submitAllDir(String avmDirectoryPath, String submitLabel, String submitComment)
+ public void submitAllDir(String sbStoreId, String relativePath, String submitLabel, String submitComment)
{
- ParameterCheck.mandatoryString("avmDirectoryPath", avmDirectoryPath);
+ ParameterCheck.mandatoryString("sbStoreId", sbStoreId);
+ ParameterCheck.mandatoryString("relativePath", relativePath);
- String sbStoreId = WCMUtil.getSandboxStoreId(avmDirectoryPath);
+ List items = listChangedItemsDir(sbStoreId, relativePath, true);
- List items = listChangedItemsDir(avmDirectoryPath, true);
-
- submitList(sbStoreId, items, submitLabel, submitComment);
+ submitListNodes(sbStoreId, items, submitLabel, submitComment);
}
- /* (non-Javadoc)
- * @see org.alfresco.wcm.sandbox.SandboxService#submitList(java.lang.String, java.util.List, java.lang.String, java.lang.String)
- */
- public void submitList(String sbStoreId, List items, final String submitLabel, final String submitComment)
+ public void submitList(String sbStoreId, List relativePaths, String submitLabel, String submitComment)
{
- submitList(sbStoreId, items, null, submitLabel, submitComment);
+ ParameterCheck.mandatoryString("sbStoreId", sbStoreId);
+
+ List items = new ArrayList(relativePaths.size());
+
+ for (String relativePath : relativePaths)
+ {
+ // convert each path into an AVM node descriptor
+ AVMNodeDescriptor node = avmService.lookup(-1, sbStoreId + WCMUtil.AVM_STORE_SEPARATOR + relativePath, true);
+ if (node != null)
+ {
+ items.add(node);
+ }
+ }
+
+ submitListNodes(sbStoreId, items, null, submitLabel, submitComment);
}
/* (non-Javadoc)
- * @see org.alfresco.wcm.sandbox.SandboxService#submitList(java.lang.String, java.util.List, java.util.Map, java.lang.String, java.lang.String)
+ * @see org.alfresco.wcm.sandbox.SandboxService#submitListNodes(java.lang.String, java.util.List, java.lang.String, java.lang.String)
*/
- public void submitList(String sbStoreId, List items, Map expirationDates, final String submitLabel, final String submitComment)
+ public void submitListNodes(String sbStoreId, List items, String submitLabel, String submitComment)
+ {
+ ParameterCheck.mandatoryString("sbStoreId", sbStoreId);
+
+ submitListNodes(sbStoreId, items, null, submitLabel, submitComment);
+ }
+
+ /* (non-Javadoc)
+ * @see org.alfresco.wcm.sandbox.SandboxService#submitListNodes(java.lang.String, java.util.List, java.util.Map, java.lang.String, java.lang.String)
+ */
+ public void submitListNodes(String sbStoreId, List items, Map expirationDates, final String submitLabel, final String submitComment)
{
ParameterCheck.mandatoryString("sbStoreId", sbStoreId);
@@ -555,14 +574,14 @@ public class SandboxServiceImpl extends WCMUtil implements SandboxService
}
/* (non-Javadoc)
- * @see org.alfresco.wcm.sandbox.SandboxService#revertAll(java.lang.String, java.lang.String)
+ * @see org.alfresco.wcm.sandbox.SandboxService#revertAll(java.lang.String)
*/
public void revertAll(String sbStoreId)
{
ParameterCheck.mandatoryString("sbStoreId", sbStoreId);
- String avmDirectoryPath = sbStoreId+":/";
- revertAllDir(avmDirectoryPath);
+ String avmDirectoryPath = WCMUtil.buildStoreRootPath(sbStoreId); // currently :/www
+ revertAllDir(sbStoreId, WCMUtil.getStoreRelativePath(avmDirectoryPath));
}
/* (non-Javadoc)
@@ -574,27 +593,26 @@ public class SandboxServiceImpl extends WCMUtil implements SandboxService
ParameterCheck.mandatoryString("webApp", webApp);
String avmDirectoryPath = WCMUtil.buildStoreWebappPath(sbStoreId, webApp);
- revertAllDir(avmDirectoryPath);
+ revertAllDir(sbStoreId, WCMUtil.getStoreRelativePath(avmDirectoryPath));
}
/* (non-Javadoc)
- * @see org.alfresco.wcm.sandbox.SandboxService#revertAll(java.lang.String)
+ * @see org.alfresco.wcm.sandbox.SandboxService#revertAllDir(java.lang.String, java.lang.String)
*/
- public void revertAllDir(String avmDirectoryPath)
+ public void revertAllDir(String sbStoreId, String relativePath)
{
- ParameterCheck.mandatoryString("avmDirectoryPath", avmDirectoryPath);
+ ParameterCheck.mandatoryString("sbStoreId", sbStoreId);
+ ParameterCheck.mandatoryString("relativePath", relativePath);
- String sbStoreId = WCMUtil.getSandboxStoreId(avmDirectoryPath);
-
- List items = listChangedItemsDir(avmDirectoryPath, true);
+ List items = listChangedItemsDir(sbStoreId, relativePath, true);
- revertList(sbStoreId, items);
+ revertListNodes(sbStoreId, items);
}
/* (non-Javadoc)
- * @see org.alfresco.wcm.sandbox.SandboxService#revertList(java.lang.String, java.lang.String, java.util.List)
+ * @see org.alfresco.wcm.sandbox.SandboxService#revertListNodes(java.lang.String, java.util.List)
*/
- public void revertList(String sbStoreId, List items)
+ public void revertListNodes(String sbStoreId, List items)
{
ParameterCheck.mandatoryString("sbStoreId", sbStoreId);
diff --git a/source/java/org/alfresco/wcm/sandbox/SandboxServiceImplTest.java b/source/java/org/alfresco/wcm/sandbox/SandboxServiceImplTest.java
index 47282b45d3..b4cd521cc0 100644
--- a/source/java/org/alfresco/wcm/sandbox/SandboxServiceImplTest.java
+++ b/source/java/org/alfresco/wcm/sandbox/SandboxServiceImplTest.java
@@ -34,7 +34,6 @@ import java.util.Map;
import junit.framework.TestCase;
-import org.alfresco.config.JNDIConstants;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
@@ -62,6 +61,8 @@ public class SandboxServiceImplTest extends TestCase
{
private static final ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();
+ private char AVM_STORE_SEPARATOR = ':';
+
//
// test data
//
@@ -506,8 +507,11 @@ public class SandboxServiceImplTest extends TestCase
List items = sbService.listChangedItems(sbStoreId, true);
assertEquals(0, items.size());
- String authorSandboxRootPath = sbStoreId + ":/";
- String authorSandboxWebppPath = sbStoreId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + wpInfo.getDefaultWebApp();
+ String authorSandboxRootRelativePath = sbInfo.getSandboxRootPath();
+ String authorSandboxWebAppRelativePath = sbInfo.getWebAppsPath() + "/" + wpInfo.getDefaultWebApp();
+
+ String authorSandboxRootPath = sbStoreId + AVM_STORE_SEPARATOR + authorSandboxRootRelativePath;
+ String authorSandboxWebAppPath = sbStoreId + AVM_STORE_SEPARATOR + authorSandboxWebAppRelativePath;
avmLockingAwareService.createFile(authorSandboxRootPath, "myFile1");
@@ -515,12 +519,12 @@ public class SandboxServiceImplTest extends TestCase
assertEquals(1, items.size());
assertEquals("myFile1", items.get(0).getName());
- avmLockingAwareService.createDirectory(authorSandboxWebppPath, "myDir1");
- avmLockingAwareService.createFile(authorSandboxWebppPath+"/myDir1", "myFile2");
- avmLockingAwareService.createDirectory(authorSandboxWebppPath+"/myDir1", "myDir2");
- avmLockingAwareService.createFile(authorSandboxWebppPath+"/myDir1/myDir2", "myFile3");
- avmLockingAwareService.createFile(authorSandboxWebppPath+"/myDir1/myDir2", "myFile4");
- avmLockingAwareService.createDirectory(authorSandboxWebppPath+"/myDir1", "myDir3");
+ avmLockingAwareService.createDirectory(authorSandboxWebAppPath, "myDir1");
+ avmLockingAwareService.createFile(authorSandboxWebAppPath+"/myDir1", "myFile2");
+ avmLockingAwareService.createDirectory(authorSandboxWebAppPath+"/myDir1", "myDir2");
+ avmLockingAwareService.createFile(authorSandboxWebAppPath+"/myDir1/myDir2", "myFile3");
+ avmLockingAwareService.createFile(authorSandboxWebAppPath+"/myDir1/myDir2", "myFile4");
+ avmLockingAwareService.createDirectory(authorSandboxWebAppPath+"/myDir1", "myDir3");
items = sbService.listChangedItems(sbStoreId, false);
assertEquals(2, items.size()); // new dir with new dirs/files is returned as single change
@@ -556,7 +560,7 @@ public class SandboxServiceImplTest extends TestCase
}
}
- items = sbService.listChangedItemsDir(authorSandboxWebppPath+"/myDir1", false);
+ items = sbService.listChangedItemsDir(sbStoreId, authorSandboxWebAppRelativePath+"/myDir1", false);
assertEquals(1, items.size());
for (AVMNodeDescriptor item : items)
@@ -591,7 +595,7 @@ public class SandboxServiceImplTest extends TestCase
List items = sbService.listChangedItems(sbStoreId, true);
assertEquals(0, items.size());
- String authorSandboxRootPath = sbStoreId + ":/";
+ String authorSandboxRootPath = sbStoreId + AVM_STORE_SEPARATOR + sbInfo1.getSandboxRootPath();
avmLockingAwareService.createFile(authorSandboxRootPath, "myFile1");
@@ -608,7 +612,7 @@ public class SandboxServiceImplTest extends TestCase
items = sbService.listChangedItems(sbStoreId, true);
assertEquals(0, items.size());
- authorSandboxRootPath = sbStoreId + ":/";
+ authorSandboxRootPath = sbStoreId + AVM_STORE_SEPARATOR + sbInfo2.getSandboxRootPath();
avmLockingAwareService.createFile(authorSandboxRootPath, "myFile2");
avmLockingAwareService.createFile(authorSandboxRootPath, "myFile3");
@@ -638,11 +642,11 @@ public class SandboxServiceImplTest extends TestCase
sbInfo1 = sbService.getAuthorSandbox(wpStoreId, USER_ONE);
sbInfo2 = sbService.getAuthorSandbox(wpStoreId, USER_TWO);
- items = sbService.listChangedItems(sbInfo1.getSandboxId()+":/", sbInfo2.getSandboxId()+":/", false);
+ items = sbService.listChangedItems(sbInfo1.getSandboxId(), sbInfo1.getSandboxRootPath(), sbInfo2.getSandboxId(), sbInfo2.getSandboxRootPath(), false);
assertEquals(1, items.size());
assertEquals("myFile1", items.get(0).getName());
- items = sbService.listChangedItems(sbInfo2.getSandboxId()+":/", sbInfo1.getSandboxId()+":/", false);
+ items = sbService.listChangedItems(sbInfo2.getSandboxId(), sbInfo1.getSandboxRootPath(), sbInfo1.getSandboxId(), sbInfo2.getSandboxRootPath(), false);
assertEquals(2, items.size());
for (AVMNodeDescriptor item : items)
@@ -681,7 +685,7 @@ public class SandboxServiceImplTest extends TestCase
List items = sbService.listChangedItems(sbStoreId, true);
assertEquals(0, items.size());
- String authorSandboxRootPath = sbStoreId + ":/";
+ String authorSandboxRootPath = sbStoreId + AVM_STORE_SEPARATOR + sbInfo1.getSandboxRootPath();
avmNonLockingAwareService.createFile(authorSandboxRootPath, "myFile1");
@@ -698,7 +702,7 @@ public class SandboxServiceImplTest extends TestCase
items = sbService.listChangedItems(sbStoreId, true);
assertEquals(0, items.size());
- authorSandboxRootPath = sbStoreId + ":/";
+ authorSandboxRootPath = sbStoreId + AVM_STORE_SEPARATOR + sbInfo2.getSandboxRootPath();
avmNonLockingAwareService.createFile(authorSandboxRootPath, "myFile1"); // allowed, since using base (non-locking-aware) AVM service
avmNonLockingAwareService.createFile(authorSandboxRootPath, "myFile2");
@@ -733,11 +737,11 @@ public class SandboxServiceImplTest extends TestCase
sbInfo1 = sbService.getAuthorSandbox(wpStoreId, USER_ONE);
sbInfo2 = sbService.getAuthorSandbox(wpStoreId, USER_TWO);
- items = sbService.listChangedItems(sbInfo1.getSandboxId()+":/", sbInfo2.getSandboxId()+":/", false);
+ items = sbService.listChangedItems(sbInfo1.getSandboxId(), sbInfo1.getSandboxRootPath(), sbInfo2.getSandboxId(), sbInfo2.getSandboxRootPath(), false);
assertEquals(1, items.size());
assertEquals("myFile1", items.get(0).getName());
- items = sbService.listChangedItems(sbInfo2.getSandboxId()+":/", sbInfo1.getSandboxId()+":/", false);
+ items = sbService.listChangedItems(sbInfo2.getSandboxId(), sbInfo1.getSandboxRootPath(), sbInfo1.getSandboxId(), sbInfo2.getSandboxRootPath(), false);
assertEquals(3, items.size());
for (AVMNodeDescriptor item : items)
@@ -783,7 +787,7 @@ public class SandboxServiceImplTest extends TestCase
List items = sbService.listChangedItems(authorSandboxId, true);
assertEquals(0, items.size());
- String authorSandboxWebppPath = authorSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String authorSandboxWebppPath = authorSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
avmLockingAwareService.createFile(authorSandboxWebppPath, "myFile1");
avmLockingAwareService.createDirectory(authorSandboxWebppPath, "myDir1");
@@ -797,7 +801,7 @@ public class SandboxServiceImplTest extends TestCase
assertEquals(2, items.size()); // new dir with new dirs/files is returned as single change
// check staging before
- String stagingSandboxWebppPath = stagingSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String stagingSandboxWebppPath = stagingSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
assertEquals(0, avmLockingAwareService.getDirectoryListing(-1, stagingSandboxWebppPath, false).size());
// submit (new items) !
@@ -850,7 +854,7 @@ public class SandboxServiceImplTest extends TestCase
List items = sbService.listChangedItems(authorSandboxId, true);
assertEquals(0, items.size());
- String authorSandboxWebppPath = authorSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String authorSandboxWebppPath = authorSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
final String MYFILE1 = "This is myFile1";
OutputStream out = avmLockingAwareService.createFile(authorSandboxWebppPath, "myFile1");
@@ -870,7 +874,7 @@ public class SandboxServiceImplTest extends TestCase
assertEquals(2, items.size());
// check staging before
- String stagingSandboxWebppPath = stagingSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String stagingSandboxWebppPath = stagingSandboxId + ":" + sbInfo.getWebAppsPath() + "/" + webApp;
assertEquals(0, avmLockingAwareService.getDirectoryListing(-1, stagingSandboxWebppPath, false).size());
// submit (new items) !
@@ -893,7 +897,7 @@ public class SandboxServiceImplTest extends TestCase
items = sbService.listChangedItems(authorSandboxId, true);
assertEquals(0, items.size());
- authorSandboxWebppPath = authorSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ authorSandboxWebppPath = authorSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
final String MYFILE1_MODIFIED = "This is myFile1 ... modified by "+USER_TWO;
out = avmLockingAwareService.getFileOutputStream(authorSandboxWebppPath+"/myFile1");
@@ -911,7 +915,7 @@ public class SandboxServiceImplTest extends TestCase
assertEquals(2, items.size());
// check staging before
- stagingSandboxWebppPath = stagingSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ stagingSandboxWebppPath = stagingSandboxId + ":" + sbInfo.getWebAppsPath() + "/" + webApp;
InputStream in = avmLockingAwareService.getFileInputStream(-1, stagingSandboxWebppPath+"/myFile1");
buff = new byte[1024];
@@ -968,7 +972,7 @@ public class SandboxServiceImplTest extends TestCase
List items = sbService.listChangedItems(authorSandboxId, true);
assertEquals(0, items.size());
- String authorSandboxWebppPath = authorSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String authorSandboxWebppPath = authorSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
final String MYFILE1 = "This is myFile1";
OutputStream out = avmLockingAwareService.createFile(authorSandboxWebppPath, "myFile1");
@@ -989,7 +993,7 @@ public class SandboxServiceImplTest extends TestCase
assertEquals(2, items.size());
// check staging before
- String stagingSandboxWebppPath = stagingSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String stagingSandboxWebppPath = stagingSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
assertEquals(0, avmLockingAwareService.getDirectoryListing(-1, stagingSandboxWebppPath, false).size());
// submit (new items) !
@@ -1012,7 +1016,7 @@ public class SandboxServiceImplTest extends TestCase
items = sbService.listChangedItems(authorSandboxId, true);
assertEquals(0, items.size());
- authorSandboxWebppPath = authorSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ authorSandboxWebppPath = authorSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
avmLockingAwareService.removeNode(authorSandboxWebppPath+"/myFile1");
avmLockingAwareService.removeNode(authorSandboxWebppPath+"/myDir1/myDir2");
@@ -1026,7 +1030,7 @@ public class SandboxServiceImplTest extends TestCase
assertEquals(2, items.size());
// check staging before
- stagingSandboxWebppPath = stagingSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ stagingSandboxWebppPath = stagingSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
assertNotNull(avmLockingAwareService.lookup(-1, stagingSandboxWebppPath+"/myFile1"));
assertNotNull(avmLockingAwareService.lookup(-1, stagingSandboxWebppPath+"/myDir1"));
@@ -1070,7 +1074,7 @@ public class SandboxServiceImplTest extends TestCase
List items = sbService.listChangedItems(authorSandboxId, true);
assertEquals(0, items.size());
- String authorSandboxWebppPath = authorSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String authorSandboxWebppPath = authorSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
final String MYFILE1 = "This is myFile1";
OutputStream out = avmLockingAwareService.createFile(authorSandboxWebppPath, "myFile1");
@@ -1090,7 +1094,7 @@ public class SandboxServiceImplTest extends TestCase
assertEquals(2, items.size());
// check staging before
- String stagingSandboxWebppPath = stagingSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String stagingSandboxWebppPath = stagingSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
assertEquals(0, avmLockingAwareService.getDirectoryListing(-1, stagingSandboxWebppPath, false).size());
// submit (new items) !
@@ -1113,7 +1117,7 @@ public class SandboxServiceImplTest extends TestCase
items = sbService.listChangedItems(authorSandboxId, true);
assertEquals(0, items.size());
- authorSandboxWebppPath = authorSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ authorSandboxWebppPath = authorSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
final String MYFILE1_MODIFIED = "This is myFile1 ... modified by "+USER_TWO;
out = avmLockingAwareService.getFileOutputStream(authorSandboxWebppPath+"/myFile1");
@@ -1131,7 +1135,7 @@ public class SandboxServiceImplTest extends TestCase
assertEquals(2, items.size());
// check staging before
- stagingSandboxWebppPath = stagingSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ stagingSandboxWebppPath = stagingSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
InputStream in = avmLockingAwareService.getFileInputStream(-1, stagingSandboxWebppPath+"/myFile1");
buff = new byte[1024];
@@ -1188,7 +1192,7 @@ public class SandboxServiceImplTest extends TestCase
List items = sbService.listChangedItems(authorSandboxId, true);
assertEquals(0, items.size());
- String authorSandboxWebppPath = authorSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String authorSandboxWebppPath = authorSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
avmLockingAwareService.createDirectory(authorSandboxWebppPath, "myDir1");
avmLockingAwareService.createDirectory(authorSandboxWebppPath, "myDir2");
@@ -1198,7 +1202,7 @@ public class SandboxServiceImplTest extends TestCase
assertEquals(3, items.size());
// check staging before
- String stagingSandboxWebppPath = stagingSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String stagingSandboxWebppPath = stagingSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
assertEquals(0, avmLockingAwareService.getDirectoryListing(-1, stagingSandboxWebppPath, false).size());
List sbVersions = sbService.listSnapshots(stagingSandboxId, fromDate, new Date(), false);
@@ -1258,7 +1262,7 @@ public class SandboxServiceImplTest extends TestCase
List items = sbService.listChangedItems(authorSandboxId, true);
assertEquals(0, items.size());
- String authorSandboxWebppPath = authorSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String authorSandboxWebppPath = authorSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
avmLockingAwareService.createDirectory(authorSandboxWebppPath, "myDir1");
@@ -1266,7 +1270,7 @@ public class SandboxServiceImplTest extends TestCase
assertEquals(1, items.size());
// check staging before
- String stagingSandboxWebppPath = stagingSandboxId + ":" + JNDIConstants.DIR_DEFAULT_WWW_APPBASE + "/" + webApp;
+ String stagingSandboxWebppPath = stagingSandboxId + AVM_STORE_SEPARATOR + sbInfo.getWebAppsPath() + "/" + webApp;
assertEquals(0, avmLockingAwareService.getDirectoryListing(-1, stagingSandboxWebppPath, false).size());
List sbVersions = sbService.listSnapshots(stagingSandboxId, fromDate, new Date(), false);
diff --git a/source/java/org/alfresco/wcm/sandbox/script/Sandbox.java b/source/java/org/alfresco/wcm/sandbox/script/Sandbox.java
index 06baa71892..6268e6598d 100644
--- a/source/java/org/alfresco/wcm/sandbox/script/Sandbox.java
+++ b/source/java/org/alfresco/wcm/sandbox/script/Sandbox.java
@@ -195,7 +195,7 @@ public class Sandbox implements Serializable
*/
public List getModifiedAssetsWebApp(String webApp)
{
- List items = getSandboxService().listChangedItems(getSandboxRef(), webApp, true);
+ List items = getSandboxService().listChangedItemsWebApp(getSandboxRef(), webApp, true);
ArrayList ret = new ArrayList(items.size());
for(AVMNodeDescriptor item : items)
@@ -203,7 +203,7 @@ public class Sandbox implements Serializable
Asset a = new Asset(this, item);
ret.add(a);
}
- return ret;
+ return ret;
}
/**