public class RemoteStore extends AbstractStore
The endpoint is assumed to support a WebScript Remote Store implementation (such as AVMRemoteStore) that mirrors the required Store API.
| Modifier and Type | Class and Description |
|---|---|
protected class |
RemoteStore.RemoteStoreScriptLoader
Remote Store implementation of a Script Loader
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_API |
static String |
DEFAULT_ENDPOINT_ID |
DESC_PATH_PATTERN| Constructor and Description |
|---|
RemoteStore() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildUri(String uri) |
protected Response |
callDelete(String uri)
Perform a DELETE call to the given URI.
|
protected Response |
callGet(String uri)
Perform a GET call to the given URI.
|
protected Response |
callPost(String uri,
InputStream in)
Perform a POST call to the given URI with the supplied input.
|
void |
createDocument(String documentPath,
String content)
Creates a document.
|
void |
createDocuments(List<org.springframework.extensions.surf.util.Pair<String,org.dom4j.Document>> pathContents)
Creates multiple XML documents at the specified paths.
|
boolean |
exists()
Determines whether the store actually exists
|
String[] |
getAllDocumentPaths()
Gets the paths of all documents in this store
|
String |
getApi()
Gets the api.
|
String |
getBasePath()
Gets the base path of the store
|
protected Connector |
getConnector()
Get a Connector for access to the endpoint.
|
ConnectorProvider |
getConnectorProvider() |
ConnectorService |
getConnectorService()
Gets the connector service.
|
String[] |
getDescriptionDocumentPaths()
Gets the paths of all Web Script description documents in this store
|
InputStream |
getDocument(String documentPath)
Gets a document.
|
String[] |
getDocumentPaths(String path,
boolean includeSubPaths,
String documentPattern)
Gets the paths of given document pattern within given path/sub-paths in this store
|
String |
getEndpoint()
Gets the endpoint.
|
String[] |
getScriptDocumentPaths(WebScript script)
Gets the paths of all implementation files for a given Web Script
|
ScriptLoader |
getScriptLoader()
Gets the script loader for this store
|
String |
getStoreId()
Gets the store id.
|
String |
getStorePath()
Store path calculation
If we have a store context, then we can check to see if a base path should be inserted ahead of the
path that we believe we're directing to.
|
freemarker.cache.TemplateLoader |
getTemplateLoader()
Gets the template loader for this store
|
String |
getWebappId()
Gets the store's web application id binding
This is meaningful for WCM Web Project stores.
|
String |
getWebappPathPrefix() |
boolean |
hasDocument(String documentPath)
Determines if the document exists.
|
void |
init()
Initialise Store (called once)
|
boolean |
isSecure()
Returns true if this store is considered secure - i.e.
|
long |
lastModified(String documentPath)
Gets the last modified timestamp for the document.
|
boolean |
removeDocument(String documentPath)
Removes an existing document.
|
void |
setApi(String api) |
void |
setConnectorProvider(ConnectorProvider connectorProvider)
Sets the connector provider
|
void |
setConnectorService(ConnectorService service) |
void |
setEndpoint(String endpoint) |
void |
setPath(String path)
Sets the base path to send to the remote store
|
void |
setStoreId(String storeId)
Allows for specification of default or fallback store id to use
when binding to a remote store.
|
void |
setWebappId(String webappId)
Sets the store's web application id to bind to within the designated store
This is meaningful for WCM Web Project stores.
|
void |
setWebappPathPrefix(String webappPathPrefix) |
void |
updateDocument(String documentPath,
String content)
Updates an existing document.
|
getDocumentPaths, getPreviewContext, isReadOnly, setPreviewContextProvider, setReadOnlypublic static final String DEFAULT_API
public static final String DEFAULT_ENDPOINT_ID
public void setConnectorService(ConnectorService service)
service - The ConnectorService beanpublic ConnectorService getConnectorService()
public void setConnectorProvider(ConnectorProvider connectorProvider)
public ConnectorProvider getConnectorProvider()
public void setApi(String api)
api - the WebScript API path to set for the remote store i.e. "/remotestore"public String getApi()
public void setPath(String path)
path - Stringpublic void setEndpoint(String endpoint)
endpoint - the endpoint ID to use when calling the remote APIpublic String getEndpoint()
public void setWebappId(String webappId)
webappId - Stringpublic String getWebappPathPrefix()
public void setWebappPathPrefix(String webappPathPrefix)
public String getWebappId()
public void setStoreId(String storeId)
storeId - the default store idpublic String getStoreId()
public String getStorePath()
public void init()
Storepublic boolean isSecure()
Storepublic boolean exists()
Storepublic boolean hasDocument(String documentPath) throws IOException
StoredocumentPath - document pathIOException - Signals that an I/O exception has occurred.public long lastModified(String documentPath) throws IOException
StoredocumentPath - document path to an existing documentIOException - if the document does not exist in the storepublic void updateDocument(String documentPath, String content) throws IOException
StoredocumentPath - document pathcontent - content to update the document withIOException - if the document does not exist or the update failspublic boolean removeDocument(String documentPath) throws IOException
StoredocumentPath - document pathIOException - if the document does not exist or the remove failspublic void createDocument(String documentPath, String content) throws IOException
StoredocumentPath - document pathcontent - content of the document to writeIOException - if the document already exists or the create failspublic void createDocuments(List<org.springframework.extensions.surf.util.Pair<String,org.dom4j.Document>> pathContents) throws IOException
StorecreateDocuments in interface StorecreateDocuments in class AbstractStorepathContents - list of path, document pairsIOException - if a document already exists or a create failspublic InputStream getDocument(String documentPath) throws IOException
StoredocumentPath - document pathIOException - if the document does not exist in the storepublic String[] getAllDocumentPaths()
Storepublic String[] getDocumentPaths(String path, boolean includeSubPaths, String documentPattern)
Storepath - start pathincludeSubPaths - if true, include sub-pathsdocumentPattern - document name, allows wildcards, eg. *.ftl or my*.ftlpublic String[] getDescriptionDocumentPaths()
Storepublic String[] getScriptDocumentPaths(WebScript script)
Storescript - web scriptpublic ScriptLoader getScriptLoader()
Storepublic freemarker.cache.TemplateLoader getTemplateLoader()
Storepublic String getBasePath()
Storeprotected Response callPost(String uri, InputStream in)
protected Connector getConnector() throws ConnectorProviderException
ConnectorProviderExceptionCopyright © 2005–2016 Alfresco Software. All rights reserved.