Returns a layout model controller for the specified content page. In case
a layout model controller has been requested for the specified content
page before, that instance is returned; otherwise a new layout model
controller is returned.
Note A LayoutModelController
can only be obtained for
pages that either already exist or that were inserted already, i. e. the
following code will fail:
final ModifiableContentPage newPage = contentModelController.create(ContentPage.class, null)
contentModelController.getLayoutModelController(newPage); // this will throw a CannotInstantiateControllerException
Instead this should be used:
// the create call creates an unmanaged node
final ModifiableContentPage newPage = contentModelController.create(ContentPage.class, null)
// Insert the node to make it known to controller
contentModelController.insert(newPage, parent, sibling);
// Now the layout might be generated...
contentModelController.getLayoutModelController(newPage);
- Parameters:
aContentPage
- content page to return a layout model controller for
- Returns:
- the layout model controller for the specified content page; never
null
- Throws:
CannotInstantiateControllerException
- in case a controller cannot be instantiated