cancel
Showing results for 
Search instead for 
Did you mean: 

what is subnode in aflresco and how to create a subnode in aflresco ?

sudarshansingha
Champ on-the-rise
Champ on-the-rise

what is subnode in aflresco and how to create a subnode in aflresco ?

5 REPLIES 5

jpotts
World-Class Innovator
World-Class Innovator

I've never heard of that term. Can you please provide the context?

afaust
Legendary Innovator
Legendary Innovator

He is very likely referencing a part of an answer that I gave in a separate thread. Instead of asking me there he asked in a new question.

With "sub-node" in my response I meant a node contained by another node, or a "child node". Generally speaking, every node is a child node of some other node, so I sometimes use "sub-node" when I want to refer to a node that semantically extends another, i.e. provides additional information. In the context of the original question, this would apply to the "contact" detail which would extend the information about the person/user.

You create a child node via the Alfresco APIs, i.e. in Java via the NodeService.createNode() operation or in server-side JavaScript API via ScriptNode.createNode() - you will always need to have a reference to the parent node, i.e. the "person" as either a NodeRef or a ScriptNode to use these operations.

jpotts
World-Class Innovator
World-Class Innovator

Yes, "child node" is much more explicit. I like it better than "sub-node" which kind of sounds like "sub-class" which implies some sort of inheritance.

To answer OP's original question, the way you create a child node is simple: You create a child node with the node service like any other node. Unless you are creating the root node, which is highly unlikely, then every node you create is a child node and has a parent.

Often, the parent is the enclosing folder. But you could also add a child node to a non-folder node by using a parent-child association. A word of caution, however. Parent-child associations are not supported in CMIS (unless it is a folder that contains child nodes), so if navigating that relationship via CMIS is important, do not use a parent-child association. Use a peer association instead.

Thank you for your input

Thank you for your input