如何在Alfresco中创建规则以将内容一个文件夹移动到另一个文件夹?

编程入门 行业动态 更新时间:2024-10-16 18:37:27
本文介绍了如何在Alfresco中创建规则以将内容一个文件夹移动到另一个文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在考虑创建一个规则,可能是一个javascript脚本,它会根据文件的属性将文档移动到另一个文件夹。换句话说,我将始终将文档上传到 folderA 。 Alfresco将提取文档的属性,例如 prop1 ,我定义的规则将此文档移动到 folderB 如果它具有属性 prop1 ,否则它将文档移动到 folderC 。我知道如何提取属性,但我不知道如何创建此规则。我不知道,因为我从未使用过javascript。任何帮助将不胜感激。

I am thinking to create a rule, possibly a javascript script, which will move documents one folder to another depending on its properties. In the other words, I will always upload documents to folderA. Alfresco will extract document's property, for example prop1, and the rule that I define will move this document to folderB if it has property prop1, otherwise it will move the document to folderC. I know how to extract properties but I don't know how to create this rule. I have no idea since I never used javascript. Any help will be appreciated.

推荐答案

在记下规则时,您需要设置一些属性。这些属性的说明如下。

There are some properties which you need to set while credating rule.Explanation of those properties are as below.

1.当触发规则时: - 项目已创建或输入此文件夹 - 项目已更新 - 项目被删除或保留此文件夹

1.When the rules will be triggered: - Items are created or enter this folder - Items are update - Items are deleted or leave this folder

2.criteria,用于触发规则。

2.criteria for the rule to be fired.

3.定义要执行的操作。 在这里你需要选择自定义的javascript。

3.Define the action you want performed. Here you need to select custom javascript.

当你选择这个选项时,它会从数据字典的脚本文件夹中加载脚本。

When you select this option it will load script from the script folder of Data Dictionary.

在该脚本中,您需要编写以下代码。

In that script you need to write below code.

if(document.properties.prop1=="yourvalues") { document.move(folderA);//Where FolderA will be a destination node and not a string }else{ document.move(folderB);//Where FolderB will be a destination node and not a string }

对象文档引用当前对象,执行规则。请在图像下方。

object document referes to current object, on which rule is executed.Refer below image.

以下是我测试和执行的脚本。

Below is the script which i have tested and executed.

if(document.properties.title=="demo") { document.move(companyHome); }else{ document.move(userhome); }

更多推荐

如何在Alfresco中创建规则以将内容一个文件夹移动到另一个文件夹?

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

发布评论

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

>www.elefans.com

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