mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 09:15:33 +00:00
Added collection classes. Will not do extra collection for subcomments rn.
This commit is contained in:
@@ -7,31 +7,12 @@ public class TraditionsRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
public string Type { get; } = "Überlieferung";
|
||||
public string Prefix { get; } = "ueberlieferung";
|
||||
public string[] XPathContainer { get; } = { ".//data/traditions", ".//traditions" };
|
||||
public (
|
||||
string Key,
|
||||
string xPath,
|
||||
Func<XElement, string?> GenerateKey,
|
||||
Func<XElement, Dictionary<string, string[]>?>? GenerateDataFields,
|
||||
Func<List<CollectedItem>, Dictionary<string, Lookup<string, CollectedItem>>?>? GroupingsGeneration,
|
||||
Func<List<CollectedItem>, Dictionary<string, List<CollectedItem>>?>? SortingsGeneration,
|
||||
bool Searchable
|
||||
)[]? Collections { get; } = {
|
||||
("tradition", "/opus/data/traditions/letterTradition", GetKey, null, null, null, true),
|
||||
("tradition", "/opus/traditions/letterTradition", GetKey, null, null, null, true)
|
||||
};
|
||||
|
||||
|
||||
public Predicate<XElement> IsCollectedObject { get; } = (elem) => {
|
||||
if (elem.Name == "letterTradition") return true;
|
||||
else return false;
|
||||
};
|
||||
|
||||
public static Func<XElement, string?> GetKey { get; } = (elem) => {
|
||||
var index = elem.Attribute("ref");
|
||||
if (index != null && !String.IsNullOrWhiteSpace(index.Value))
|
||||
return index.Value;
|
||||
return null;
|
||||
};
|
||||
|
||||
public List<(string, string?)>? GenerateFields(XMLRootDocument document) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user