org.alfresco.wcm.sandbox.script
Class Sandbox

java.lang.Object
  extended by org.alfresco.wcm.sandbox.script.Sandbox
All Implemented Interfaces:
java.io.Serializable

public class Sandbox
extends java.lang.Object
implements java.io.Serializable

Sandbox object to expose via JavaScript Provides access to the sandbox metadata and its collection of assets.

See Also:
Serialized Form

Constructor Summary
Sandbox(WebProject webproject, SandboxInfo si)
           
 
Method Summary
 void deleteSandbox()
          Delete this sandbox
 Asset getAsset(java.lang.String path)
          Get the specified asset (Either folder or file)
 Asset getAssetWebApp(java.lang.String webApp, java.lang.String path)
          Get the specified asset with a path relative to the specified web app.
 java.util.Date getCreatedDate()
           
 java.lang.String getCreatedDateAsISO8601()
           
 java.lang.String getCreator()
           
 Asset[] getModifiedAssets()
          Get the modified assets within this sandbox
 Asset[] getModifiedAssetsWebApp(java.lang.String webApp)
          Get the modified assets within this sandbox
 java.lang.String getName()
          Display name for the sandbox
 java.lang.String getSandboxRef()
          Get the unique reference for this sandbox
 java.lang.String[] getStoreNames()
          Get the store names
 WebProject getWebproject()
          Get the web project that owns this sandbox
 boolean isAuthorSandbox()
          Is this an author sandbox ?
 boolean isStagingSandbox()
          Is this a staging sandbox ?
 void revert(java.lang.String[] files)
          Revert the specified files and directories modified contents of this sandbox
 void revertAll()
          Revert all modified contents within this sandbox
 void revertAllWebApp(java.lang.String webApp)
          Revert all modified contents within this sandbox
 void revertAssets(Asset[] files)
          Revert the specified assets (files and directories) modified contents of this sandbox
 void save()
           
 void setName(java.lang.String name)
           
 void setSandboxRef(java.lang.String sandboxRef)
          Set the unique reference for this sandbox - no-op, read only
 void submit(java.lang.String[] files, java.lang.String submitLabel, java.lang.String submitComment)
          Submit the specified files and directories modified contents of this sandbox
 void submitAll(java.lang.String submitLabel, java.lang.String submitComment)
          Submit the modified contents of this sandbox
 void submitAllWebApp(java.lang.String webApp, java.lang.String submitLabel, java.lang.String submitComment)
          Submit the modified contents of the webapp within this sandbox
 void submitAssets(Asset[] files, java.lang.String submitLabel, java.lang.String submitComment)
          Submit the specified assets (files and directories) modified contents of this sandbox
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sandbox

public Sandbox(WebProject webproject,
               SandboxInfo si)
Method Detail

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()
Display name for the sandbox

Returns:
the name of the sandbox

setSandboxRef

public void setSandboxRef(java.lang.String sandboxRef)
Set the unique reference for this sandbox - no-op, read only

Parameters:
sandboxRef -

submitAll

public void submitAll(java.lang.String submitLabel,
                      java.lang.String submitComment)
Submit the modified contents of this sandbox


revertAssets

public void revertAssets(Asset[] files)
Revert the specified assets (files and directories) modified contents of this sandbox


revert

public void revert(java.lang.String[] files)
Revert the specified files and directories modified contents of this sandbox


submitAssets

public void submitAssets(Asset[] files,
                         java.lang.String submitLabel,
                         java.lang.String submitComment)
Submit the specified assets (files and directories) modified contents of this sandbox


submit

public void submit(java.lang.String[] files,
                   java.lang.String submitLabel,
                   java.lang.String submitComment)
Submit the specified files and directories modified contents of this sandbox


submitAllWebApp

public void submitAllWebApp(java.lang.String webApp,
                            java.lang.String submitLabel,
                            java.lang.String submitComment)
Submit the modified contents of the webapp within this sandbox


revertAll

public void revertAll()
Revert all modified contents within this sandbox


revertAllWebApp

public void revertAllWebApp(java.lang.String webApp)
Revert all modified contents within this sandbox


getSandboxRef

public java.lang.String getSandboxRef()
Get the unique reference for this sandbox


getCreator

public java.lang.String getCreator()

getCreatedDate

public java.util.Date getCreatedDate()

getCreatedDateAsISO8601

public java.lang.String getCreatedDateAsISO8601()

deleteSandbox

public void deleteSandbox()
Delete this sandbox


save

public void save()

getStoreNames

public java.lang.String[] getStoreNames()
Get the store names

Returns:
the list of store names with the "main" store first.

isAuthorSandbox

public boolean isAuthorSandbox()
Is this an author sandbox ?

Returns:
is this an author sandbox

isStagingSandbox

public boolean isStagingSandbox()
Is this a staging sandbox ?

Returns:
is this an author sandbox

getModifiedAssets

public Asset[] getModifiedAssets()
Get the modified assets within this sandbox

Returns:
the list of changed assets

getAsset

public Asset getAsset(java.lang.String path)
Get the specified asset (Either folder or file)

Parameters:
path - the full path e.g. /www/web_apps/ROOT/index.html
Returns:
the asset or null if it does not exist

getAssetWebApp

public Asset getAssetWebApp(java.lang.String webApp,
                            java.lang.String path)
Get the specified asset with a path relative to the specified web app.

Parameters:
path - e.g. index.html
webApp - e.g. ROOT
Returns:
the asset or null if it does not exist

getModifiedAssetsWebApp

public Asset[] getModifiedAssetsWebApp(java.lang.String webApp)
Get the modified assets within this sandbox

Returns:
the list of changed assets

getWebproject

public WebProject getWebproject()
Get the web project that owns this sandbox

Returns:
the web project


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.