To generate the HTML content for a specific HTTP request, the portal creates a POM (Portal Object Model) tree of all components that are involved in generating HTML for the request. You can use the following methods to manipulate nodes in the POM tree, as follows:
To add a component node:
Create a portal component context for the component.
Syntax
IPortalComponentContext portalContext = request.getComponentContext("myApp.myComp");
Create a component node.
Syntax
IComponentNode componentNode = request.getNode().getPortalNode() .createComponentNode("myNode",portalContext);
Add the node to the POM tree. For example, the following adds a node to the portal node:
Syntax
request.getNode().getPortalNode().addChildNode(componentNode);
To remove a child node, a node can call removeChildNode() and supply a reference to the node to be removed.
During content creation, a component, which is represented by a node in the POM tree, can include in its response the content from another component, as shown below:
Syntax
INode childNode = request.getNode().getFirstChild(); response.include(request,childNode);
More information: Portal Object Model (POM).