You have to customize rule-config-action.get.config.xml located at site-webscripts\org\alfresco\components\rules\config by copying the same file to web-extension with same folder structure. Add your custom action in <menu><group> and then in <customise>.
say,
<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>
Add custom javascript js in rule-details.get.head.ftl and rule-edit.get.head.ftl
<!--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>
create rule-config-action-custom.js in test/components/rules/config folder under share root folder
Add below code to if for opening file selector in 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;
}
},
},
});
})();
Check this for reference: http://ecmarchitect.com/images/articles/alfresco-actions/actions-article-2ed.pdf
Please let me know in case you need any more help for the same