mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-10-29 01:05:32 +00:00
Init
This commit is contained in:
19
xmlmodels/common.go
Normal file
19
xmlmodels/common.go
Normal 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
12
xmlmodels/data.go
Normal 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
16
xmlmodels/letter.go
Normal 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
23
xmlmodels/meta.go
Normal 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
22
xmlmodels/references.go
Normal 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
41
xmlmodels/roots.go
Normal 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
14
xmlmodels/traditions.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user