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; }
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; }
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; }
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; }