]
Example:
/service/remotestore/lastmodified/sites/xyz/pages/page.xml
where:
/service/remotestore -> service path
/lastmodified -> method name
/sites/../page.xml -> document path
optional request parameters:
s -> the avm store id
w -> the wcm web application id
Note: path is relative to the root path as configured for this webscript bean
Further URL arguments may be provided if required by specific API methods.
For content create and update the request should be POSTed and the content sent as the
payload of the request content.
Supported API methods:
GET lastmodified -> return long timestamp of a document
GET has -> return true/false of existence for a document
GET get -> return document content - in addition the usual HTTP headers for the
character encoding, content type, length and modified date will be supplied
GET list -> return the list of available document paths under a path
GET listall -> return the list of available document paths (recursively) under a given path
GET listpattern -> return the list of document paths matching a file pattern under a given path
POST create -> create a new document with request content payload
POST update -> update an existing document with request content payload
DELETE delete -> delete an existing document
Nested classes/interfaces inherited from class org.springframework.extensions.webscripts.AbstractWebScript |
org.springframework.extensions.webscripts.AbstractWebScript.ScriptDetails |
Method Summary |
protected abstract void |
createDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String store,
java.lang.String path,
java.io.InputStream content)
Creates a document. |
protected abstract void |
deleteDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String store,
java.lang.String path)
Deletes an existing document. |
void |
execute(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res)
Execute the webscript based on the request parameters |
protected abstract void |
getDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String store,
java.lang.String path)
Gets a document. |
protected java.util.List |
getPathParts(java.lang.String[] extPaths)
Helper to break down webscript extension path into path component elements |
protected abstract void |
hasDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String store,
java.lang.String path)
Determines if the document exists. |
protected abstract 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 abstract 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 abstract 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 |
setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
|
void |
setStore(java.lang.String defaultStore)
|
protected abstract 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.springframework.extensions.webscripts.AbstractWebScript |
createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TOKEN_STORE
public static final java.lang.String TOKEN_STORE
- See Also:
- Constant Field Values
TOKEN_WEBAPP
public static final java.lang.String TOKEN_WEBAPP
- See Also:
- Constant Field Values
REQUEST_PARAM_STORE
public static final java.lang.String REQUEST_PARAM_STORE
- See Also:
- Constant Field Values
REQUEST_PARAM_WEBAPP
public static final java.lang.String REQUEST_PARAM_WEBAPP
- See Also:
- Constant Field Values
defaultStore
protected java.lang.String defaultStore
contentService
protected org.alfresco.service.cmr.repository.ContentService contentService
mimetypeService
protected org.alfresco.service.cmr.repository.MimetypeService mimetypeService
BaseRemoteStore
public BaseRemoteStore()
setStore
public void setStore(java.lang.String defaultStore)
- Parameters:
defaultStore
- the default store name of the store to process document requests against
setContentService
public void setContentService(org.alfresco.service.cmr.repository.ContentService contentService)
- Parameters:
contentService
- the ContentService to set
setMimetypeService
public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
- Parameters:
mimetypeService
- the MimetypeService to set
execute
public void execute(org.springframework.extensions.webscripts.WebScriptRequest req,
org.springframework.extensions.webscripts.WebScriptResponse res)
throws java.io.IOException
- Execute the webscript based on the request parameters
- Throws:
java.io.IOException
getPathParts
protected java.util.List getPathParts(java.lang.String[] extPaths)
- Helper to break down webscript extension path into path component elements
lastModified
protected abstract 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().
- Parameters:
store
- the store idpath
- document path to an existing document
- Throws:
java.io.IOException
hasDocument
protected abstract 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".
- Parameters:
store
- the store idpath
- document path
- Throws:
java.io.IOException
getDocument
protected abstract void getDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String store,
java.lang.String path)
throws java.io.IOException
- Gets a document.
The output will be the document content stream.
- Parameters:
store
- the store idpath
- document path
- Throws:
java.io.IOException
- if an error occurs retrieving the document
listDocuments
protected abstract 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.
- Parameters:
store
- the store idpath
- document pathrecurse
- true to peform a recursive list, false for direct children only.
- Throws:
java.io.IOException
- if an error occurs listing the documents
listDocuments
protected abstract 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.
- Parameters:
store
- the store idpath
- document pathpattern
- file pattern to match - allows wildcards e.g. *.xml or site*.xml
- Throws:
java.io.IOException
- if an error occurs listing the documents
createDocument
protected abstract void createDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String store,
java.lang.String path,
java.io.InputStream content)
- Creates a document.
- Parameters:
store
- the store idpath
- document pathcontent
- content of the document to write
- Throws:
java.io.IOException
- if the create fails
updateDocument
protected abstract void updateDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String store,
java.lang.String path,
java.io.InputStream content)
- Updates an existing document.
- Parameters:
store
- the store idpath
- document pathcontent
- content to update the document with
- Throws:
java.io.IOException
- if the update fails
deleteDocument
protected abstract void deleteDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
java.lang.String store,
java.lang.String path)
- Deletes an existing document.
- Parameters:
store
- the store idpath
- document path
- Throws:
java.io.IOException
- if the delete fails
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.