diff --git a/config/alfresco/cmis-api-context.xml b/config/alfresco/cmis-api-context.xml index f3304c716c..6b355448cc 100644 --- a/config/alfresco/cmis-api-context.xml +++ b/config/alfresco/cmis-api-context.xml @@ -15,9 +15,10 @@ 1.0 Version 1.0 OASIS Standard - workspace://SpacesStore - /Company Home + ${spaces.store} + /${spaces.company_home.childname} + diff --git a/source/java/org/alfresco/cmis/mapping/CMISServicesImpl.java b/source/java/org/alfresco/cmis/mapping/CMISServicesImpl.java index a17a25fa52..839fab18b5 100644 --- a/source/java/org/alfresco/cmis/mapping/CMISServicesImpl.java +++ b/source/java/org/alfresco/cmis/mapping/CMISServicesImpl.java @@ -140,6 +140,7 @@ public class CMISServicesImpl implements CMISServices, ApplicationContextAware, private RetryingTransactionHelper retryingTransactionHelper; private DictionaryService dictionaryService; private CMISDictionaryService cmisDictionaryService; + private NamespaceService namespaceService; private SearchService searchService; private NodeService nodeService; private FileFolderService fileFolderService; @@ -221,6 +222,14 @@ public class CMISServicesImpl implements CMISServices, ApplicationContextAware, this.retryingTransactionHelper = retryingTransactionHelper; } + /** + * @param namespaceService + */ + public void setNamespaceService(NamespaceService namespaceService) + { + this.namespaceService = namespaceService; + } + /** * @param dictionaryService */ @@ -454,8 +463,13 @@ public class CMISServicesImpl implements CMISServices, ApplicationContextAware, { public NodeRef execute() throws Exception { - String path = defaultStoreRef.getProtocol() + "/" + defaultStoreRef.getIdentifier() + defaultRootPath; - return repository.findNodeRef("path", path.split("/")); + NodeRef root = nodeService.getRootNode(defaultStoreRef); + List rootNodes = searchService.selectNodes(root, defaultRootPath, null, namespaceService, false); + if (rootNodes.size() != 1) + { + throw new AlfrescoRuntimeException("Unable to locate CMIS root path " + defaultRootPath); + } + return rootNodes.get(0); }; }); }