namespace HaWeb.Settings.XMLCollections; using HaWeb.Models; using System.Xml.Linq; public class MetaCollection : HaWeb.XMLParser.IXMLCollection { public string Key { get; } = "metas"; public string[] xPath { get; } = new string[] { "/opus/descriptions/letterDesc", "/opus/data/descriptions/letterDesc" }; public Func GenerateKey { get; } = GetKey; public Func?>? GenerateDataFields { get; } = null; public Func, IDictionary>?>? GroupingsGeneration { get; } = null; public Func, IDictionary>?>? SortingsGeneration { get; } = null; public HaWeb.XMLParser.IXMLCollection[]? SubCollections { get; } = null; public bool Searchable { get; } = false; public static Func GetKey { get; } = (elem) => { var index = elem.Attribute("ref"); if (index != null && !String.IsNullOrWhiteSpace(index.Value)) return index.Value; return null; }; public static IDictionary? GetDataFields(XElement element) { var res = new Dictionary(); // TODO return res; } public static IDictionary>? GetLookups(IEnumerable items) { var res = new Dictionary>(); // TODO return res; } }