cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with the search.findNode()

rodrigoa
Champ in-the-making
Champ in-the-making
Hi all,

I am having some problems to use the function search.findNode(). I would like to ask if anyone could help me.

Here is my code:

      onModifierEnLigne: function ObjectFinder_onModifierEnLigne(event, args)
      {
         if ($hasEventInterest(this, args))
         {
            var data = args[1].value;
            var rowId = args[1].rowId;
            var nodeRef = this.selectedItems[data.nodeRef];
            var temp = nodeRef.nodeRef;
            var scriptNode1 = utils.getNodeFromString(temp);
            var scriptNode2 = search.findNode(temp);
            …
         }
      },

As you can see, I tried to ways to get the scriptNode, but none of them worked.

Thanks in advance,

Rodrigo Araujo.
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
well are you referring the things from this link?
http://wiki.alfresco.com/wiki/3.4_JavaScript_API#Search_API

Please look in to that.
your "temp" has to be a nodeRef string.
for search you have to use other APIs which are mentioned there.

rodrigoa
Champ in-the-making
Champ in-the-making
Hi Miti,

thank you very much for your quick answer.

Just one question.

I also tried to do like this, just to make sure how the findNode() works:

      onModifierEnLigne: function ObjectFinder_onModifierEnLigne(event, args)
      {
         if ($hasEventInterest(this, args))
         {
            var data = args[1].value;
            var rowId = args[1].rowId;
            var nodeRef = this.selectedItems[data.nodeRef];
            var temp = nodeRef.nodeRef;
            var scriptNode1 = utils.getNodeFromString("workspace://SpacesStore/493fc5d5-4db6-454d-84b1-637f597b9be2");
            var scriptNode2 = search.findNode("workspace://SpacesStore/493fc5d5-4db6-454d-84b1-637f597b9be2");
         }
      },

But both the utils.getNodeFromString() and search.findNode() return an exception, and I am sure that this nodeRef exists.

Could you help me with that?

Thanks in advance,

Rodrigo.

mitpatoliya
Star Collaborator
Star Collaborator
what is the exception you are getting?
I think it will not be able to reach till your that line.
Also, better first try it in simple script. without any arguments.
Also, it is not advisable to use the variable names like nodeRef change that.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.