在Alfresco Share中,如何引用自定义配置文件中的nodeRef id?
我正在尝试使用一个新操作来扩展 Share DocumentLibrary,该操作提供指向基于 nodeRef Id 的某个 url 的链接(通过 share-config-custom.xml),
<action id="blabla" type="link" label="label">
<param name="page">../../alfresco/wcs/myPlugin/editor/{node.nodeRef.id}/param>
<param name="target">_blank</param>
</action>
但 Share 不会解释 { 它确实正确解释了
{ node.nodeRef
} 但我不需要完整的 URI,
例如:工作空间://SpacesStore/158f0ed4-a575-40c2-a6ef-7e7ed386ba94 我只想要节点引用 ID:158f0ed4-a575-40c2-a6ef-7e7ed386ba94
任何人都可以向我解释这背后的逻辑并提出解决方案吗?谢谢
I'm trying to extend Share DocumentLibrary with a new action that provide a link to some url based on the nodeRef Id (through share-config-custom.xml)
<action id="blabla" type="link" label="label">
<param name="page">../../alfresco/wcs/myPlugin/editor/{node.nodeRef.id}/param>
<param name="target">_blank</param>
</action>
But Share does not interpret {node.nodeRef.id}
It does interpret {node.nodeRef}
correctly but I don't need the full URI
Like: workspace://SpacesStore/158f0ed4-a575-40c2-a6ef-7e7ed386ba94
I just want the node ref id : 158f0ed4-a575-40c2-a6ef-7e7ed386ba94
Anyone can explain me the logic behind this and suggest a solution? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,我假设您要求使用 Alfresco 4.0。扩展动作的方式在 4.0 中是全新的,我们大多数人还没有使用过。
创建占位符的逻辑可能位于 Share web 应用程序中的 Java 代码中(尚未找到确切位置)。 node.nodeRef 是一个字符串,因此您不能调用nodeRef.id。在我看来,你有两个选择:
您将类型更改为 type="javascript" 并在 Javascript 中实现回调函数。单击链接时将调用该函数并可以构建正确的 URL。要包含自定义 JavaScript,您可以在共享配置中使用依赖项:
据我所知,可用于扩展新操作的唯一文档是:
First of all I assume you are asking for Alfresco 4.0. The way how actions can be extended is completely new in 4.0 and most of us haven't used that yet.
The logic that creates the place holders is probably in Java code in the Share webapp (haven't found the exact location). The node.nodeRef is a String so you can not call nodeRef.id. In my opinion you have two options:
You change the type to type="javascript" and implement a callback function in Javascript. This will be called when the link is clicked and can build the correct Url. To include custom javascript you can use the dependencies in the Share config:
As far as I know the only documentation available for extending the new actions is:
只需使用 Javascript API Wiki 中所示的 node.id
Just use node.id as seen at the Javascript API Wiki