From b482ea50f8dd20fd401677ea191096f4e6f5ff6f Mon Sep 17 00:00:00 2001 From: David Caruana Date: Mon, 4 Oct 2010 10:48:18 +0000 Subject: [PATCH] Resolve ALF-5042: Default root folder path '/Company Home' not found git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22837 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/cmis-api-context.xml | 5 +++-- .../cmis/mapping/CMISServicesImpl.java | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) 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); }; }); }