AnsweredAssumed Answered

Issue extending custom event

Question asked by purohitsumit on Jul 22, 2014
Hi All,

After reading following link I am trying to add some code to "onNodeClicked" event

http://docs.alfresco.com/4.0/concepts/doclib-client-side-template-and-action-extensions.html

I added "\<my-jar-basedir>\alfresco\extension\share-documentlibrary-config.xml" with following content :


<alfresco-config>

<!– Document Library Custom Code config section –>
   <config evaluator="string-compare" condition="DocLibCustom">
      <!–
         Custom Code dependencies.

         Note: files specified in the "src" attribute resolve relative to the /share/res/ servlet context.
         –>
         <dependencies>
           
            <js src="/components/documentlibrary/tree-custom.js" />
         </dependencies>
     
      <dependencies />
   </config>
</alfresco-config>




I have js file in "\<my-jar-basedir>\META-INF\components\documentlibrary\tree-custom.js"


(function()
   {
      YAHOO.Bubbling.fire("registerAction",
         {
            actionName: "onNodeClicked",
            fn: function showWikiPage(args)
             {
                var node = args.node;
                  if (this.isFilterOwner && node == this.selectedNode)
                  {
                    ; //placeholder from source in tree.js
                  }
                  else
                  {
                  //alert("hello");  
                  document.getElementById('wikiframe').src = "http://localhost/wiki/index.php/WFS:/'+node.data.path;
                    
                  }

                  Event.stopEvent(args.event);
                  // Prevent the tree node from expanding (TODO: user preference?)
                  return false;
               
             }
         });
   
   })();   





But this code is not effective on share's document library page. I don't see tree-custom.js file in source so may be it is not getting included.

Any help is appreciated.

Thanks
Sumit Purohit

Outcomes