gpt4 book ai didi

java - 在 Alfresco 4 中添加自定义操作规则

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:17:52 25 4
gpt4 key购买 nike

我是露天的新手。我正在尝试在 alfresco 中执行以下任务并反射(reflect)在 alfresco 共享中的修改。我想做的是创建一个名为 XCopy 的新规则操作,这与复制功能相同。唯一不同的是名字。应该可以附加为给定文件夹定义的规则,并且应该接受要复制的文件位置。

我对 alfresco 模块中的 Spring 配置没问题。但我对共享模块配置感到困惑。任何人都可以建议我将自定义操作添加到共享中的方法吗?谢谢。

最佳答案

您必须通过将同一文件复制到具有相同文件夹结构的网络扩展来自定义位于 site-webscripts\org\alfresco\components\rules\config 的 rule-config-action.get.config.xml。在

中添加自定义操作,然后在 中添加。说,

<group>
<action name="copy"/>
<action name="move"/>
<action name="xcopy"/>
</group>
<customise>
<item id="select">Select</item>
......
<action name="copy">Copy</action>
<action name="move">Move</action>
<action name="xcopy">CreateLinkToDocument</action> <!--xcopy should be id of spring bean configured as action-executer -->
</customise>

在rule-details.get.head.ftl和rule-edit.get.head.ftl中添加自定义javascript js

<!--Custom javascript file include for detail mode -->
<@script type="text/javascript" src="${page.url.context}/test/components/rules/config/rule-config-action-custom.js"></@script>

在共享根文件夹下的test/components/rules/config文件夹中创建rule-config-action-custom.js

将以下代码添加到 if 以在共享中打开文件选择器,

if (typeof SomeCo == "undefined" || !SomeCo)
{
var SomeCo = {};
}

/**
* RuleConfigActionCustom.
*
* @namespace SomeCo
* @class SomeCo.RuleConfigActionCustom
*/
(function()
{

/**
* YUI Library aliases
*/
var Dom = YAHOO.util.Dom,
Selector = YAHOO.util.Selector,
Event = YAHOO.util.Event;

/**
* Alfresco Slingshot aliases
*/
var $html = Alfresco.util.encodeHTML,
$hasEventInterest = Alfresco.util.hasEventInterest;

SomeCo.RuleConfigActionCustom = function(htmlId)
{
SomeCo.RuleConfigActionCustom.superclass.constructor.call(this, htmlId);

// Re-register with our own name
this.name = "SomeCo.RuleConfigActionCustom";
Alfresco.util.ComponentManager.reregister(this);

// Instance variables
this.customisations = YAHOO.lang.merge(this.customisations, SomeCo.RuleConfigActionCustom.superclass.customisations);
this.renderers = YAHOO.lang.merge(this.renderers, SomeCo.RuleConfigActionCustom.superclass.renderers);

return this;
};

YAHOO.extend(SomeCo.RuleConfigActionCustom, Alfresco.RuleConfigAction,
{

/**
* CUSTOMISATIONS
*/

customisations:
{
CreateLinkToDocument:
{
text: function(configDef, ruleConfig, configEl)
{
// Display as path
this._getParamDef(configDef, "destination-folder")._type = "path";
return configDef;
},
edit: function(configDef, ruleConfig, configEl)
{
// Hide all parameters since we are using a cusotm ui but set default values
this._hideParameters(configDef.parameterDefinitions);

// Make parameter renderer create a "Destination" button that displays an destination folder browser
configDef.parameterDefinitions.push({
type: "arca:destination-dialog-button",
displayLabel: this.msg("label.to"),
_buttonLabel: this.msg("button.select-folder"),
_destinationParam: "destination-folder"
});
return configDef;
}
},
},

});

})();

检查此以供引用:http://ecmarchitect.com/images/articles/alfresco-actions/actions-article-2ed.pdf

如果您需要更多帮助,请告诉我

关于java - 在 Alfresco 4 中添加自定义操作规则,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17021417/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com