1

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.

PRVS
  • 1,612
  • 4
  • 38
  • 75

1 Answers1

3

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.

Tahir Malik
  • 6,623
  • 15
  • 22
  • A little late but you can use the yui-compressor library of alfresco fro doing that: /opt/alfresco/alfresco-4.2.e/java/bin/java -jar /opt/alfresco/alfresco-4.2.e/tomcat/webapps/share/WEB-INF/lib/yuicompressor-2.4.7.jar users-size-quota.js -o users-size-quota-min.js – 4535992 Jun 27 '17 at 07:49