This commit is contained in:
Simon Martens
2025-03-05 16:41:39 +01:00
commit e19fd47c17
88 changed files with 9765 additions and 0 deletions

19
xmlmodels/common.go Normal file
View File

@@ -0,0 +1,19 @@
package xmlmodels
import xmlparsing "github.com/Theodor-Springmann-Stiftung/lenz-web/xml"
type RefElement struct {
Reference int `xml:"ref,attr"`
Text string `xml:",chardata"`
Cert string `xml:"cert,attr"`
}
type Date struct {
When xmlparsing.XSDDate `xml:"when,attr"`
NotBefore xmlparsing.XSDDate `xml:"notBefore,attr"`
NotAfter xmlparsing.XSDDate `xml:"notAfter,attr"`
From xmlparsing.XSDDate `xml:"from,attr"`
To xmlparsing.XSDDate `xml:"to,attr"`
Cert string `xml:"cert,attr"`
Text string `xml:",chardata"`
}

12
xmlmodels/data.go Normal file
View File

@@ -0,0 +1,12 @@
package xmlmodels
const (
AGENTREF = "AgentRef"
PERSONREF = "PersonRef"
LOCATIONREF = "LocationRef"
APPREF = "AppRef"
META = "Meta"
LETTER = "Letter"
TRADITION = "Tradition"
)

16
xmlmodels/letter.go Normal file
View File

@@ -0,0 +1,16 @@
package xmlmodels
import "encoding/xml"
type Letter struct {
XMLName xml.Name `xml:"letterText"`
Letter int `xml:"letter,attr"`
Pages []Page `xml:"page"`
Hands []RefElement `xml:"hand"`
Content string `xml:",innerxml"`
}
type Page struct {
XMLName xml.Name `xml:"page"`
Index int `xml:"index,attr"`
}

23
xmlmodels/meta.go Normal file
View File

@@ -0,0 +1,23 @@
package xmlmodels
import (
"encoding/xml"
xmlparsing "github.com/Theodor-Springmann-Stiftung/lenz-web/xml"
)
type Meta struct {
XMLName xml.Name `xml:"letterDesc"`
Letter int `xml:"letter,attr"`
HasOriginal xmlparsing.OptionalBool `xml:"hasOriginal"`
IsProofread xmlparsing.OptionalBool `xml:"isProofread"`
IsDraft xmlparsing.OptionalBool `xml:"isDraft"`
Sent []Action `xml:"sent"`
Recieved []Action `xml:"recieved"`
}
type Action struct {
Dates []Date `xml:"date,attr"`
Places []RefElement `xml:"place"`
Persons []RefElement `xml:"person"`
}

22
xmlmodels/references.go Normal file
View File

@@ -0,0 +1,22 @@
package xmlmodels
type PersonDef struct {
Index int `xml:"index,attr"`
Name string `xml:"name,attr"`
Ref string `xml:"ref,attr"`
FirstName string `xml:"vorname,attr"`
LastName string `xml:"nachname,attr"`
Comment string `xml:"komm,attr"`
}
type LocationDef struct {
Index int `xml:"index,attr"`
Name string `xml:"name,attr"`
Ref string `xml:"ref,attr"`
}
type AppDef struct {
Index int `xml:"index,attr"`
Name string `xml:"name,attr"`
Category string `xml:"category,attr"`
}

41
xmlmodels/roots.go Normal file
View File

@@ -0,0 +1,41 @@
package xmlmodels
import "encoding/xml"
type MetaRoot struct {
XMLName xml.Name `xml:"opus"`
Metas []Meta `xml:"letterDesc"`
}
func (m MetaRoot) Children() []Meta {
return m.Metas
}
type DefinitionsRoot struct {
XMLName xml.Name `xml:"definitions"`
Persons PersonDefs `xml:"personDefs"`
Locations LocationDefs `xml:"locationDefs"`
Apparatuses AppDefs `xml:"appDefs"`
}
type PersonDefs struct {
Persons []PersonDef `xml:"personDef"`
}
type LocationDefs struct {
Locations []LocationDef `xml:"locationDef"`
}
type AppDefs struct {
Apps []AppDef `xml:"appDef"`
}
type TraditionsRoot struct {
XMLName xml.Name `xml:"traditions"`
Traditions []Tradition `xml:"tradition"`
}
type DocumentsRoot struct {
XMLName xml.Name `xml:"document"`
Documents []Letter `xml:"letterText"`
}

14
xmlmodels/traditions.go Normal file
View File

@@ -0,0 +1,14 @@
package xmlmodels
import "encoding/xml"
type Tradition struct {
XMLName xml.Name `xml:"letterTradition"`
Letter int `xml:"letter,attr"`
Apps []App `xml:"app"`
}
type App struct {
Reference int `xml:"ref,attr"`
Content string `xml:",innerxml"`
}