AnsweredAssumed Answered

API differences Javascript vs JAVA

Question asked by darkredd on Aug 5, 2015
Latest reply on Aug 5, 2015 by darkredd
Hello everyone,

A silly question perhaps, however here goes: I am trying to leverage an already existing custom action which creates document links.
I have a slight lack of understanding of API differences.

In Javascript I am able to use the custom action's logic to create link with a script (Action Rule). But using Java with the same logic I do not get the same output.

Javascript
fNode.createNode(sNode.name + " Link", "{custom.uri}filelink", pr)

Where <strong>pr</strong> is a list of properties to be attached to the newly created link.

Java
nodeService.createNode(parentDest, ContentModel.ASSOC_CONTAINS, QName.createQName(LINK_URI), ContentModel.TYPE_CONTENT, linkParams)

Where <strong>linkParams</strong> is a list of properties to be attached to the newly created link.
I did not use the <strong>FileFolderService</strong> because it does not offer me a way to attach properties to the node.

With javascript I am able to create a link as if I had clicked on a document Library action itself, but with JAVA it just creates a new node altogether without any reference to the source node.

Am I misusing the JAVA API or is there just a difference entirely?

Outcomes