我正在尝试改善其中一项实施的性能,
当前,我们使用Alfresco nodeService.getChildAssocs从rootNode检索节点,并运行某种循环来比较路径。
当您有大量文件时,这不是很有效。我已经从Share调试了定位文件网页脚本,并看到它们基于该路径运行Lucene查询。
这也是这里描述的内容:http : //wiki.alfresco.com/wiki/NodeRef_cookbook#Getting_a_NodeRef_from_its_path
这是检索NodeRef的最有效方法吗?是否有其他API可从回购端运行此简单任务(在Java中)?
非常感谢
在基础API中,您可以调用:
FileFolderService.resolveNamePath(NodeRef rootNode, List pathElements)
FileFolderService.resolveNamePath(NodeRef rootNode, List pathElements, Boolean mustExist)
Run Code Online (Sandbox Code Playgroud)
在内部,它使用搜索循环模式,可能类似于您已经提到的操作。然后,如果您只想进行搜索,则可以使用以下其他API:
SearchService.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_XPATH, "/app:company_home/cm:path/cm:to/cm:content")
Run Code Online (Sandbox Code Playgroud)
OOTB远程API是org/alfresco/cmis/item.getWeb脚本,其中提供以下URL模板:
/cmis/s/{store}/arg/p?path={path}&filter={filter?}&returnVersion={returnVersion?}&includeAllowableActions={includeAllowableActions?}&includeRelationships={includeRelationships?}&includeACL={includeACL?}&renditionFilter={renditionFilter?}
/api/path/{store_type}/{store_id}/{nodepath}?filter={filter?}&returnVersion={returnVersion?}&includeAllowableActions={includeAllowableActions?}&includeRelationships={includeRelationships?}&includeACL={includeACL?}&renditionFilter={renditionFilter?}
Run Code Online (Sandbox Code Playgroud)
但是,我不建议将其用于对性能有严格要求的路径,因为CMIS非常健谈。我可能会开发一个利用上述基础API的自定义Web脚本。