newNestedMenu.setRegexp(true);
newNestedMenu.setDepth(2);
newNestedMenu.setOrder("/x*/,/y*/,/z*/");
newNestedMenu.setSkin("bold");
newMenu.getMenuElements().add(newNestedMenu);
MenuExcludeDefinition newExcludeMenu = folder.newMenuExcludeDefinition();
newExcludeMenu.setName("exclude-menu");
newMenu.getMenuElements().add(newExcludeMenu);
MenuIncludeDefinition newIncludeMenu = folder.newMenuIncludeDefinition();
newIncludeMenu.setName("include-menu");
newIncludeMenu.setNest(true);
newMenu.getMenuElements().add(newIncludeMenu);
folder.getMenuDefinitions().add(newMenu);
newMenu = folder.newMenuDefinition();
newMenu.setName("folder-breadcrumb-menu");
newMenu.setSkin("bread-crumbs");
newMenu.setOptions("./");
newMenu.setPaths(true);
folder.getMenuDefinitions().add(newMenu);
pageManager.updateFolder(folder);
assertNull(folder.getParent());
Page page = pageManager.newPage("/default-page.psml");
assertEquals("Default Page", page.getTitle());
page.setTitle("Default Page");
page.setVersion("6.89");
page.setDefaultDecorator("tigris", Fragment.LAYOUT);
page.setDefaultDecorator("blue-gradient", Fragment.PORTLET);
page.setDefaultSkin("skin-1");
page.setShortTitle("Default");
metadata = page.getMetadata();
metadata.addField(Locale.FRENCH, "title", "[fr] Default Page");
metadata.addField(Locale.JAPANESE, "title", "[ja] Default Page");
SecurityConstraints pageConstraints = page.newSecurityConstraints();
pageConstraints.setOwner("user");
List inlinePageConstraints = new ArrayList(1);
SecurityConstraint pageConstraint = page.newSecurityConstraint();
pageConstraint.setUsers(Shared.makeListFromCSV("jetspeed"));
pageConstraint.setPermissions(Shared.makeListFromCSV("edit"));
inlinePageConstraints.add(pageConstraint);
pageConstraints.setSecurityConstraints(inlinePageConstraints);
List pageConstraintsRefs = new ArrayList(1);
pageConstraintsRefs.add("manager-edit");
pageConstraints.setSecurityConstraintsRefs(pageConstraintsRefs);
page.setSecurityConstraints(pageConstraints);
List pageMenus = new ArrayList();
newMenu = page.newMenuDefinition();
newMenu.setName("page-menu-1");
newMenu.setTitle("The Test Page Menu");
metadata = newMenu.getMetadata();
metadata.addField(Locale.FRENCH, "title", "[fr] The Test Page Menu");
newSeparator = page.newMenuSeparatorDefinition();
newSeparator.setText("-- Page Menu --");
List menuElements = new ArrayList();
menuElements.add(newSeparator);
newOptions0 = page.newMenuOptionsDefinition();
newOptions0.setOptions("/*.psml");
menuElements.add(newOptions0);
newNestedMenu = page.newMenuDefinition();
newNestedMenu.setOptions("/*/");
menuElements.add(newNestedMenu);
newExcludeMenu = page.newMenuExcludeDefinition();
newExcludeMenu.setName("exclude-menu");
menuElements.add(newExcludeMenu);
newIncludeMenu = page.newMenuIncludeDefinition();
newIncludeMenu.setName("include-menu");
menuElements.add(newIncludeMenu);
newMenu.setMenuElements(menuElements);