12-13-2017 11:12 AM
what is subnode in aflresco and how to create a subnode in aflresco ?
12-13-2017 02:41 PM
I've never heard of that term. Can you please provide the context?
12-14-2017 06:20 AM
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.
12-14-2017 10:46 AM
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.
12-14-2017 03:13 PM
Thank you for your input
12-14-2017 03:12 PM
Thank you for your input
Explore our Alfresco products with the links below. Use labels to filter content by product module.