如何在下载文件之前在 Alfresco 中执行自定义操作?

发布于 2024-12-06 11:24:19 字数 199 浏览 4 评论 0原文

我想在存储库中存储未更改的文件,但由于用户的角色而在下载时更改其内容。

为此,我刚刚创建了自己的操作来更改文件内容,但发现 Alfresco 没有提供在文件下载时执行的适当规则。

我的操作必须在使用 API(链接)和使用 CIFS 或 WebDAV(从文件夹复制)下载时执行,因此我必须使用规则引擎来执行操作。

我怎样才能意识到这一点?

I want to store in the repository an unchanged file, but change its content on dowloading due to user's role.

To do this I just created my own action that changes content of the file, but found that Alfresco does not provide an appropriate rule to be executed on file downloading.

My action must execute on download using API (link) and using CIFS or WebDAV (copying from folder), so I have to use a rules engine to execute action.

How can I realize this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笔落惊风雨 2024-12-13 11:24:19

虽然我想不出保留您描述的数据流的解决方案,特别是因为涉及文件服务器接口,但我建议您不要根据用户请求转换内容,因为这需要对每个内容进行在线(阻塞)计算用户下载。我还假设这种转换的结果对于给定的角色是“静态的”。

我将通过以下方式解决您的用例:

  • 创建一个 action 来生成所有需要的版本文档

  • 这样的操作也应该相应地设置权限,所以仅向目标角色授予 ReadPermission

  • 设置 入站规则,触发对所有传入文档的操作

  • (可选)创建并设置类似的操作/规则对,以在内容删除时清理所有呈现

这样,无论哪个用户或角色访问给定文件夹,都将仅以他期望的形式呈现内容。

While I can't think of a solution that preserves the dataflow you describe, especially since file server interfaces are involved, I would advise you not to transform the content upon user request, as it would require online (blocking) computations upon each and every user download. I also assume that the results of such transformations are "static" for a given role.

I would solve your use case by:

  • creating an action that generates all the needed versions of the document

  • such action should also set permissions accordingly, so that ReadPermission is granted only to the target role

  • setup an inbound rule that triggers the action on all incoming documents

  • (optionally) creates and setup a similar action/rule pair to cleanup all the renditions upon content deletion

This way whichever user or role accesses the given folder will be presented only content in the form he's expecting to have.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文