public IEnumerable <EditorDataItem> GetEditorDataItems([FromUri] int contextId, [FromUri] string propertyAlias, [FromBody] dynamic data) { EnumDataSource enumDataSource = ((JObject)data.config.dataSource).ToObject <EnumDataSource>(); IEnumerable <EditorDataItem> editorDataItems = enumDataSource.GetEditorDataItems(); CustomLabel customLabel = new CustomLabel((string)data.config.customLabel, contextId, propertyAlias); return(customLabel.ProcessEditorDataItems(editorDataItems)); }
public IEnumerable <EditorDataItem> GetEditorDataItems([FromUri] int contextId, [FromUri] string propertyAlias, [FromBody] dynamic data) { XmlDataSource xmlDataSource = ((JObject)data.config.dataSource).ToObject <XmlDataSource>(); IEnumerable <EditorDataItem> editorDataItems = xmlDataSource.GetEditorDataItems(contextId); CustomLabel customLabel = new CustomLabel((string)data.config.customLabel, contextId, propertyAlias); TypeaheadListPicker typeaheadListPicker = new TypeaheadListPicker((string)data.typeahead); // process the labels and then handle any type ahead text return(typeaheadListPicker.ProcessEditorDataItems(customLabel.ProcessEditorDataItems(editorDataItems))); }
public IEnumerable <EditorDataItem> GetEditorDataItems([FromUri] int contextId, [FromUri] int parentId, [FromUri] string propertyAlias, [FromBody] dynamic data) { IEnumerable <EditorDataItem> editorDataItems = RelationType.GetByAlias((string)data.config.dataSource.relationType) .GetRelations(contextId) .Select(x => new EditorDataItem() { Key = x.Child.Id.ToString(), Label = x.Child.Text }) .ToList(); CustomLabel customLabel = new CustomLabel((string)data.config.customLabel, contextId, propertyAlias); return(customLabel.ProcessEditorDataItems(editorDataItems)); }
public IEnumerable <EditorDataItem> GetEditorDataItems([FromUri] int currentId, [FromUri] int parentId, [FromUri] string propertyAlias, [FromBody] dynamic data) { int contextId = currentId; var relationService = this.ApplicationContext.Services.RelationService; IEnumerable <EditorDataItem> editorDataItems = relationService.GetEntitiesFromRelations( relationService.GetByRelationTypeAlias((string)data.config.dataSource.relationType) .Where(r => r.ParentId == contextId)) .Select(x => new EditorDataItem() { Key = x.Item2.Id.ToString(), Label = x.Item2.Name.ToString() }) .ToList(); CustomLabel customLabel = new CustomLabel((string)data.config.customLabel, contextId, propertyAlias); return(customLabel.ProcessEditorDataItems(editorDataItems)); }
public IEnumerable<EditorDataItem> GetEditorDataItems([FromUri] int currentId, [FromUri] int parentId, [FromUri] string propertyAlias, [FromBody] dynamic data) { int contextId = currentId; var relationService = this.ApplicationContext.Services.RelationService; IEnumerable<EditorDataItem> editorDataItems = relationService.GetEntitiesFromRelations( relationService.GetByRelationTypeAlias((string)data.config.dataSource.relationType) .Where(r => r.ParentId == contextId)) .Select(x => new EditorDataItem() { Key = x.Item2.Id.ToString(), Label = x.Item2.Name.ToString() }) .ToList(); CustomLabel customLabel = new CustomLabel((string)data.config.customLabel, contextId, propertyAlias); return customLabel.ProcessEditorDataItems(editorDataItems); }
public IEnumerable <EditorDataItem> GetEditorDataItems([FromUri] int contextId, [FromUri] int parentId, [FromUri] string propertyAlias, [FromBody] dynamic data) { DotNetDataSource dotNetDataSource = ((JObject)data.config.dataSource).ToObject <DotNetDataSource>(); dotNetDataSource.Typeahead = (string)data.typeahead; IEnumerable <EditorDataItem> editorDataItems = dotNetDataSource.GetEditorDataItems(contextId, parentId).ToList(); CustomLabel customLabel = new CustomLabel((string)data.config.customLabel, contextId, propertyAlias); editorDataItems = customLabel.ProcessEditorDataItems(editorDataItems); // if the typeahead wasn't handled by the custom data-source, then fallback to default typeahead processing if (!dotNetDataSource.HandledTypeahead) { TypeaheadListPicker typeaheadListPicker = new TypeaheadListPicker((string)data.typeahead); editorDataItems = typeaheadListPicker.ProcessEditorDataItems(editorDataItems); } return(editorDataItems); }