HttpServletResponse response) throws IOException, PortalException {
// construct a brand new tab
String id = "tbd";
String tabName = BLANK_TAB_NAME;
IUserLayoutFolderDescription newTab = new UserLayoutFolderDescription();
newTab.setName(tabName);
newTab.setId(id);
newTab.setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
newTab.setHidden(false);
newTab.setUnremovable(false);
newTab.setImmutable(false);
// add the tab to the layout
ulm.addNode(newTab, ulm.getRootFolderId(), null);
try {
// save the user's layout
saveUserLayoutPreservingTab(ulm, upm, per);
} catch (Exception e) {
log.warn("Error saving layout", e);
}
// get the id of the newly added tab
String nodeId = newTab.getId();
// pre-populate this new tab with one column
IUserLayoutFolderDescription newColumn = new UserLayoutFolderDescription();
newColumn.setName("Column");
newColumn.setId("tbd");
newColumn.setFolderType(IUserLayoutFolderDescription.REGULAR_TYPE);
newColumn.setHidden(false);
newColumn.setUnremovable(false);
newColumn.setImmutable(false);
ulm.addNode(newColumn, nodeId, null);
try {
// save the user's layout
saveUserLayoutPreservingTab(ulm, upm, per);