Commit 5724b10d authored by Moritz Schepp's avatar Moritz Schepp
Browse files

see #275 and #277

parent ba0d0d7a
......@@ -163,8 +163,9 @@ declare function local:page-numbers() {
for $pb in $doc//tei:pb
let $view := xs:integer($pb/@n)
let $fws := local:addFollowingFws($pb)[position() > 1]
let $noCorrFws := functx:remove-elements-deep($fws, 'corr')
let $noExpanFws := functx:remove-elements-deep($noCorrFws, 'expan')
let $noCorrFws := functx:remove-elements-deep($fws, 'tei:corr')
let $noExpanFws := functx:remove-elements-deep($noCorrFws, 'tei:expan')
(: let $x := util:log-system-out(' '):)
(: let $a := util:log-system-out($pb):)
(: let $y := util:log-system-out($noExpanFws):)
......
......@@ -147,6 +147,42 @@ declare function local:countFW($length,$body) {
return string-join($fwNumbers,',')
};
declare function transformXML:cacheFullXmlAndMetadata($tgURI as xs:string) {
let $doc-name := $tgURI || '.xml'
let $tglab-base-uri := 'https://textgridlab.org/1.0/tgcrud-public/rest/textgrid:'
let $target-base-path := '/db/apps/sade-architrave/textgrid/'
let $doc := doc($tglab-base-uri || $tgURI || '/data')
let $doc-meta := doc($tglab-base-uri || $tgURI || '/metadata')
let $store-result := xmldb:store($target-base-path || '/data', $tgURI || '.xml', $doc, "text/xml")
let $store-meta-result := xmldb:store($target-base-path || '/meta', $tgURI || '.xml', $doc-meta, "text/xml")
return true()
};
declare function transformXML:cacheAllEditions() {
let $result := (
(: de :)
transformXML:cacheFullXmlAndMetadata('34zmq'), (: harrach :)
transformXML:cacheFullXmlAndMetadata('34zs7'), (: sturm :)
transformXML:cacheFullXmlAndMetadata('3ptwg'), (: corfey :)
transformXML:cacheFullXmlAndMetadata('3qr4f'), (: neumann :)
transformXML:cacheFullXmlAndMetadata('34znb'), (: pitzler :)
transformXML:cacheFullXmlAndMetadata('3c0m2'), (: knesebeck :)
(: fr :)
transformXML:cacheFullXmlAndMetadata('3czfj'), (: harrach :)
transformXML:cacheFullXmlAndMetadata('3q4rq'), (: sturm :)
transformXML:cacheFullXmlAndMetadata('3r0fv'), (: corfey :)
transformXML:cacheFullXmlAndMetadata('3r3nn'), (: neumann :)
transformXML:cacheFullXmlAndMetadata('350mg'), (: pitzler :)
transformXML:cacheFullXmlAndMetadata('3czn9') (: knesebeck :)
)
return $result
};
declare function transformXML:importFromTGRep($tgURI as xs:string, $filenameOutput as xs:string) {
let $login := xmldb:login("/db", "admin", "" )
let $pathInput := 'https://textgridlab.org/1.0/tgcrud-public/rest/textgrid:'
......
......@@ -104,6 +104,7 @@ let $use-template :=
else true()
let $data-xconf := $target || "/textgrid/data/collection.xconf"
let $store-xconf := xmldb:store("/db/system/config" || $target || "/textgrid/data", "collection.xconf", doc( $data-xconf ))
let $cache := transformXML:cacheAllEditions()
let $reindex := xmldb:reindex($target || "/textgrid/data")
(: import XML files from TGRep and transform them into HTML :)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment