RunData rundata)
{
JetspeedRunData jdata = (JetspeedRunData) rundata;
// get the customization state for this page
SessionState customizationState = jdata.getPageSessionState();
super.buildCustomizeContext(controller, context, rundata);
List[] columns = null;
// retrieve the number of columns
String cols = controller.getConfig().getInitParameter("cols");
int colNum = 0;
try
{
colNum = Integer.parseInt(cols);
}
catch (Exception e)
{
// not an integer or null, default to standarrd value
colNum = 3;
}
context.put("colNum", String.valueOf(colNum));
//retrieve the size for each of the columns
String sizes = controller.getConfig().getInitParameter("sizes");
context.put("sizes", getCellSizes(sizes));
//retrieve the class for each of the columns
String columnClasses = controller.getConfig().getInitParameter("col_classes");
context.put("col_classes", getCellClasses(columnClasses));
columns = (List[]) customizationState.getAttribute("customize-columns");
PortletSet customizedSet = (PortletSet) jdata.getCustomized();
Portlets set = jdata.getCustomizedProfile()
.getDocument()
.getPortletsById(customizedSet.getID());
Log.debug("MultiCol: columns " + columns + " set " + set);
if ((columns != null) && (columns.length == colNum))
{
int eCount = 0;
for (int i = 0; i < columns.length; i++)
{
eCount += columns[i].size();
}
Log.debug("MultiCol: eCount " + eCount + " setCount" + set.getEntryCount() + set.getPortletsCount());
if (eCount != set.getEntryCount() + set.getPortletsCount())
{
Log.debug("MultiCol: rebuilding columns ");
columns = buildColumns(set, colNum);
}
}
else
{
Log.debug("MultiCol: rebuilding columns ");
columns = buildColumns(set, colNum);
}
customizationState.setAttribute("customize-columns", columns);
context.put("portlets", columns);
Map titles = new HashMap();
for (int col = 0; col < columns.length; col++)
{