Beispiel #1
0
 public UnitEntity createUnit(String name, String languageCode) {
   UnitEntity unit = new UnitEntity();
   unit.setKey(new UnitKey(mockKeyService.generateNextKeySafe("TUNIT")));
   unit.setName(name);
   unit.setLanguage(fixture.findLanguageByCode(languageCode));
   unit.setDeleted(false);
   return unit;
 }
Beispiel #2
0
 public SiteEntity createSite(String name, Date timestamp, Document xmlData, String language) {
   SiteEntity site = new SiteEntity();
   site.setKey(mockKeyService.generateNextKeySafe("TMENU"));
   site.setName(name);
   site.setTimestamp(timestamp);
   site.setXmlData(xmlData);
   site.setLanguage(fixture.findLanguageByCode(language));
   return site;
 }
Beispiel #3
0
 public ContentEntity createContent(
     String contentName,
     String categoryName,
     String languageCode,
     String ownerQualifiedName,
     String priority,
     Date created) {
   ContentEntity content = new ContentEntity();
   content.setLanguage(fixture.findLanguageByCode(languageCode));
   content.setCategory(fixture.findCategoryByName(categoryName));
   content.setOwner(fixture.findUserByName(ownerQualifiedName));
   content.setPriority(Integer.valueOf(priority));
   content.setCreatedAt(created); // Not-null field in database.
   content.setDeleted(false); // Not-null field in database.
   content.setName(contentName);
   return content;
 }
Beispiel #4
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;
 }