AnsweredAssumed Answered

Access file of the new page after a custom action - Alfresco

Question asked by pat9rv3sousa on Oct 31, 2015
Latest reply on Nov 2, 2015 by muralidharand
I make an action for documents :


<action id="documents-document" type="javascript" label="actions.documents-document" icon="documents-document">
<param name="function">onActionDocument</param>
<permissions>
<permission allow="true">Write</permission>
</permissions>
</action>


In this action, I want to call a new page created with Aikau -> something like this ->

http://docs.alfresco.com/5.0/concepts/dev-extensions-share-page-creation.html

But, I want to access the document in the new page… On the function onActionDocument I access document like:


(function() {
YAHOO.Bubbling.fire("registerAction",
{
actionName: "onActionDocument",
fn: function JSC_onActionDocument(file) {
    alert(file.nodeRef)
    alert(file.displayName)
}
}
});


But, I have another JS, FTL and XML for the new page… And in this files, how can I access the file? I try to make a POST and, now, a GET Request and pass the parameter on the URL like this:

http://localhost:8080/share/page/hdp/ws/my-new-page?file={pdfExample.pdf}

I put in the JS of the new page something like :


var a = file


but when the page is open, I obtain the 500 error Internal Server and I got "file is undefined".

How can I pass this file to the new page?

Outcomes