org.alfresco.repo.web.scripts.bean
Class ADMRemoteStore

java.lang.Object
  extended by org.springframework.extensions.webscripts.AbstractWebScript
      extended by org.alfresco.repo.web.scripts.bean.BaseRemoteStore
          extended by org.alfresco.repo.web.scripts.bean.ADMRemoteStore
All Implemented Interfaces:
org.springframework.extensions.webscripts.WebScript

public class ADMRemoteStore
extends BaseRemoteStore

ADM Remote Store service.

This implementation of the RemoteStore is tied to the current SiteService implementation.

It remaps incoming generic document path requests to the appropriate folder structure in the Sites folder. Dashboard pages and component bindings are remapped to take advantage of inherited permissions in the appropriate root site folder, ensuring that only valid users can write to the appropriate configuration objects.

See Also:
for the available API methods.

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.extensions.webscripts.AbstractWebScript
org.springframework.extensions.webscripts.AbstractWebScript.ScriptDetails
 
Field Summary
 
Fields inherited from class org.alfresco.repo.web.scripts.bean.BaseRemoteStore
defaultStore, mimetypeService, REQUEST_PARAM_STORE, REQUEST_PARAM_WEBAPP, TOKEN_STORE, TOKEN_WEBAPP
 
Constructor Summary
ADMRemoteStore()
           
 
Method Summary
protected  void createDocument(org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String store, java.lang.String path, java.io.InputStream content)
          Creates a document.
protected  void createDocuments(org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String store, java.io.InputStream content)
          Creates multiple XML documents encapsulated in a single one.
protected  void deleteDocument(org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String store, java.lang.String path)
          Deletes an existing document.
protected  void getDocument(org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String store, java.lang.String path)
          Gets a document.
protected  void hasDocument(org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String store, java.lang.String path)
          Determines if the document exists.
protected  void lastModified(org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String store, java.lang.String path)
          Gets the last modified timestamp for the document.
protected  void listDocuments(org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String store, java.lang.String path, boolean recurse)
          Lists the document paths under a given path.
protected  void listDocuments(org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String store, java.lang.String path, java.lang.String pattern)
          Lists the document paths matching a file pattern under a given path.
 void setContentService(org.alfresco.service.cmr.repository.ContentService contentService)
           
 void setFileFolderService(org.alfresco.service.cmr.model.FileFolderService fileFolderService)
           
 void setHiddenAspect(org.alfresco.repo.model.filefolder.HiddenAspect hiddenAspect)
           
 void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
           
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
 void setSiteService(org.alfresco.service.cmr.site.SiteService siteService)
           
 void setUnprotectedNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
           
protected  void updateDocument(org.springframework.extensions.webscripts.WebScriptResponse res, java.lang.String store, java.lang.String path, java.io.InputStream content)
          Updates an existing document.
 
Methods inherited from class org.alfresco.repo.web.scripts.bean.BaseRemoteStore
encodePath, execute, getPathParts, setMimetypeService, setStore
 
Methods inherited from class org.springframework.extensions.webscripts.AbstractWebScript
createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ADMRemoteStore

public ADMRemoteStore()
Method Detail

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Parameters:
nodeService - the NodeService to set

setUnprotectedNodeService

public void setUnprotectedNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Parameters:
nodeService - the NodeService to set

setFileFolderService

public void setFileFolderService(org.alfresco.service.cmr.model.FileFolderService fileFolderService)
Parameters:
fileFolderService - the FileFolderService to set

setNamespaceService

public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Parameters:
namespaceService - the NamespaceService to set

setSiteService

public void setSiteService(org.alfresco.service.cmr.site.SiteService siteService)
Parameters:
siteService - the SiteService to set

setContentService

public void setContentService(org.alfresco.service.cmr.repository.ContentService contentService)
Parameters:
contentService - the ContentService to set

setHiddenAspect

public void setHiddenAspect(org.alfresco.repo.model.filefolder.HiddenAspect hiddenAspect)

lastModified

protected void lastModified(org.springframework.extensions.webscripts.WebScriptResponse res,
                            java.lang.String store,
                            java.lang.String path)
                     throws java.io.IOException
Gets the last modified timestamp for the document.

The output will be the last modified date as a long toString().

Specified by:
lastModified in class BaseRemoteStore
Parameters:
path - document path to an existing document
store - the store id
Throws:
java.io.IOException

getDocument

protected void getDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
                           java.lang.String store,
                           java.lang.String path)
Gets a document.

The output will be the document content stream.

Specified by:
getDocument in class BaseRemoteStore
Parameters:
path - document path
store - the store id

hasDocument

protected void hasDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
                           java.lang.String store,
                           java.lang.String path)
                    throws java.io.IOException
Determines if the document exists. The output will be either the string "true" or the string "false".

Specified by:
hasDocument in class BaseRemoteStore
Parameters:
path - document path
store - the store id
Throws:
java.io.IOException

createDocument

protected void createDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
                              java.lang.String store,
                              java.lang.String path,
                              java.io.InputStream content)
Creates a document.

Create methods are user authenticated, so the creation of site config must be allowed for the current user.

Specified by:
createDocument in class BaseRemoteStore
Parameters:
path - document path
content - content of the document to write
store - the store id

createDocuments

protected void createDocuments(org.springframework.extensions.webscripts.WebScriptResponse res,
                               java.lang.String store,
                               java.io.InputStream content)
Creates multiple XML documents encapsulated in a single one.

Specified by:
createDocuments in class BaseRemoteStore
Parameters:
content - XML document containing multiple document contents to write
store - the store id

updateDocument

protected void updateDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
                              java.lang.String store,
                              java.lang.String path,
                              java.io.InputStream content)
Updates an existing document.

Update methods are user authenticated, so the modification of site config must be allowed for the current user.

Specified by:
updateDocument in class BaseRemoteStore
Parameters:
path - document path to update
content - content to update the document with
store - the store id

deleteDocument

protected void deleteDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
                              java.lang.String store,
                              java.lang.String path)
Deletes an existing document.

Delete methods are user authenticated, so the deletion of the document must be allowed for the current user.

Specified by:
deleteDocument in class BaseRemoteStore
Parameters:
path - document path
store - the store id

listDocuments

protected void listDocuments(org.springframework.extensions.webscripts.WebScriptResponse res,
                             java.lang.String store,
                             java.lang.String path,
                             boolean recurse)
                      throws java.io.IOException
Lists the document paths under a given path.

The output will be the list of relative document paths found under the path. Separated by newline characters.

Specified by:
listDocuments in class BaseRemoteStore
Parameters:
path - document path
recurse - true to peform a recursive list, false for direct children only.
store - the store id
Throws:
java.io.IOException - if an error occurs listing the documents

listDocuments

protected void listDocuments(org.springframework.extensions.webscripts.WebScriptResponse res,
                             java.lang.String store,
                             java.lang.String path,
                             java.lang.String pattern)
                      throws java.io.IOException
Lists the document paths matching a file pattern under a given path. The output will be the list of relative document paths found under the path that match the given file pattern. Separated by newline characters.

Specified by:
listDocuments in class BaseRemoteStore
Parameters:
path - document path
pattern - file pattern to match - allows wildcards e.g. page.*.site.xml
store - the store id
Throws:
java.io.IOException - if an error occurs listing the documents


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