03-22-2010 03:50 AM
04-08-2010 03:47 AM
05-16-2010 10:30 AM
05-16-2010 10:44 AM
I have the same problem, I applied the example step by step but the custom action link does not do anything?
Any idea?
05-16-2010 10:56 AM
…
<actionSet id="document">
<action type="simple-link" id="onActionDownload" href="{downloadUrl}" label="actions.document.download" />
<action type="action-link" id="onActionDetails" permission="edit" label="actions.document.edit-metadata" />
…
<action type="action-link" id="onActionBackup" permission="edit" label="actions.document.backup" />
</actionSet>
…
4. here is my backup-action.js/**
* DocumentList "Backup" action
*
* @namespace Alfresco
* @class Alfresco.DocumentList
*/
(function()
{
/**
* Backup single document.
*
* @method onActionBackup
* @param row {object} DataTable row representing file to be actioned
*/
Alfresco.DocumentList.prototype.onActionBackup = function DL_onActionBackup(row)
{
var file = this.widgets.dataTable.getRecord(row).getData();
this.modules.actions.genericAction(
{
success:
{
message: this._msg("message.backup.success", file.displayName)
},
failure:
{
message: this._msg("message.backup.failure", file.displayName)
},
webscript:
{
name: "backup/site/{site}/{container}",
method: Alfresco.util.Ajax.POST
},
params:
{
site: this.options.siteId,
container: this.options.containerId
},
config:
{
requestContentType: Alfresco.util.Ajax.JSON,
dataObj:
{
nodeRefs: [file.nodeRef]
}
}
});
};
})();
05-16-2010 11:03 AM
* Is the client side JavaScript file loaded?
…
1-yes client side js is loaded i see when i display the page source code
…
<script type="text/javascript" src="/share/components/documentlibrary/backup-action.js"></script>
…
05-16-2010 11:14 AM
05-16-2010 01:52 PM
05-16-2010 02:22 PM
05-16-2010 02:36 PM
It's likely because you're still using the pre-v3.2 "getRecord()" style when the wiki article states not to for v3.2 onwards. http://wiki.alfresco.com/wiki/Custom_Document_Library_Action#Action_JavaScript
Check the "Note for V3.2" section.
Thanks,
Mike
P.S. If you find a wiki article is "bugged" please find the time to correct it - that's what a wiki is all about!
/**
* DocumentList "Backup" action
*
* @namespace Alfresco
* @class Alfresco.DocumentList
*/
(function()
{
/**
* Backup single document.
*
* @method onActionBackup
* @param row {object} DataTable row representing file to be actioned
*/
alert("backup-action.js imported");
Alfresco.doclib.Actions.prototype.onActionBackup = function DL_onActionBackup(file)
{
this.modules.actions.genericAction(
{
success:
{
message: this.msg("message.backup.success", file.displayName)
},
failure:
{
message: this.msg("message.backup.failure", file.displayName)
},
webscript:
{
name: "backup/site/{site}/{container}",
method: Alfresco.util.Ajax.POST
},
params:
{
site: this.options.siteId,
container: this.options.containerId
},
config:
{
requestContentType: Alfresco.util.Ajax.JSON,
dataObj:
{
nodeRefs: [file.nodeRef]
}
}
});
};
})();
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.