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

@@ -15,9 +15,10 @@
<bean id="CMISService" class="org.alfresco.cmis.mapping.CMISServicesImpl"> <bean id="CMISService" class="org.alfresco.cmis.mapping.CMISServicesImpl">
<property name="CMISSpecVersion"><value>1.0</value></property> <property name="CMISSpecVersion"><value>1.0</value></property>
<property name="CMISSpecTitle"><value>Version 1.0 OASIS Standard</value></property> <property name="CMISSpecTitle"><value>Version 1.0 OASIS Standard</value></property>
<property name="defaultStore"><value>workspace://SpacesStore</value></property> <property name="defaultStore"><value>${spaces.store}</value></property>
<property name="defaultRootPath"><value>/Company Home</value></property> <property name="defaultRootPath"><value>/${spaces.company_home.childname}</value></property>
<property name="dictionaryService" ref="dictionaryService" /> <property name="dictionaryService" ref="dictionaryService" />
<property name="namespaceService" ref="namespaceService" />
<property name="CMISDictionaryService" ref="CMISDictionaryService" /> <property name="CMISDictionaryService" ref="CMISDictionaryService" />
<property name="CMISRenditionService" ref="CMISRenditionService" /> <property name="CMISRenditionService" ref="CMISRenditionService" />
<property name="searchService" ref="SearchService" /> <property name="searchService" ref="SearchService" />

View File

@@ -140,6 +140,7 @@ public class CMISServicesImpl implements CMISServices, ApplicationContextAware,
private RetryingTransactionHelper retryingTransactionHelper; private RetryingTransactionHelper retryingTransactionHelper;
private DictionaryService dictionaryService; private DictionaryService dictionaryService;
private CMISDictionaryService cmisDictionaryService; private CMISDictionaryService cmisDictionaryService;
private NamespaceService namespaceService;
private SearchService searchService; private SearchService searchService;
private NodeService nodeService; private NodeService nodeService;
private FileFolderService fileFolderService; private FileFolderService fileFolderService;
@@ -221,6 +222,14 @@ public class CMISServicesImpl implements CMISServices, ApplicationContextAware,
this.retryingTransactionHelper = retryingTransactionHelper; this.retryingTransactionHelper = retryingTransactionHelper;
} }
/**
* @param namespaceService
*/
public void setNamespaceService(NamespaceService namespaceService)
{
this.namespaceService = namespaceService;
}
/** /**
* @param dictionaryService * @param dictionaryService
*/ */
@@ -454,8 +463,13 @@ public class CMISServicesImpl implements CMISServices, ApplicationContextAware,
{ {
public NodeRef execute() throws Exception public NodeRef execute() throws Exception
{ {
String path = defaultStoreRef.getProtocol() + "/" + defaultStoreRef.getIdentifier() + defaultRootPath; NodeRef root = nodeService.getRootNode(defaultStoreRef);
return repository.findNodeRef("path", path.split("/")); 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);
}; };
}); });
} }