mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-28 16:55:32 +00:00
25 lines
1.2 KiB
C#
25 lines
1.2 KiB
C#
using System.Xml.Linq;
|
|
using HaWeb.Models;
|
|
|
|
public class EditCollection : HaWeb.XMLParser.IXMLCollection {
|
|
public string Key { get; } = "edits";
|
|
public string[] xPath { get; } = new string[] {
|
|
"/opus/data/document/letterText//edit",
|
|
"/opus/document/letterText//edit",
|
|
"/opus/data/traditions/letterTradition//edit",
|
|
"/opus/traditions/letterTradition//edit"
|
|
};
|
|
public Func<XElement, string?> GenerateKey { get; } = GetKey;
|
|
public Func<XElement, IDictionary<string, string>?>? GenerateDataFields { get; } = null;
|
|
public Func<IEnumerable<CollectedItem>, IDictionary<string, ILookup<string, CollectedItem>>?>? GroupingsGeneration { get; } = null;
|
|
public Func<IEnumerable<CollectedItem>, IDictionary<string, IEnumerable<CollectedItem>>?>? SortingsGeneration { get; } = null;
|
|
public HaWeb.XMLParser.IXMLCollection[]? SubCollections { get; } = null;
|
|
public bool Searchable { get; } = true;
|
|
|
|
public static Func<XElement, string?> GetKey { get; } = (elem) => {
|
|
var index = elem.Attribute("ref");
|
|
if (index != null && !String.IsNullOrWhiteSpace(index.Value))
|
|
return index.Value;
|
|
else return null;
|
|
};
|
|
} |