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:
Adding a Node
To add a component node:
Create a portal component context for the component.
IPortalComponentContext portalContext = request.getComponentContext("myApp.myComp");
Create a component node.
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:
request.getNode().getPortalNode().addChildNode(componentNode);
Removing a Node
To remove a child node, a node can call removeChildNode() and supply a reference to the node to be removed.
Including Another Component's Content
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:
INode childNode = request.getNode().getFirstChild(); response.include(request,childNode);
More information: Portal Object Model (POM) .