int currRow = 0;
int lastRow = 0;
int currCol = 0;
while (iter.hasNext()) {
count++;
PortletTO portlet = (PortletTO)iter.next();
logDebug(METHOD_NAME, "Portlet: " + portlet);
currRow = portlet.getRow();
currCol = portlet.getCol();
//start row fragment
// Add row fragment when row changes
if (currRow != lastRow) {
ras.writeBytes(" <fragment name=\"row" + currRow + "\" type=\"row\">" + PlutoAdminConstants.LS);
ras.writeBytes(" <fragment name=\"col" + count + "\" type=\"column\">" + PlutoAdminConstants.LS);
}
ras.writeBytes(" <fragment name=\"p" + count + "\" type=\"portlet\">" + PlutoAdminConstants.LS);
ras.writeBytes(" <property name=\"portlet\" value=\"" + portlet.getValue() + "\"/>" + PlutoAdminConstants.LS);
ras.writeBytes(" </fragment><!-- end of portlet frag -->" + PlutoAdminConstants.LS);
//end row fragment
if (cols == currCol) {
ras.writeBytes(" </fragment><!-- end of col frag -->" + PlutoAdminConstants.LS);