org.alfresco.repo.jscript
Class AVM

java.lang.Object
  extended by org.alfresco.repo.processor.BaseProcessorExtension
      extended by org.alfresco.repo.jscript.BaseScopableProcessorExtension
          extended by org.alfresco.repo.jscript.AVM
All Implemented Interfaces:
org.alfresco.processor.ProcessorExtension, Scopeable

public final class AVM
extends BaseScopableProcessorExtension

Helper to access AVM nodes from a script context.


Constructor Summary
AVM()
           
 
Method Summary
 java.lang.String assetUrl(java.lang.String avmPath)
           
 java.lang.String assetUrl(java.lang.String storeId, java.lang.String assetPath)
           
 java.util.List getModifiedItems(java.lang.String storeId, java.lang.String username, java.lang.String webapp)
          Return the list of modified items for the specified user sandbox against staging store id for a specific webapp.
 org.mozilla.javascript.Scriptable getStores()
           
static java.lang.String getWebappsFolderPath()
           
 AVMNode lookupNode(java.lang.String path)
          Return an AVM Node for the fully qualified path.
 AVMScriptStore lookupStore(java.lang.String store)
          Return an AVM store object for the specified store name
 AVMNode lookupStoreRoot(java.lang.String store)
          Return an AVM Node representing the public store root folder.
 void setServiceRegistry(ServiceRegistry serviceRegistry)
          Set the service registry
static java.lang.String stagingStore(java.lang.String storeId)
           
static java.lang.String userSandboxStore(java.lang.String storeId, java.lang.String username)
           
 java.lang.String websiteStagingUrl(java.lang.String storeId)
           
 java.lang.String websiteUserSandboxUrl(java.lang.String storeId, java.lang.String username)
           
 
Methods inherited from class org.alfresco.repo.jscript.BaseScopableProcessorExtension
getScope, setScope
 
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension
getExtensionName, register, setExtensionName, setProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AVM

public AVM()
Method Detail

setServiceRegistry

public void setServiceRegistry(ServiceRegistry serviceRegistry)
Set the service registry

Parameters:
serviceRegistry - the service registry

getStores

public org.mozilla.javascript.Scriptable getStores()
Returns:
a array of all AVM stores in the system

lookupStore

public AVMScriptStore lookupStore(java.lang.String store)
Return an AVM store object for the specified store name

Parameters:
store - Store name to lookup
Returns:
the AVM store object for the specified store or null if not found

lookupStoreRoot

public AVMNode lookupStoreRoot(java.lang.String store)
Return an AVM Node representing the public store root folder.

Parameters:
store - Store name to lookup root folder for
Returns:
AVM Node representing the public store root folder, or null if not found.

lookupNode

public AVMNode lookupNode(java.lang.String path)
Return an AVM Node for the fully qualified path.

Parameters:
path - Fully qualified path to node to lookup
Returns:
AVM Node for the fully qualified path, or null if not found.

getModifiedItems

public java.util.List getModifiedItems(java.lang.String storeId,
                                       java.lang.String username,
                                       java.lang.String webapp)
Return the list of modified items for the specified user sandbox against staging store id for a specific webapp.

Parameters:
storeId - Root Store ID
username - Username to get modified items for
webapp - Webapp name to filter by
Returns:
List of AVMNode objects representing the modified items

stagingStore

public static java.lang.String stagingStore(java.lang.String storeId)
Parameters:
storeId - Store ID to build staging store name for
Returns:
the Staging Store name for the given store ID

userSandboxStore

public static java.lang.String userSandboxStore(java.lang.String storeId,
                                                java.lang.String username)
Parameters:
storeId - Store ID to build sandbox store name for
username - Username of the sandbox user
Returns:
the Sandbox Store name for the given store ID and username

websiteStagingUrl

public java.lang.String websiteStagingUrl(java.lang.String storeId)
Parameters:
storeId - Store ID to build preview URL for
Returns:
the preview URL to the staging store for the specified store ID

websiteUserSandboxUrl

public java.lang.String websiteUserSandboxUrl(java.lang.String storeId,
                                              java.lang.String username)
Parameters:
storeId - Store ID to build preview URL for
username - Username to build sandbox preview URL for
Returns:
the preview URL to the user sandbox for the specified store ID and username

assetUrl

public java.lang.String assetUrl(java.lang.String storeId,
                                 java.lang.String assetPath)
Parameters:
store - Store ID of the asset
assetPath - Store relative path to the asset
Returns:
the preview URL to the specified store asset

assetUrl

public java.lang.String assetUrl(java.lang.String avmPath)
Parameters:
avmPath - Fully qualified AVM path of the asset
Returns:
the preview URL to the specified asset

getWebappsFolderPath

public static java.lang.String getWebappsFolderPath()
Returns:
the path to the webapps folder in a standard web store.


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