Esempio n. 1
0
 public PageTemplateEntity createPageTemplate(
     String name, PageTemplateType type, String siteName, ResourceKey stylekey) {
   PageTemplateEntity pageTemplate = new PageTemplateEntity();
   pageTemplate.setKey(mockKeyService.generateNextKeySafe("TPAGETEMPLATE"));
   pageTemplate.setName(name);
   pageTemplate.setTimestamp(new Date());
   pageTemplate.setType(type);
   pageTemplate.setSite(fixture.findSiteByName(siteName));
   pageTemplate.setRunAs(RunAsType.DEFAULT_USER);
   pageTemplate.setStyleKey(stylekey);
   return pageTemplate;
 }
Esempio n. 2
0
 public MenuItemEntity createPageMenuItem(
     String name,
     Integer order,
     String menuName,
     String displayName,
     String site,
     String owner,
     String modifier,
     boolean hasSection,
     Boolean isOrderedSection,
     String language,
     String parentName,
     Integer parentOrder,
     Date timestamp,
     boolean isHidden,
     Document xmlData) {
   MenuItemEntity menuItem = new MenuItemEntity();
   menuItem.setKey(new MenuItemKey(mockKeyService.generateNextKeySafe("TMENUITEM")));
   menuItem.setName(name);
   menuItem.setOrder(order);
   menuItem.setMenuName(menuName);
   menuItem.setDisplayName(displayName);
   menuItem.setSite(fixture.findSiteByName(site));
   menuItem.setOwner(fixture.findUserByName(owner));
   menuItem.setModifier(fixture.findUserByName(modifier));
   menuItem.setType(MenuItemType.PAGE);
   menuItem.setSection(hasSection);
   menuItem.setOrderedSection(isOrderedSection);
   menuItem.setLanguage(fixture.findLanguageByCode(language));
   if (parentName != null) {
     menuItem.setParent(fixture.findMenuItemByName(parentName));
   }
   menuItem.setTimestamp(timestamp == null ? new Date() : timestamp);
   menuItem.setHidden(isHidden);
   menuItem.setXmlData(xmlData);
   return menuItem;
 }