mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 09:15:33 +00:00
A lot of stuff related to parsing; index page input validation
This commit is contained in:
21
HaWeb/Settings/XMLCollections/EditreasonCollection.cs
Normal file
21
HaWeb/Settings/XMLCollections/EditreasonCollection.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace HaWeb.Settings.XMLCollections;
|
||||
using HaWeb.Models;
|
||||
using System.Xml.Linq;
|
||||
|
||||
public class EditreasonCollection : HaWeb.XMLParser.IXMLCollection {
|
||||
public string Key { get; } = "editreasons";
|
||||
public string[] xPath { get; } = new string[] { "/opus/edits/editreason", "/opus/data/edits/editreason" };
|
||||
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("index");
|
||||
if (index != null && !String.IsNullOrWhiteSpace(index.Value))
|
||||
return index.Value;
|
||||
else return null;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user