03-01-2011 03:03 AM
03-03-2011 11:33 PM
03-04-2011 02:41 AM
03-04-2011 06:05 PM
<actionSet id="document">
…..
<action type="action-link" id="onActionMyCustomAction" permission="myCustomPermission" label="actions.document.myCustomAction" />
</actionSet>
<@link rel="stylesheet" type="text/css" href="${page.url.context}/components/documentlibrary/myCustomAction.css" />
actions.document.actions.document.myCustomAction=My custom action label
message.myCustomAction.success='{0}' successfully executed myCustomAction
message.myCustomAction.failure=Couldn't execute myCustomAction for '{0}'
….
….
.doclist .onActionMyCustomAction a
{
background-image: url(images/myCustomAction.png);
}
// Get relevant actions set
switch (nodeType)
{
…..
case "document":
……..
/* myCustomAction action evaluator */
if ( <here your condition> )
{
permissions["myCustomPermission"] = true;
}
break;
}
/**
* MyCustomAction.
*
* @method onActionMyCustomAction
* @param asset {object} Object literal representing the file to be actioned upon
*/
onActionMyCustomAction: function dlA_onActionMyCustomAction(asset)
{
var displayName = asset.displayName;
var nodeRef = new Alfresco.util.NodeRef(asset.nodeRef);
var me = this;
Alfresco.util.PopupManager.displayPrompt(
{
title: this.msg("message.confirm.myCustomAction.title"),
text: this.msg("message.confirm.myCustomAction", asset.displayName),
buttons: [
{
text: this.msg("button.myCustomAction"),
handler: function dlA_onActionMyCustomAction_create()
{
this.destroy();
me._onActionMyCustomActionConfirm.call(me, asset);
}
},
{
text: this.msg("button.cancel"),
handler: function dlA_onActionMyCustomAction_cancel()
{
this.destroy();
},
isDefault: true
}]
});
},
/**
* MyCustomAction confirmed.
*
* @method _onActionMyCustomActionConfirm
* @param asset {object} Object literal representing the file or folder to be actioned
* @private
*/
_onActionMyCustomActionConfirm: function dlA__onActionMyCustomActionConfirm(asset)
{
var displayName = asset.displayName,
nodeRef = new Alfresco.util.NodeRef(asset.nodeRef);
this.modules.actions.genericAction(
{
success:
{
event:
{
name: "metadataRefresh"
},
message: this.msg("message.myCustomAction.success", displayName)
},
failure:
{
message: this.msg("message.myCustomAction.failure", displayName)
},
webscript:
{
method: Alfresco.util.Ajax.POST,
name: "mycustomactionwebscript/node/{nodeRef}",
params:
{
nodeRef: nodeRef.uri
}
}
});
},
03-05-2011 04:18 AM
03-09-2011 04:36 AM
08-18-2011 08:27 AM
8 ) Add the client side javascript code for manage the custom action, in file \tomcat\webapps\share\components\documentlibrary\action.js (in this exmple I open a popup window for action confirmation and then I call a custom web-script):
08-18-2011 09:10 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.