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.TenantDeployerRepository based Web Script Store- Author:
- davidc
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,org.alfresco.service.cmr.repository.NodeRef>baseNodeRefsprotected org.alfresco.service.cmr.repository.ContentServicecontentServiceprotected org.alfresco.service.cmr.model.FileFolderServicefileServiceprotected booleanmustExistprotected org.alfresco.service.namespace.NamespaceServicenamespaceServiceprotected org.alfresco.service.cmr.repository.NodeServicenodeServiceprotected org.alfresco.service.cmr.security.PermissionServicepermissionServiceprotected java.lang.StringrepoPathprotected org.alfresco.service.cmr.repository.StoreRefrepoStoreprotected org.alfresco.repo.transaction.RetryingTransactionHelperretryingTransactionHelperprotected org.alfresco.service.cmr.search.SearchServicesearchServiceprotected org.alfresco.repo.tenant.TenantAdminServicetenantAdminService
-
Constructor Summary
Constructors Constructor Description RepoStore()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateDocument(java.lang.String documentPath, java.lang.String content)voiddestroy()static java.lang.StringencodePathISO9075(java.lang.String path)Helper to encode the elements of a path to be used as a Lucene PATH statement using the ISO9075 encoding.booleanexists()protected org.alfresco.service.cmr.repository.NodeReffindNodeRef(java.lang.String documentPath)Gets the node ref for the specified path within this repo storejava.lang.String[]getAllDocumentPaths()java.lang.StringgetBasePath()java.lang.String[]getDescriptionDocumentPaths()java.io.InputStreamgetDocument(java.lang.String documentPath)java.lang.String[]getDocumentPaths(java.lang.String path, boolean includeSubPaths, java.lang.String documentPattern)protected java.lang.StringgetPath(org.alfresco.service.cmr.repository.NodeRef nodeRef)Gets the display path for the specified nodejava.lang.String[]getScriptDocumentPaths(org.springframework.extensions.webscripts.WebScript script)org.springframework.extensions.webscripts.ScriptLoadergetScriptLoader()freemarker.cache.TemplateLoadergetTemplateLoader()booleanhasDocument(java.lang.String documentPath)voidinit()booleanisSecure()longlastModified(java.lang.String documentPath)voidonDisableTenant()voidonEnableTenant()booleanremoveDocument(java.lang.String documentPath)voidsetContentService(org.alfresco.service.cmr.repository.ContentService contentService)Sets the content servicevoidsetFileFolderService(org.alfresco.service.cmr.model.FileFolderService fileService)Sets the file servicevoidsetMustExist(boolean mustExist)Sets whether the repo store must existvoidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)Sets the namespace servicevoidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)Sets the node servicevoidsetPath(java.lang.String repoPath)Sets the repo pathvoidsetPermissionService(org.alfresco.service.cmr.security.PermissionService permissionService)Sets the permission servicevoidsetSearchService(org.alfresco.service.cmr.search.SearchService searchService)Sets the search servicevoidsetStore(java.lang.String repoStore)Sets the repo storevoidsetTenantAdminService(org.alfresco.repo.tenant.TenantAdminService tenantAdminService)Sets the tenant admin servicevoidsetTransactionHelper(org.alfresco.repo.transaction.RetryingTransactionHelper retryingTransactionHelper)Sets helper that provides transaction callbacksjava.lang.StringtoString()voidupdateDocument(java.lang.String documentPath, java.lang.String content)
-
-
-
Field Detail
-
mustExist
protected boolean mustExist
-
repoStore
protected org.alfresco.service.cmr.repository.StoreRef repoStore
-
repoPath
protected java.lang.String repoPath
-
baseNodeRefs
protected java.util.Map<java.lang.String,org.alfresco.service.cmr.repository.NodeRef> baseNodeRefs
-
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(java.lang.String repoStore)
Sets the repo store
-
setPath
public void setPath(java.lang.String repoPath)
Sets the repo path- Parameters:
repoPath- repoPath
-
init
public void init()
- Specified by:
initin interfaceorg.springframework.extensions.webscripts.Store- Specified by:
initin interfaceorg.alfresco.repo.tenant.TenantDeployer
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.alfresco.repo.tenant.TenantDeployer
-
isSecure
public boolean isSecure()
- Specified by:
isSecurein interfaceorg.springframework.extensions.webscripts.Store
-
exists
public boolean exists()
- Specified by:
existsin interfaceorg.springframework.extensions.webscripts.Store
-
getBasePath
public java.lang.String getBasePath()
- Specified by:
getBasePathin interfaceorg.springframework.extensions.webscripts.Store
-
getPath
protected java.lang.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(java.lang.String documentPath)
Gets the node ref for the specified path within this repo store- Parameters:
documentPath- String- Returns:
- node ref
-
getScriptDocumentPaths
public java.lang.String[] getScriptDocumentPaths(org.springframework.extensions.webscripts.WebScript script)
- Specified by:
getScriptDocumentPathsin interfaceorg.springframework.extensions.webscripts.Store
-
getDocumentPaths
public java.lang.String[] getDocumentPaths(java.lang.String path, boolean includeSubPaths, java.lang.String documentPattern)- Specified by:
getDocumentPathsin interfaceorg.springframework.extensions.webscripts.Store
-
encodePathISO9075
public static java.lang.String encodePathISO9075(java.lang.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 java.lang.String[] getDescriptionDocumentPaths()
- Specified by:
getDescriptionDocumentPathsin interfaceorg.springframework.extensions.webscripts.Store
-
getAllDocumentPaths
public java.lang.String[] getAllDocumentPaths()
- Specified by:
getAllDocumentPathsin interfaceorg.springframework.extensions.webscripts.Store
-
lastModified
public long lastModified(java.lang.String documentPath) throws java.io.IOException- Specified by:
lastModifiedin interfaceorg.springframework.extensions.webscripts.Store- Throws:
java.io.IOException
-
hasDocument
public boolean hasDocument(java.lang.String documentPath)
- Specified by:
hasDocumentin interfaceorg.springframework.extensions.webscripts.Store
-
getDocument
public java.io.InputStream getDocument(java.lang.String documentPath) throws java.io.IOException- Specified by:
getDocumentin interfaceorg.springframework.extensions.webscripts.Store- Throws:
java.io.IOException
-
createDocument
public void createDocument(java.lang.String documentPath, java.lang.String content) throws java.io.IOException- Specified by:
createDocumentin interfaceorg.springframework.extensions.webscripts.Store- Throws:
java.io.IOException
-
updateDocument
public void updateDocument(java.lang.String documentPath, java.lang.String content) throws java.io.IOException- Specified by:
updateDocumentin interfaceorg.springframework.extensions.webscripts.Store- Throws:
java.io.IOException
-
removeDocument
public boolean removeDocument(java.lang.String documentPath) throws java.io.IOException- Specified by:
removeDocumentin interfaceorg.springframework.extensions.webscripts.Store- Throws:
java.io.IOException
-
getTemplateLoader
public freemarker.cache.TemplateLoader getTemplateLoader()
- Specified by:
getTemplateLoaderin interfaceorg.springframework.extensions.webscripts.Store
-
getScriptLoader
public org.springframework.extensions.webscripts.ScriptLoader getScriptLoader()
- Specified by:
getScriptLoaderin interfaceorg.springframework.extensions.webscripts.Store
-
onEnableTenant
public void onEnableTenant()
- Specified by:
onEnableTenantin interfaceorg.alfresco.repo.tenant.TenantDeployer
-
onDisableTenant
public void onDisableTenant()
- Specified by:
onDisableTenantin interfaceorg.alfresco.repo.tenant.TenantDeployer
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-