Merge WCM_SERVICES2 to HEAD 12236 Implementation of REST WCM Revert

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12308 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers 2008-12-08 15:45:34 +00:00
parent ea7876203e
commit d24b54b4e6
2 changed files with 45 additions and 9 deletions

View File

@ -149,7 +149,9 @@ public class Asset
*/ */
public void revert() public void revert()
{ {
//getSandboxService().revertList(getSandbox().getSandboxRef(), items); List<String> items = new ArrayList<String>(1);
items.add(this.getPath());
getSandboxService().revertList(getSandbox().getSandboxRef(), items);
} }
/** /**

View File

@ -38,6 +38,9 @@ import org.alfresco.wcm.webproject.script.WebProject;
/** /**
* Sandbox object to expose via JavaScript * Sandbox object to expose via JavaScript
*
* Provides access to the sandbox metadata and its collection of assets.
*
* @author mrogers * @author mrogers
* *
*/ */
@ -91,6 +94,36 @@ public class Sandbox implements Serializable
getSandboxService().submitAll(getSandboxRef(), submitLabel, submitComment); getSandboxService().submitAll(getSandboxRef(), submitLabel, submitComment);
} }
/**
* Revert the specified assets (files and directories) modified contents of this sandbox
*/
public void revertAssets(Asset[] files)
{
List<String> items = new ArrayList<String>(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<String> items = new ArrayList<String>(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 * 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); getSandboxService().revertWebApp(getSandboxRef(), webApp);
} }
/** // /**
* Get the snapshots // * Get the snapshots, Version Descriptors
* @param includeSystemGenerated // * @param includeSystemGenerated
*/ // */
public void getSnapshots(boolean includeSystemGenerated) // public void getSnapshots(boolean includeSystemGenerated)
{ // {
getSandboxService().listSnapshots(getSandboxRef(), includeSystemGenerated); // //TODO - What is returned?
} // getSandboxService().listSnapshots(getSandboxRef(), includeSystemGenerated);
// }
/** /**
* Get the unique reference for this sandbox * Get the unique reference for this sandbox