public class ADMRemoteStore extends BaseRemoteStore
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.
for the available API methods.
Modifier and Type | Field and Description |
---|---|
protected ContentService |
contentService |
protected FileFolderService |
fileFolderService |
protected HiddenAspect |
hiddenAspect |
protected org.alfresco.service.namespace.NamespaceService |
namespaceService |
protected org.alfresco.service.cmr.repository.NodeService |
nodeService |
protected OwnableService |
ownableService |
protected org.alfresco.service.cmr.security.PermissionService |
permissionService |
protected SiteService |
siteService |
protected org.alfresco.service.cmr.repository.NodeService |
unprotNodeService |
defaultStore, mimetypeService, REQUEST_PARAM_STORE, TOKEN_STORE, transformer, TRANSFORMER_FACTORY
Constructor and Description |
---|
ADMRemoteStore() |
Modifier and Type | Method and Description |
---|---|
protected String |
buildUserConfigSearchPattern(String userName)
Generate the search pattern for a Surf config location for a user name.
|
protected void |
createDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
String store,
String path,
InputStream content)
Creates a document.
|
protected void |
createDocuments(org.springframework.extensions.webscripts.WebScriptResponse res,
String store,
InputStream in)
Creates multiple XML documents encapsulated in a single one.
|
protected void |
deleteDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
String store,
String path)
Deletes an existing document.
|
protected void |
getDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
String store,
String path)
Gets a document.
|
protected org.alfresco.query.PagingResults<FileInfo> |
getFileNodes(FileInfo fileInfo,
String pattern,
boolean recurse) |
protected org.alfresco.service.cmr.repository.NodeRef |
getGlobalComponentsNodeRef() |
protected org.alfresco.service.cmr.repository.NodeRef |
getGlobalUserFolderNodeRef() |
protected String |
getPathRunAsUser(String path)
Get the RunAs user need to execute a Write operation on the given path.
|
protected org.alfresco.service.cmr.repository.NodeRef |
getSurfConfigNodeRef(org.alfresco.service.cmr.repository.NodeRef rootRef,
boolean create)
Return the "surf-config" noderef under the given root.
|
protected void |
hasDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
String store,
String path)
Determines if the document exists.
|
protected void |
lastModified(org.springframework.extensions.webscripts.WebScriptResponse res,
String store,
String path)
Gets the last modified timestamp for the document.
|
protected void |
listDocuments(org.springframework.extensions.webscripts.WebScriptResponse res,
String store,
String path,
boolean recurse)
Lists the document paths under a given path.
|
protected void |
listDocuments(org.springframework.extensions.webscripts.WebScriptResponse res,
String store,
String path,
String pattern)
Lists the document paths matching a file pattern under a given path.
|
void |
setBehaviourFilter(BehaviourFilter behaviourFilter) |
void |
setContentService(ContentService contentService) |
void |
setFileFolderService(FileFolderService fileFolderService) |
void |
setHiddenAspect(HiddenAspect hiddenAspect) |
void |
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setOwnableService(OwnableService ownableService) |
void |
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService) |
void |
setSiteService(SiteService siteService) |
void |
setUnprotectedNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
protected void |
updateDocument(org.springframework.extensions.webscripts.WebScriptResponse res,
String store,
String path,
InputStream content)
Updates an existing document.
|
protected void |
writeDocument(String path,
InputStream content) |
encodePath, execute, getPathParts, setMimetypeService, setStore
addModuleBundleToCache, checkModuleBundleCache, createArgs, createArgsM, createHeaders, createHeadersM, createScriptParameters, createStatusException, createTemplateParameters, executeScript, getContainer, getDescription, getExecuteScript, getResources, getStatusTemplate, init, renderString, renderString, renderTemplate, sendStatus, setURLModelFactory, toString
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected org.alfresco.service.cmr.repository.NodeService unprotNodeService
protected FileFolderService fileFolderService
protected org.alfresco.service.namespace.NamespaceService namespaceService
protected SiteService siteService
protected ContentService contentService
protected HiddenAspect hiddenAspect
protected org.alfresco.service.cmr.security.PermissionService permissionService
protected OwnableService ownableService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- the NodeService to setpublic void setUnprotectedNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- the NodeService to setpublic void setFileFolderService(FileFolderService fileFolderService)
fileFolderService
- the FileFolderService to setpublic void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
namespaceService
- the NamespaceService to setpublic void setSiteService(SiteService siteService)
siteService
- the SiteService to setpublic void setContentService(ContentService contentService)
contentService
- the ContentService to setpublic void setHiddenAspect(HiddenAspect hiddenAspect)
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
public void setOwnableService(OwnableService ownableService)
protected void lastModified(org.springframework.extensions.webscripts.WebScriptResponse res, String store, String path) throws IOException
The output will be the last modified date as a long toString().
lastModified
in class BaseRemoteStore
path
- document path to an existing documentstore
- the store idIOException
protected void getDocument(org.springframework.extensions.webscripts.WebScriptResponse res, String store, String path)
The output will be the document content stream.
getDocument
in class BaseRemoteStore
path
- document pathstore
- the store idprotected void hasDocument(org.springframework.extensions.webscripts.WebScriptResponse res, String store, String path) throws IOException
hasDocument
in class BaseRemoteStore
path
- document pathstore
- the store idIOException
protected void createDocument(org.springframework.extensions.webscripts.WebScriptResponse res, String store, String path, InputStream content)
Create methods are user authenticated, so the creation of site config must be allowed for the current user.
createDocument
in class BaseRemoteStore
path
- document pathcontent
- content of the document to writestore
- the store idprotected void createDocuments(org.springframework.extensions.webscripts.WebScriptResponse res, String store, InputStream in)
createDocuments
in class BaseRemoteStore
res
- WebScriptResponsestore
- Stringin
- XML document containing multiple document contents to writeprotected void writeDocument(String path, InputStream content)
protected String getPathRunAsUser(String path)
path
- Document pathprotected void updateDocument(org.springframework.extensions.webscripts.WebScriptResponse res, String store, String path, InputStream content)
Update methods are user authenticated, so the modification of site config must be allowed for the current user.
updateDocument
in class BaseRemoteStore
path
- document path to updatecontent
- content to update the document withstore
- the store idprotected void deleteDocument(org.springframework.extensions.webscripts.WebScriptResponse res, String store, String path)
Delete methods are user authenticated, so the deletion of the document must be allowed for the current user.
deleteDocument
in class BaseRemoteStore
path
- document pathstore
- the store idprotected void listDocuments(org.springframework.extensions.webscripts.WebScriptResponse res, String store, String path, boolean recurse) throws IOException
The output will be the list of relative document paths found under the path. Separated by newline characters.
listDocuments
in class BaseRemoteStore
path
- document pathrecurse
- true to peform a recursive list, false for direct children only.store
- the store idIOException
- if an error occurs listing the documentsprotected void listDocuments(org.springframework.extensions.webscripts.WebScriptResponse res, String store, String path, String pattern) throws IOException
listDocuments
in class BaseRemoteStore
path
- document pathpattern
- file pattern to match - allows wildcards e.g. page.*.site.xmlstore
- the store idIOException
- if an error occurs listing the documentsprotected org.alfresco.service.cmr.repository.NodeRef getSurfConfigNodeRef(org.alfresco.service.cmr.repository.NodeRef rootRef, boolean create)
Adds the "isIndexed = false" property to the surf-config folder node.
rootRef
- Root node reference where the "surf-config" folder should livecreate
- True to create the folder if missing, false otherwiseprotected org.alfresco.service.cmr.repository.NodeRef getGlobalComponentsNodeRef()
protected org.alfresco.service.cmr.repository.NodeRef getGlobalUserFolderNodeRef()
protected String buildUserConfigSearchPattern(String userName)
userName
- to build pattern forCopyright © 2005–2017 Alfresco Software. All rights reserved.