{
if ( container == null )
{
container = page.getRootFragment();
if ( container == null )
throw new PortletPlacementException( "PortletPlacementContext cannot acquire root layout fragment from page" );
}
if ( ! "layout".equals( container.getType() ) )
{
throw new PortletPlacementException( "PortletPlacementContext specified container fragment (" + container.getId() + ") is not a layout fragment, but is type: " + container.getType() );
}
this.layoutContainerFragment = container;
int columnCount = PortletPlacementContextImpl.getColumnCountAndSizes( container, registry, null );
if ( columnCount <= 0 )
{
throw new PortletPlacementException( "PortletPlacementContext cannot detemine number of columns in layout fragment (" + container.getId() + ")" );
}
this.numberOfColumns = columnCount;
initProcessLayoutContainerFragment();