* @throws IOException
*/
private void persistPages() throws IOException {
//TODO: Null checks??? Substitute empty string or throw an Exception
final String NL = System.getProperty("line.separator");
DriverConfiguration driverConfig = (DriverConfiguration) getPortletContext()
.getAttribute(AttributeKeys.DRIVER_CONFIG);
StringBuffer renderConfig = new StringBuffer();
//start with render-config element
renderConfig.append(" ");//indent
renderConfig.append(RENDER_CONFIG_SEARCH_TOKEN);
renderConfig.append(getDefaultPage());
renderConfig.append("\">");
renderConfig.append(NL);
Collection pages = getAvailablePages();
//iterate through pages
for (Iterator iter = pages.iterator(); iter.hasNext();) {
Page page = (Page) iter.next();
PageConfig config = driverConfig.getPageConfig(page.getName());
renderConfig.append(" <page name=\"");
String pageName = config.getName();
renderConfig.append(pageName);
renderConfig.append("\" uri=\"");
String uri = config.getUri();