mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 17:25:32 +00:00
Added support for AppDefs; Updated currend XML
This commit is contained in:
@@ -48,6 +48,24 @@ public class LocationCollection : HaWeb.XMLParser.IXMLCollection {
|
||||
public HaWeb.XMLParser.IXMLCollection[]? SubCollections { get; } = null;
|
||||
public bool Searchable { get; } = false;
|
||||
|
||||
public static Func<XElement, string?> GetKey { get; } = (elem) => {
|
||||
var index = elem.Attribute("index");
|
||||
if (index != null && !String.IsNullOrWhiteSpace(index.Value))
|
||||
return index.Value;
|
||||
return null;
|
||||
};
|
||||
}
|
||||
|
||||
public class AppCollection : HaWeb.XMLParser.IXMLCollection {
|
||||
public string Key { get; } = "apps";
|
||||
public string[] xPath { get; } = new string[] { "/opus/data/definitions/appDefs/appDef", "/opus/definitions/appDefs/appDef" };
|
||||
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; } = false;
|
||||
|
||||
public static Func<XElement, string?> GetKey { get; } = (elem) => {
|
||||
var index = elem.Attribute("index");
|
||||
if (index != null && !String.IsNullOrWhiteSpace(index.Value))
|
||||
|
||||
@@ -9,7 +9,7 @@ public class ReferencesRoot : HaWeb.XMLParser.IXMLRoot {
|
||||
public string[] XPathContainer { get; } = { ".//data/definitions", ".//definitions" };
|
||||
|
||||
public Predicate<XElement> IsCollectedObject { get; } = (elem) => {
|
||||
if (elem.Name == "personDefs" || elem.Name == "structureDefs" || elem.Name == "handDefs" || elem.Name == "locationDefs")
|
||||
if (elem.Name == "personDefs" || elem.Name == "structureDefs" || elem.Name == "handDefs" || elem.Name == "locationDefs" || elem.Name == "appDefs")
|
||||
return true;
|
||||
return false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user