diff --git a/source/java/org/alfresco/wcm/sandbox/script/Asset.java b/source/java/org/alfresco/wcm/sandbox/script/Asset.java index dbb3c6e36f..e93453c053 100644 --- a/source/java/org/alfresco/wcm/sandbox/script/Asset.java +++ b/source/java/org/alfresco/wcm/sandbox/script/Asset.java @@ -149,7 +149,9 @@ public class Asset */ public void revert() { - //getSandboxService().revertList(getSandbox().getSandboxRef(), items); + List items = new ArrayList(1); + items.add(this.getPath()); + getSandboxService().revertList(getSandbox().getSandboxRef(), items); } /** diff --git a/source/java/org/alfresco/wcm/sandbox/script/Sandbox.java b/source/java/org/alfresco/wcm/sandbox/script/Sandbox.java index bc1521dc46..ef3642e7d4 100644 --- a/source/java/org/alfresco/wcm/sandbox/script/Sandbox.java +++ b/source/java/org/alfresco/wcm/sandbox/script/Sandbox.java @@ -38,6 +38,9 @@ import org.alfresco.wcm.webproject.script.WebProject; /** * Sandbox object to expose via JavaScript + * + * Provides access to the sandbox metadata and its collection of assets. + * * @author mrogers * */ @@ -90,6 +93,36 @@ public class Sandbox implements Serializable { getSandboxService().submitAll(getSandboxRef(), submitLabel, submitComment); } + + /** + * Revert the specified assets (files and directories) modified contents of this sandbox + */ + public void revertAssets(Asset[] files) + { + List items = new ArrayList(files.length); + + for(int i = 0; i < files.length; i++) + { + items.add(i, files[i].getPath()); + } + + getSandboxService().revertList(getSandboxRef(), items); + } + + /** + * Revert the specified files and directories modified contents of this sandbox + */ + public void revert(String[] files) + { + List items = new ArrayList(files.length); + + for(int i = 0; i < files.length; i++) + { + items.add(i, files[i]); + } + + getSandboxService().revertList(getSandboxRef(), items); + } /** * Submit the specified assets (files and directories) modified contents of this sandbox @@ -144,14 +177,15 @@ public class Sandbox implements Serializable getSandboxService().revertWebApp(getSandboxRef(), webApp); } - /** - * Get the snapshots - * @param includeSystemGenerated - */ - public void getSnapshots(boolean includeSystemGenerated) - { - getSandboxService().listSnapshots(getSandboxRef(), includeSystemGenerated); - } +// /** +// * Get the snapshots, Version Descriptors +// * @param includeSystemGenerated +// */ +// public void getSnapshots(boolean includeSystemGenerated) +// { +// //TODO - What is returned? +// getSandboxService().listSnapshots(getSandboxRef(), includeSystemGenerated); +// } /** * Get the unique reference for this sandbox