{
String layoutName = frag.getName();
if ( layoutName != null && layoutName.length() > 0 )
{
// logic below is copied from org.apache.jetspeed.portlets.MultiColumnPortlet
PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( layoutName );
ParameterSet paramSet = portletDef.getInitParameterSet();
Parameter sizesParam = paramSet.get( "sizes" );
String sizesParamVal = ( sizesParam == null ) ? null : sizesParam.getValue();
if ( sizesParamVal != null && sizesParamVal.length() > 0 )
{
fragSizes.put( frag.getId(), sizesParamVal );
//log.info( "GetPageAction settings sizes for " + frag.getId() + " to " + sizesParamVal);
}
else
{
Parameter colsParam = paramSet.get( "columns" );
String colsParamVal = ( colsParam == null ) ? null : colsParam.getValue();
if ( colsParamVal != null && colsParamVal.length() > 0 )
{
int cols = 0;
try
{
cols = Integer.parseInt( colsParamVal );
}
catch ( NumberFormatException ex )
{
}
if ( cols < 1 )
{
cols = 2;
}
switch (cols)
{
case 1: sizesParamVal = "100%"; break;
case 2: sizesParamVal = "50%,50%"; break;
case 3: sizesParamVal = "34%,33%,33%"; break;
default: sizesParamVal = "50%,50%"; break;
}
fragSizes.put( frag.getId(), sizesParamVal );
//log.info( "GetPageAction defaulting sizes for " + frag.getId() + " to " + sizesParamVal);
}
}
}
}
List childFragments = frag.getFragments();
if ( childFragments != null )
{
Iterator childFragIter = childFragments.iterator();
while ( childFragIter.hasNext() )
{
Fragment childFrag = (Fragment)childFragIter.next();
retrieveFragmentSpecialProperties( requestContext, childFrag, fragSizes, portletIcons );
}
}
}
else if ( portletIcons != null && "portlet".equals( frag.getType() ) )
{ // get portlet icon and locale specific portlet display name
String portletName = frag.getName();
if ( portletName != null && portletName.length() > 0 )
{
PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( portletName );
if ( portletDef != null && portletIcons != null )
{
ParameterSet paramSet = portletDef.getInitParameterSet();
Parameter iconParam = paramSet.get( "portlet-icon" );
String iconParamVal = ( iconParam == null ) ? null : iconParam.getValue();
if ( iconParamVal != null && iconParamVal.length() > 0 )
{
portletIcons.put( frag.getId(), iconParamVal );