+

Search Tips   |   Advanced Search

Make modifications using the Controller SPI

The Controller SPI allows us to modify portal resources, the topology of the portal, and properties.


ContentModelController cmController= null;

final Context ctx = new InitialContext();

final ContentModelControllerHome home = (ContentModelControllerHome) ctx.lookup(ContentModelControllerHome.CONTENT_MODEL_CONTROLLER_JNDI_NAME);
if (home != null) 
{
      cmController = home.getContentModelControllerProvider().createContentModelController(aContentModel);
}

After completing modifications, commit the controller, After we cannot use or commit the controller any more. We dispose of the controller. To commit the modifications and dispose the controller...

try 
{
    controller.commit();
} 
finally 
{
    controller.dispose();
}


See


Parent Controller SPI

Related tasks:
Obtain a controller for working with resources
Commit and persist the modifications