通过路径获取Alfresco NodeRef

编程入门 行业动态 更新时间:2024-10-12 12:29:32
本文介绍了通过路径获取Alfresco NodeRef的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想获取Alfresco中存储的文档(或空间)的NodeRef.

I want to get the NodeRef of a document (or space) stored in Alfresco.

我的代码是Java语言,在Alfresco(例如AMP)中运行.

My code is in Java, running within Alfresco (for instance in an AMP).

我不在乎竞争条件,因为我只会将其用于我肯定已经存在了几天的节点.

I don't care about race conditions, as I will only use this for nodes that I know for sure have existed for days already.

怎么办?

推荐答案

最简单的方法可能是使用 NodeLocatorService 和 XPath locatorName +一个xpath表达式

The easiest way is probably using the NodeLocatorService and the XPath locatorName + an xpath expression

使用搜索服务的内幕,但是它为您带来了很多复杂性!

Under the hood, that uses the search service, but it wraps up a lot of the complexity for you!

要使用它,请将NodeLocatorService注入到您的bean中,然后执行以下操作:

To use it, get the NodeLocatorService injected into your bean, then do something like:

Map<String,Serializable> params = new HashMap<>(); params.put("query", "/x:path/to:node/pa:th"); NodeRef nodeRef = nodeLocatorService.getNode("xpath",null,params);

其他存在NodeLocators 用于其他查找,也可以通过/alfresco/service/api/nodelocator/{node_locator_name}?params

Other NodeLocators exist for other lookups, and it's also available remotely via /alfresco/service/api/nodelocator/{node_locator_name}?params

更多推荐

通过路径获取Alfresco NodeRef

本文发布于:2023-11-28 14:39:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642818.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路径   Alfresco   NodeRef

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!