中添加。
说,
<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 以在 Share 中打开文件选择器,
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
如果您需要更多帮助,请告诉我