what is subnode in aflresco and how to create a subnode in aflresco ?
I've never heard of that term. Can you please provide the context?
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.
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
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.