AnsweredAssumed Answered

Show orginal Link files

Question asked by vhakkal on Jul 3, 2008
Hello,

So I have create a folder that only contains Alfresco Link Nodes. When I search again the that folder it will return me the link item I would like to be able to retrieve the original file.  I wan to this all within javascipt.


var newNodeArray= new Array();
var searchPath='Public Docs';
if(args.p != null && args.lenght != 0)
{
   searchPath = args.p;
}
var folderNode = companyhome.childByNamePath(searchPath);
var luceneQuery = "+PATH:\"" + folderNode.qnamePath + "//*\" ";
var luceneQueryType =" AND +TYPE:\"cm:link\"";

var nodes = search.luceneSearch(luceneQuery + luceneQueryType);

for(var i=0; i < nodes.length; i++)
{
    var nodeId = nodes.properties["cm:destination"];

     if(nodeId != undefined)
     {
         var newNode = search.findNode(nodeId);
         if(newNode != null)
         {
              newNodeArray.push(newNode);
         }
      } 
}
model.resultset = newNodeArray;


This does not seem to work.  Any suggestions?

Thanks

Outcomes