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
This commit is contained in:
David Caruana
2010-10-04 10:48:18 +00:00
parent 98ba89bed7
commit b482ea50f8
2 changed files with 19 additions and 4 deletions

View File

@@ -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<NodeRef> 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);
};
});
}