protected override FieldDefinition GetFieldDefinitionTemplate() { var def = new NoteFieldDefinition { NumberOfLines = Rnd.Int(20) + 1, RichText = Rnd.Bool(), UnlimitedLengthInDocumentLibrary = Rnd.Bool() }; return(def); }
//[SampleMetadataTag(Name = BuiltInTagNames.SampleHidden)] public void CanHideContentTypeFields() { var hiddenNotesField = new NoteFieldDefinition { Title = "Hidden Notes", InternalName = "m2_HiddenNotes", Group = "SPMeta2.Samples", Id = new Guid("13C47F4C-F3BA-431E-A76B-FCC03FED4E9B"), }; var publicNotesField = new NoteFieldDefinition { Title = "Publis Notes", InternalName = "m2_PublicNotes", Group = "SPMeta2.Samples", Id = new Guid("BACEE8AA-90B4-4268-8257-EEA0706942E4"), }; var hiddenNotesContentType = new ContentTypeDefinition { Name = "M2 Hidden Notes", Id = new Guid("1166D859-CC4B-4A5F-A1F3-28BE508C5A92"), ParentContentTypeId = BuiltInContentTypeId.Item, Group = "SPMeta2.Samples" }; var model = SPMeta2Model.NewSiteModel(site => { site .AddField(hiddenNotesField) .AddField(publicNotesField) .AddContentType(hiddenNotesContentType, contentType => { contentType .AddContentTypeFieldLink(hiddenNotesField) .AddContentTypeFieldLink(publicNotesField) .AddHideContentTypeFieldLinks(new HideContentTypeFieldLinksDefinition { Fields = new List <FieldLinkValue> { new FieldLinkValue { Id = BuiltInFieldId.Title }, new FieldLinkValue { Id = hiddenNotesField.Id } } }); }); }); DeployModel(model); }
public void Create() { projectStatusField = GetProjectStatusField(); startDateField = GetStartDateField(); teamField = GetTeamField(); departmentField = GetDepartmentField(); endDateField = GetEndDateField(); projectManagerField = GetProjectManagerField(); projectValueField = GetProjectValueField(); projectContemtType = GetProjectContemtType(); projectsList = GetProjectsList(); managedProjectsListView = GetManagedProjectsListView(); }
public static TModelNode AddNoteField <TModelNode>(this TModelNode model, NoteFieldDefinition definition, Action <NoteFieldModelNode> action) where TModelNode : ModelNode, IFieldHostModelNode, new() { return(model.AddTypedDefinitionNode(definition, action)); }
public static TModelNode AddNoteField <TModelNode>(this TModelNode model, NoteFieldDefinition definition) where TModelNode : ModelNode, IFieldHostModelNode, new() { return(AddNoteField(model, definition, null)); }
public static ModelNode AddNoteField(this ModelNode model, NoteFieldDefinition definition, Action <ModelNode> action) { return(model.AddDefinitionNode(definition, action)); }
public static ModelNode AddNoteField(this ModelNode model, NoteFieldDefinition definition) { return(AddNoteField(model, definition, null)); }