Package org.alfresco.repo.web.scripts
Class RepoStore
- java.lang.Object
-
- org.springframework.extensions.webscripts.AbstractStore
-
- org.alfresco.repo.web.scripts.RepoStore
-
- All Implemented Interfaces:
org.alfresco.repo.tenant.TenantDeployer
,org.springframework.extensions.webscripts.Store
public class RepoStore extends org.springframework.extensions.webscripts.AbstractStore implements org.alfresco.repo.tenant.TenantDeployer
Repository based Web Script Store- Author:
- davidc
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,org.alfresco.service.cmr.repository.NodeRef>
baseNodeRefs
protected org.alfresco.service.cmr.repository.ContentService
contentService
protected org.alfresco.service.cmr.model.FileFolderService
fileService
protected boolean
mustExist
protected org.alfresco.service.namespace.NamespaceService
namespaceService
protected org.alfresco.service.cmr.repository.NodeService
nodeService
protected org.alfresco.service.cmr.security.PermissionService
permissionService
protected String
repoPath
protected org.alfresco.service.cmr.repository.StoreRef
repoStore
protected org.alfresco.repo.transaction.RetryingTransactionHelper
retryingTransactionHelper
protected org.alfresco.service.cmr.search.SearchService
searchService
protected org.alfresco.repo.tenant.TenantAdminService
tenantAdminService
-
Constructor Summary
Constructors Constructor Description RepoStore()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createDocument(String documentPath, String content)
void
destroy()
static String
encodePathISO9075(String path)
Helper to encode the elements of a path to be used as a Lucene PATH statement using the ISO9075 encoding.boolean
exists()
protected org.alfresco.service.cmr.repository.NodeRef
findNodeRef(String documentPath)
Gets the node ref for the specified path within this repo storeString[]
getAllDocumentPaths()
String
getBasePath()
String[]
getDescriptionDocumentPaths()
InputStream
getDocument(String documentPath)
String[]
getDocumentPaths(String path, boolean includeSubPaths, String documentPattern)
protected String
getPath(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Gets the display path for the specified nodeString[]
getScriptDocumentPaths(org.springframework.extensions.webscripts.WebScript script)
org.springframework.extensions.webscripts.ScriptLoader
getScriptLoader()
freemarker.cache.TemplateLoader
getTemplateLoader()
boolean
hasDocument(String documentPath)
void
init()
boolean
isSecure()
long
lastModified(String documentPath)
void
onDisableTenant()
void
onEnableTenant()
boolean
removeDocument(String documentPath)
void
setContentService(org.alfresco.service.cmr.repository.ContentService contentService)
Sets the content servicevoid
setFileFolderService(org.alfresco.service.cmr.model.FileFolderService fileService)
Sets the file servicevoid
setMustExist(boolean mustExist)
Sets whether the repo store must existvoid
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Sets the namespace servicevoid
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the node servicevoid
setPath(String repoPath)
Sets the repo pathvoid
setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
Sets the permission servicevoid
setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Sets the search servicevoid
setStore(String repoStore)
Sets the repo storevoid
setTenantAdminService(org.alfresco.repo.tenant.TenantAdminService tenantAdminService)
Sets the tenant admin servicevoid
setTransactionHelper(org.alfresco.repo.transaction.RetryingTransactionHelper retryingTransactionHelper)
Sets helper that provides transaction callbacksString
toString()
void
updateDocument(String documentPath, String content)
-
-
-
Field Detail
-
mustExist
protected boolean mustExist
-
repoStore
protected org.alfresco.service.cmr.repository.StoreRef repoStore
-
repoPath
protected String repoPath
-
retryingTransactionHelper
protected org.alfresco.repo.transaction.RetryingTransactionHelper retryingTransactionHelper
-
searchService
protected org.alfresco.service.cmr.search.SearchService searchService
-
nodeService
protected org.alfresco.service.cmr.repository.NodeService nodeService
-
contentService
protected org.alfresco.service.cmr.repository.ContentService contentService
-
fileService
protected org.alfresco.service.cmr.model.FileFolderService fileService
-
namespaceService
protected org.alfresco.service.namespace.NamespaceService namespaceService
-
permissionService
protected org.alfresco.service.cmr.security.PermissionService permissionService
-
tenantAdminService
protected org.alfresco.repo.tenant.TenantAdminService tenantAdminService
-
-
Method Detail
-
setTransactionHelper
public void setTransactionHelper(org.alfresco.repo.transaction.RetryingTransactionHelper retryingTransactionHelper)
Sets helper that provides transaction callbacks
-
setSearchService
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Sets the search service
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the node service
-
setContentService
public void setContentService(org.alfresco.service.cmr.repository.ContentService contentService)
Sets the content service
-
setFileFolderService
public void setFileFolderService(org.alfresco.service.cmr.model.FileFolderService fileService)
Sets the file service
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Sets the namespace service
-
setPermissionService
public void setPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)
Sets the permission service
-
setTenantAdminService
public void setTenantAdminService(org.alfresco.repo.tenant.TenantAdminService tenantAdminService)
Sets the tenant admin service
-
setMustExist
public void setMustExist(boolean mustExist)
Sets whether the repo store must exist- Parameters:
mustExist
- boolean
-
setStore
public void setStore(String repoStore)
Sets the repo store
-
setPath
public void setPath(String repoPath)
Sets the repo path- Parameters:
repoPath
- repoPath
-
init
public void init()
- Specified by:
init
in interfaceorg.springframework.extensions.webscripts.Store
- Specified by:
init
in interfaceorg.alfresco.repo.tenant.TenantDeployer
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceorg.alfresco.repo.tenant.TenantDeployer
-
isSecure
public boolean isSecure()
- Specified by:
isSecure
in interfaceorg.springframework.extensions.webscripts.Store
-
exists
public boolean exists()
- Specified by:
exists
in interfaceorg.springframework.extensions.webscripts.Store
-
getBasePath
public String getBasePath()
- Specified by:
getBasePath
in interfaceorg.springframework.extensions.webscripts.Store
-
getPath
protected String getPath(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Gets the display path for the specified node- Parameters:
nodeRef
- NodeRef- Returns:
- display path
-
findNodeRef
protected org.alfresco.service.cmr.repository.NodeRef findNodeRef(String documentPath)
Gets the node ref for the specified path within this repo store- Parameters:
documentPath
- String- Returns:
- node ref
-
getScriptDocumentPaths
public String[] getScriptDocumentPaths(org.springframework.extensions.webscripts.WebScript script)
- Specified by:
getScriptDocumentPaths
in interfaceorg.springframework.extensions.webscripts.Store
-
getDocumentPaths
public String[] getDocumentPaths(String path, boolean includeSubPaths, String documentPattern)
- Specified by:
getDocumentPaths
in interfaceorg.springframework.extensions.webscripts.Store
-
encodePathISO9075
public static String encodePathISO9075(String path)
Helper to encode the elements of a path to be used as a Lucene PATH statement using the ISO9075 encoding. Note that leading and trailing '/' elements will NOT be preserved.- Parameters:
path
- Path to encode, elements separated by '/'- Returns:
- the encoded path, a minimum of the empty string will be returned
-
getDescriptionDocumentPaths
public String[] getDescriptionDocumentPaths()
- Specified by:
getDescriptionDocumentPaths
in interfaceorg.springframework.extensions.webscripts.Store
-
getAllDocumentPaths
public String[] getAllDocumentPaths()
- Specified by:
getAllDocumentPaths
in interfaceorg.springframework.extensions.webscripts.Store
-
lastModified
public long lastModified(String documentPath) throws IOException
- Specified by:
lastModified
in interfaceorg.springframework.extensions.webscripts.Store
- Throws:
IOException
-
hasDocument
public boolean hasDocument(String documentPath)
- Specified by:
hasDocument
in interfaceorg.springframework.extensions.webscripts.Store
-
getDocument
public InputStream getDocument(String documentPath) throws IOException
- Specified by:
getDocument
in interfaceorg.springframework.extensions.webscripts.Store
- Throws:
IOException
-
createDocument
public void createDocument(String documentPath, String content) throws IOException
- Specified by:
createDocument
in interfaceorg.springframework.extensions.webscripts.Store
- Throws:
IOException
-
updateDocument
public void updateDocument(String documentPath, String content) throws IOException
- Specified by:
updateDocument
in interfaceorg.springframework.extensions.webscripts.Store
- Throws:
IOException
-
removeDocument
public boolean removeDocument(String documentPath) throws IOException
- Specified by:
removeDocument
in interfaceorg.springframework.extensions.webscripts.Store
- Throws:
IOException
-
getTemplateLoader
public freemarker.cache.TemplateLoader getTemplateLoader()
- Specified by:
getTemplateLoader
in interfaceorg.springframework.extensions.webscripts.Store
-
getScriptLoader
public org.springframework.extensions.webscripts.ScriptLoader getScriptLoader()
- Specified by:
getScriptLoader
in interfaceorg.springframework.extensions.webscripts.Store
-
onEnableTenant
public void onEnableTenant()
- Specified by:
onEnableTenant
in interfaceorg.alfresco.repo.tenant.TenantDeployer
-
onDisableTenant
public void onDisableTenant()
- Specified by:
onDisableTenant
in interfaceorg.alfresco.repo.tenant.TenantDeployer
-
-