Show TOC

Background documentationManaging Nodes Locate this document in the navigation structure

 

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:

  1. Create a portal component context for the component.

    Syntax Syntax

    1. IPortalComponentContext portalContext = 
          request.getComponentContext("myApp.myComp");
      
    End of the code.
  2. Create a component node.

    Syntax Syntax

    1. IComponentNode componentNode = request.getNode().getPortalNode()
          .createComponentNode("myNode",portalContext);
      
    End of the code.
  3. Add the node to the POM tree. For example, the following adds a node to the portal node:

    Syntax Syntax

    1. request.getNode().getPortalNode().addChildNode(componentNode);
    End of the code.
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:

Syntax Syntax

  1. INode childNode = request.getNode().getFirstChild();
    response.include(request,childNode);
    
End of the code.

More information: Portal Object Model (POM).