cancel
Showing results for 
Search instead for 
Did you mean: 

[Solved]DocumentLibrary: Custom Action

lamba
Champ on-the-rise
Champ on-the-rise
Hi everybody,

I tray to add a custom action to the DocumentLibrary (like assign workflow). I added the icon to the action menu and I created the WS for the form dialogue (deployed at 'share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\modules\documentlibrary').
Now I want to know where the mapping between the action link and the form dialogue is made?

P.S. Is there any documentation on best-practices to customize Alfresco Share like the Alfresco Developer Guide Book (wrote by JeffPotts)?

Thanks.
7 REPLIES 7

zaizi
Champ in-the-making
Champ in-the-making
You a JS function with the same value as the action id you defined.

See this: http://wiki.alfresco.com/wiki/Custom_Document_Library_Action

lamba
Champ on-the-rise
Champ on-the-rise
Thanks zaizi,

I tried the example in wiki and it worked well.
But now, I need to add interaction user by selecting a value of a parameter on a pop before executing the action (exactly like assign workflow action).


regards,
Lamba

lamba
Champ on-the-rise
Champ on-the-rise
Hi all,

I need example of custom action with user interaction.


Thanks in advance.

mikeh
Star Contributor
Star Contributor
The assign workflow action is wired up to do this:
      /**
       * Assign workflow.
       *
       * @method onActionAssignWorkflow
       * @param asset {object} Object literal representing the file or folder to be actioned
       */
      onActionAssignWorkflow: function dlA_onActionAssignWorkflow(asset)
      {
         if (!this.modules.assignWorkflow)
         {
            this.modules.assignWorkflow = new Alfresco.module.DoclibWorkflow(this.id + "-workflow");
         }

         this.modules.assignWorkflow.setOptions(
         {
            siteId: this.options.siteId,
            containerId: this.options.containerId,
            path: this.currentPath,
            files: asset
         }).showDialog();
      },

The Alfresco.module.DoclibWorkflow class is defined in modules/documentlibrary/workflow.js

Thanks,
Mike

lamba
Champ on-the-rise
Champ on-the-rise
thanks make,

But, me too, I used this action to set up mine. I added a similar declaration of that in the file action.js and I defined my class under the directory modules / documentlibrary/.

I would try to restart again…   :roll:

lamba
Champ on-the-rise
Champ on-the-rise
Sorry, I wanted to say thank you Mike  Smiley Happy

lamba
Champ on-the-rise
Champ on-the-rise
I success to make it turn. Thank you Mike.

In fact, it is necessary to pay attention to the @ during the include of a new action in the file actions-common.get.head.ftl. So during the addition of a new declaration in the file action.js it is necessary to remove @ in front of the call of this file in the actions-common.get.head.ftl.