01-31-2011 02:40 PM
02-01-2011 05:37 AM
(function()
{
Alfresco.doclib.Actions.prototype.onPublish = function WCMQS_onPublish(asset)
{
var displayName = asset.displayName;
this.modules.actions.genericAction(
{
success:
{
event:
{
name: "metadataRefresh"
},
message: this.msg("message.wcmqs.asset-published-success")
},
failure:
{
message: this.msg("message.wcmqs.asset-published-failure")
},
webscript:
{
method: Alfresco.util.Ajax.POST,
stem: Alfresco.constants.PROXY_URI + "api/",
name: "actionQueue"
},
config:
{
requestContentType: Alfresco.util.Ajax.JSON,
dataObj:
{
actionedUponNode: asset.nodeRef,
actionDefinitionName: "webqs_publish"
}
}
});
};
})();
<#include "../component.head.inc">
<#include "../form/form.get.head.ftl">
<!– WCM QuickStart actions - JS –>
<@script type="text/javascript" src="${page.url.context}/res/components/documentlibrary/wcmqs-actions.js"></@script>
<@script type="text/javascript" src="${page.url.context}/res/components/documentlibrary/wcmqs-action-extensions.js"></@script>
<!– Document List –>
<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/components/documentlibrary/documentlist.css" />
<@script type="text/javascript" src="${page.url.context}/res/components/documentlibrary/documentlist.js"></@script>
<!– WCM QuickStart actions - CSS –>
<@link rel="stylesheet" type="text/css" href="${page.url.context}/res/components/documentlibrary/wcmqs-actions.css" />
(Note the new reference to "wcmqs-action-extensions.js" on line 5)
<action type="action-link" id="onPublish" permission="delete" label="actions.wcmqs.publish-webasset" />
This will add a new action link onto each document that calls the onPublish function that you defined in your new JavaScript file. In this case it will show itself only if the user has permission to delete the asset in question.
actions.wcmqs.publish-webasset=Publish Web Asset
message.wcmqs.asset-published-success=Asset queued for publishing
message.wcmqs.asset-published-failure=Failed to place asset on the publishing queue
02-01-2011 05:39 PM
02-02-2011 03:49 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.