private void SetupContentTest(IHiveManager hive) { AttributeTypeRegistry.SetCurrent(new CmsAttributeTypeRegistry()); // Ensure parent schema and content root exists for this test var contentVirtualRoot = FixedEntities.ContentVirtualRoot; var systemRoot = new SystemRoot(); var contentRootSchema = new ContentRootSchema(); hive.AutoCommitTo <IContentStore>( x => { x.Repositories.AddOrUpdate(systemRoot); x.Repositories.AddOrUpdate(contentVirtualRoot); x.Repositories.Schemas.AddOrUpdate(contentRootSchema); }); }
public void CreateContentType() { AttributeTypeRegistry.SetCurrent(new CmsAttributeTypeRegistry()); // Ensure parent exists for this test Hive.AutoCommitTo <IContentStore>(x => x.Repositories.Schemas.AddOrUpdate(new ContentRootSchema())); var doctype = Hive.Cms().NewContentType <EntitySchema, IContentStore>("newsItem") .Define("title", type => type.UseExistingType("singleLineTextBox"), FixedGroupDefinitions.GeneralGroup) .Commit(); if (doctype.Errors.Any()) { Assert.Fail(doctype.Errors.FirstOrDefault().ToString()); } Assert.True(doctype.Success); Assert.NotNull(doctype.Item); ClearCaches(); var schemaReloaded = HighLevelApiFixture.AssertSchemaPartExists <EntitySchema, IContentStore>(Hive, doctype.Item.Id); }
private void SetupContentTest(IHiveManager hive) { AttributeTypeRegistry.SetCurrent(new CmsAttributeTypeRegistry()); // Ensure parent schema and content root exists for this test var contentVirtualRoot = FixedEntities.ContentVirtualRoot; var systemRoot = new SystemRoot(); var contentRootSchema = new ContentRootSchema(); hive.AutoCommitTo<IContentStore>( x => { x.Repositories.AddOrUpdate(systemRoot); x.Repositories.AddOrUpdate(contentVirtualRoot); x.Repositories.Schemas.AddOrUpdate(contentRootSchema); }); }