AnsweredAssumed Answered

Calling javascript from a DocLib action

Question asked by zputnoky on May 31, 2017
Latest reply on Jun 6, 2017 by zputnoky

Dear All,

Managed to create a script which is executed on a folder level. Basically, the script takes the custom properties of the selected folder and updates all the child objects with the property values.

Currently the use is obliged to use the Run Action DocLib action and select the right JS file. I would like to simplify this to create a DocLib action displayed in folder-details and folder-browe views.

 

Added the following code to the share-config-custom.xml

 

    <config evaluator="string-compare" condition="DocLibActions">
        <actions>
         <action id="updatedocuments" type="javascript" label="Update" icon="folder-move-to">
              <param name="function">onActionUpdateDocuments</param>            
           </action>
        </actions>
        <actionGroups>
            <actionGroup id="folder-browse">
                <action index="500" id="updatedocuments" />           
            </actionGroup>
            <actionGroup id="folder-details">
                <action index="500" id="updatedocuments" />           
            </actionGroup>
        </actionGroups>       
    </config>

 

  • Do I have to copy the JS file into the \tomcat\webapps\share\js folder?
  • How can I tell to the action definiton to which JS file it should talk to?

 

Thanks alot for your help,

 

Zsolt Putnoky

Outcomes