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:
TenantDeployer,org.springframework.extensions.webscripts.Store
public class RepoStore extends org.springframework.extensions.webscripts.AbstractStore implements TenantDeployer
Repository based Web Script Store- Author:
- davidc
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,NodeRef>baseNodeRefsprotected ContentServicecontentServiceprotected FileFolderServicefileServiceprotected booleanmustExistprotected NamespaceServicenamespaceServiceprotected NodeServicenodeServiceprotected PermissionServicepermissionServiceprotected StringrepoPathprotected StoreRefrepoStoreprotected RetryingTransactionHelperretryingTransactionHelperprotected SearchServicesearchServiceprotected TenantAdminServicetenantAdminService
-
Constructor Summary
Constructors Constructor Description RepoStore()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateDocument(String documentPath, String content)voiddestroy()static StringencodePathISO9075(String path)Helper to encode the elements of a path to be used as a Lucene PATH statement using the ISO9075 encoding.booleanexists()protected NodeReffindNodeRef(String documentPath)Gets the node ref for the specified path within this repo storeString[]getAllDocumentPaths()StringgetBasePath()String[]getDescriptionDocumentPaths()InputStreamgetDocument(String documentPath)String[]getDocumentPaths(String path, boolean includeSubPaths, String documentPattern)protected StringgetPath(NodeRef nodeRef)Gets the display path for the specified nodeString[]getScriptDocumentPaths(org.springframework.extensions.webscripts.WebScript script)org.springframework.extensions.webscripts.ScriptLoadergetScriptLoader()freemarker.cache.TemplateLoadergetTemplateLoader()booleanhasDocument(String documentPath)voidinit()booleanisSecure()longlastModified(String documentPath)voidonDisableTenant()voidonEnableTenant()booleanremoveDocument(String documentPath)voidsetContentService(ContentService contentService)Sets the content servicevoidsetFileFolderService(FileFolderService fileService)Sets the file servicevoidsetMustExist(boolean mustExist)Sets whether the repo store must existvoidsetNamespaceService(NamespaceService namespaceService)Sets the namespace servicevoidsetNodeService(NodeService nodeService)Sets the node servicevoidsetPath(String repoPath)Sets the repo pathvoidsetPermissionService(PermissionService permissionService)Sets the permission servicevoidsetSearchService(SearchService searchService)Sets the search servicevoidsetStore(String repoStore)Sets the repo storevoidsetTenantAdminService(TenantAdminService tenantAdminService)Sets the tenant admin servicevoidsetTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)Sets helper that provides transaction callbacksStringtoString()voidupdateDocument(String documentPath, String content)
-
-
-
Field Detail
-
mustExist
protected boolean mustExist
-
repoStore
protected StoreRef repoStore
-
repoPath
protected String repoPath
-
retryingTransactionHelper
protected RetryingTransactionHelper retryingTransactionHelper
-
searchService
protected SearchService searchService
-
nodeService
protected NodeService nodeService
-
contentService
protected ContentService contentService
-
fileService
protected FileFolderService fileService
-
namespaceService
protected NamespaceService namespaceService
-
permissionService
protected PermissionService permissionService
-
tenantAdminService
protected TenantAdminService tenantAdminService
-
-
Method Detail
-
setTransactionHelper
public void setTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
Sets helper that provides transaction callbacks
-
setSearchService
public void setSearchService(SearchService searchService)
Sets the search service
-
setNodeService
public void setNodeService(NodeService nodeService)
Sets the node service
-
setContentService
public void setContentService(ContentService contentService)
Sets the content service
-
setFileFolderService
public void setFileFolderService(FileFolderService fileService)
Sets the file service
-
setNamespaceService
public void setNamespaceService(NamespaceService namespaceService)
Sets the namespace service
-
setPermissionService
public void setPermissionService(PermissionService permissionService)
Sets the permission service
-
setTenantAdminService
public void setTenantAdminService(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:
initin interfaceorg.springframework.extensions.webscripts.Store- Specified by:
initin interfaceTenantDeployer
-
destroy
public void destroy()
- Specified by:
destroyin interfaceTenantDeployer
-
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 String getBasePath()
- Specified by:
getBasePathin interfaceorg.springframework.extensions.webscripts.Store
-
getPath
protected String getPath(NodeRef nodeRef)
Gets the display path for the specified node- Parameters:
nodeRef- NodeRef- Returns:
- display path
-
findNodeRef
protected 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:
getScriptDocumentPathsin interfaceorg.springframework.extensions.webscripts.Store
-
getDocumentPaths
public String[] getDocumentPaths(String path, boolean includeSubPaths, String documentPattern)
- Specified by:
getDocumentPathsin 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:
getDescriptionDocumentPathsin interfaceorg.springframework.extensions.webscripts.Store
-
getAllDocumentPaths
public String[] getAllDocumentPaths()
- Specified by:
getAllDocumentPathsin interfaceorg.springframework.extensions.webscripts.Store
-
lastModified
public long lastModified(String documentPath) throws IOException
- Specified by:
lastModifiedin interfaceorg.springframework.extensions.webscripts.Store- Throws:
IOException
-
hasDocument
public boolean hasDocument(String documentPath)
- Specified by:
hasDocumentin interfaceorg.springframework.extensions.webscripts.Store
-
getDocument
public InputStream getDocument(String documentPath) throws IOException
- Specified by:
getDocumentin interfaceorg.springframework.extensions.webscripts.Store- Throws:
IOException
-
createDocument
public void createDocument(String documentPath, String content) throws IOException
- Specified by:
createDocumentin interfaceorg.springframework.extensions.webscripts.Store- Throws:
IOException
-
updateDocument
public void updateDocument(String documentPath, String content) throws IOException
- Specified by:
updateDocumentin interfaceorg.springframework.extensions.webscripts.Store- Throws:
IOException
-
removeDocument
public boolean removeDocument(String documentPath) throws IOException
- Specified by:
removeDocumentin interfaceorg.springframework.extensions.webscripts.Store- Throws:
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 interfaceTenantDeployer
-
onDisableTenant
public void onDisableTenant()
- Specified by:
onDisableTenantin interfaceTenantDeployer
-
-