WebSphere Portal, Express Beta Version 6.1
Operating systems: i5/OS, Linux,Windows


 

Moving or Inserting Nodes

To move existing nodes or insert new nodes, use the insert() method of the controller.

Notes:

  1. When you create a new node, you need to insert it into the topology of the model, for example, to make it visible and accessible for users.
  2. Operations that you defined on the controller itself, such as hasChildren() or getLayoutModelController(), work only after you insert the node.
To move or insert nodes, proceed by the following steps:

  1. Obtain an appropriate controller.
  2. Identify the target location in the topology. You will need that information in a later step.
  3. Identify the resource that you want to move or insert as follows:

  4. Insert the resource into the topology of the controller by using its insert() method and by specifying its target location. this can be one of the following:

  5. Persist your modifications by using the commit() method of the controller.
Example 1 - Moving an existing portlet to a different container (error handling omitted):
// obtain locator of LayoutModelController
final Locator locator = lmController.getLocator();

// locate portlet and target containers
final LayoutControl control = (LayoutControl) locator.findByUniqueName("MyControl");
final LayoutContainer parentContainer = (LayoutContainer) locator.findByUniqueName("MyParentContainer");
final LayoutContainer nextContainer = (LayoutContainer) locator.findByUniqueName("MyNextContainer");

// move portlet under parentContainer just before nextContainer
lmController.insert(control, parentContainer, nextContainer);

Parent topic: Modifying portal resources and topologies Related information
Creating resources
Library | Support | Terms of use |