}
public void savePageLayout(ActionRequest req) {
final String METHOD_NAME = "savePageLayout(request)";
logMethodStart(METHOD_NAME);
//get current page
PageTO page = (PageTO)req.getPortletSession().getAttribute(PlutoAdminConstants.PAGE_ATTR);
// logDebug(METHOD_NAME, "PageTO from session: " + page);
List list = new ArrayList();
int rows = page.getRows();
int cols = page.getCols();
for (int i = 1; i <= rows ; i++) {
for (int j = 1; j <= cols ; j++) {
String portletParam = "portlet" + i + "." + j;
String name_val = req.getParameter(portletParam);
//portlet name and values are separated by an underscore
int underscore = name_val.lastIndexOf("_");
String name = name_val.substring(0, underscore);
String val = name_val.substring(underscore + 1);
//create a PortletTO and add it to the list
PortletTO nPortlet = new PortletTO();
nPortlet.setName(name);
nPortlet.setValue(val);
nPortlet.setRow(i);
nPortlet.setCol(j);
list.add(nPortlet);
}
}
page.setPortlets(list);
// logDebug(METHOD_NAME, "Updated PageTO: " + page);
addToPageReg(page);
logMethodEnd(METHOD_NAME);
}