Search code examples
javascriptxmlalfrescoalfresco-sharedocument-library

Creating custom document action Alfresco javascript


I'm trying to create a custom document action in Alfresco. But, when i try to run the new "Button" created, nothing happens, the function is not called. I'm trying, in this time, make a button equal to the "Copy to..." only for testing, so, my code is this:

~/alfresco/tomcat/webapps/share/components/documentlibrary/actions.js

(...)
onActionSign : function dlA_onActionSign(record)
  {
     //testar upload de um documento
     this._copyMoveTo("copy", record);
  },
(...)

~/alfresco/tomcat/webapps/share/WEB-INF/classes/alfresco/share-documentlibrary-config.xml

(...)
<action id="document-sign" type="javascript"  label="actions.document.document-sign">
            <param name="function">onActionSign</param>
            <evaluator>evaluator.doclib.action.editableByCurrentUser</evaluator>
</action>
(...)

I saw that in the

~/alfresco/tomcat/webapps/share/components/documentlibrary/actions-min.js

my function not appears, i think that is because not works, but how i generate this file? What is my error?

Thanks.


Solution

  • Like answered in the comment. Alfresco uses the *-min.js versions of JavaScript to lookup the actions.

    If you don't have a build script which automatically creates these files, then you can just copy and paste your normal code in these files.