Commit b5e14e84 authored by Mathias Goebel's avatar Mathias Goebel 🎠
Browse files

remove console; cleanup

parent e28a037b
......@@ -3,7 +3,6 @@ xquery version "3.1";
import module namespace config="http://textgrid.de/ns/SADE/config" at "modules/config/config.xqm";
import module namespace digilib="http://textgrid.info/namespaces/xquery/digilib" at "../textgrid-connect/digilibProxy.xqm";
import module namespace fontaneTransfo="http://fontane-nb.dariah.eu/Transfo" at "modules/fontane/transform.xqm";
import module namespace console="http://exist-db.org/xquery/console";
declare namespace xhtml="http://www.w3.org/1999/xhtml";
......
......@@ -6,7 +6,6 @@ xquery version "3.1";
:)
module namespace config="http://textgrid.de/ns/SADE/config";
import module namespace console="http://exist-db.org/xquery/console" at "java:org.exist.console.xquery.ConsoleModule";
import module namespace config-params="http://exist-db.org/xquery/apps/config-params" at "config.xql";
declare namespace templates="http://exist-db.org/xquery/templates";
......
......@@ -3,7 +3,6 @@ module namespace fsearch = "http://sade/faceted-search" ;
import module namespace kwic="http://exist-db.org/xquery/kwic";
import module namespace config="http://textgrid.de/ns/SADE/config" at "../config/config.xqm";
import module namespace console="http://exist-db.org/xquery/console";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace bol="http://blumenbach-online.de/blumenbachiana";
......@@ -163,8 +162,6 @@ function fsearch:result-id($node as node(), $model as map(*)) {
};
declare function fsearch:facets($model as map(*), $hits) as map() {
let $test := console:log( $config:configDoc )
return
map:new(
for $facet in $config:configDoc//module[@key="faceted-search"]//facet
return
......
......@@ -9,7 +9,6 @@ module namespace f-indexviewer="http://fontane-nb.dariah.eu/indexviewer";
import module namespace f-indexproc="http://fontane-nb.dariah.eu/indexproc" at "index-processor.xqm";
import module namespace config="http://textgrid.de/ns/SADE/config" at "../config/config.xqm";
import module namespace console="http://exist-db.org/xquery/console";
declare namespace ore="http://www.openarchives.org/ore/terms/";
declare namespace rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
......
......@@ -6,9 +6,6 @@ declare namespace xhtml="http://www.w3.org/1999/xhtml";
declare default element namespace "http://www.tei-c.org/ns/1.0";
import module namespace console="http://exist-db.org/xquery/console";
declare function fontaneLitVZ:litvz(){
let $id := request:get-parameter('id', '')
let $doc := doc('/db/sade-projects/textgrid/data/xml/data/25547.xml')
......@@ -50,7 +47,7 @@ return
<ul>
<li>{$b/choice/expan/text()}</li>
{if($b//idno)
then let $test := console:log( $b ) return
then
<li>{string($b/idno/@type)}: {$b/idno/text()||' '}
<a target="_blank" href="{$b/idno/@xml:base||$b/idno/text()}"><i class="fa fa-external-link"></i></a></li> else ()}
{if($b/ptr) then <li>{switch(string($b/ptr/@type)) case 'fulltext' return 'Volltext ' default return string($b/ptr/@type)} <a target="_blank" href="{$b/ptr/@target}"><i class="fa fa-external-link"></i></a></li> else ()}
......
......@@ -2,7 +2,6 @@ xquery version "3.1";
module namespace f-misc="http://fontane-nb.dariah.eu/ns/SADE/misc";
import module namespace config="http://textgrid.de/ns/SADE/config" at "../config/config.xqm";
import module namespace console="http://exist-db.org/xquery/console";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace test="http://exist-db.org/xquery/xqsuite";
......
xquery version "3.1";
module namespace fontaneSfEx="http://fontane-nb.dariah.eu/SfEx";
import module namespace console="http://exist-db.org/xquery/console";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare function fontaneSfEx:extract ($tei as node(), $page as xs:string){
<TEI xmlns="http://www.tei-c.org/ns/1.0" xml:lang="de">
{
$tei/tei:teiHeader
}
<sourceDoc>
{$tei/tei:sourceDoc/@*}
{let $page := $tei/tei:sourceDoc/tei:surface[@n=$page]
return
element tei:handShift {
attribute
script {
let $this := string( $tei/tei:sourceDoc/tei:surface[@n=$page]/preceding::handShift[@script][1]/@script )
return
if (contains($this, ' '))
then
$this
else
if($this = ('standard', 'clean', 'hasty', 'angular'))
then $page/preceding::handShift[contains(@script, 'Latn') or contains(@script, 'Latf')][1]/tokenize(@script, ' ')[. = ('Latn', 'Latf')] || ' ' || $this
else
if ($this = ('Latn', 'Latf'))
then $page/preceding::handShift[
contains(@script, 'standard') or
contains(@script, 'clean') or
contains(@script, 'hasty') or
contains(@script, 'angular')
][1]/tokenize(@script, ' ')[. = ('standard', 'clean', 'hasty', 'angular')] || ' ' || $this
else ''
},
attribute new {$page/preceding::tei:handShift[@new][1]/@new},
attribute medium {$page/preceding::tei:handShift[@medium][1]/@medium},
attribute rendition {$page/preceding::tei:handShift[@rendition][1]/@rendition}
}
}
{$tei/tei:sourceDoc//tei:surface[@n=$page]
(: ,:)
(: if($page = "inner_front_cover"):)
(: then console:log($tei/tei:sourceDoc//tei:surface[@n=$page]):)
(: else ():)
}
</sourceDoc>
</TEI>
};
\ No newline at end of file
......@@ -12,7 +12,6 @@ declare namespace xlink="http://www.w3.org/1999/xlink";
declare namespace tgmd="http://textgrid.info/namespaces/metadata/core/2010";
import module namespace code="http://bdn-edition.de/ns/code-view";
import module namespace console="http://exist-db.org/xquery/console";
import module namespace config="http://textgrid.de/ns/SADE/config" at "../config/config.xqm";
declare variable $fontaneTransfo:tooltipReplacementPattern := '\s$|,$|\.|\($|\)$|;|&#x2003;';
......@@ -1132,7 +1131,6 @@ $offset := switch($type)
else if (matches($n, '\d[a-z]*r|Ir$') and not(matches($n, "\dv[a-z]r"))) then (
number($plusX * ($dpcm div $image-width) + ($surfaceWidth div 10) * ($dpcm div $image-width)) * 100,
($plusY * $dpcm div $image-height) * 100)
(: ||console:log($plusX):)
else if(matches($n, '\d[a-z]*v|Iv$') or matches($n, "\dv[a-z]r")) then (
($plusX * $dpcm div $image-width) * 100,
($plusY * $dpcm div $image-height) * 100 )
......@@ -1239,16 +1237,13 @@ let $lineHeight := fontaneTransfo:lineHeight( ($node/ancestor::tei:zone)[1] ),
$caret := switch($caretType)
case 'caret:V'
return
let (: $test := console:log($node/string(@rend)) , :)
let
$parameter := substring-before( substring-after( $node/string(@rend), '('), ')'),
(: $test := console:log($parameter) , :)
$parameter := tokenize(replace($parameter, 'cm', ''), ','),
(: $test := console:log($parameter) , :)
$l := number($parameter[1]) * 100,
$r := number($parameter[2]) * 100,
$height := '100',
$viewbox := '0 0 '||string($l+ $r)||' '||$height,
(: $test := console:log($viewbox ) , :)
$style := $node/string(@style),
(: Unabhängig von margin-left in style, muss bei einem V der margin-left wert gleich dem 1. Wert aus der Funktion sein. :)
$style := $style || ';margin-left:-'||$parameter[1]||'cm;'
......
......@@ -13,7 +13,6 @@ import module namespace config="http://textgrid.de/ns/SADE/config" at "../config
import module namespace code="http://bdn-edition.de/ns/code-view";
import module namespace dsk-view="http://semtonotes.github.io/SemToNotes/dsk-view" at '../semtonotes/SemToNotes.xqm';
import module namespace fontaneTransfo="http://fontane-nb.dariah.eu/Transfo" at '../fontane/transform.xqm';
import module namespace fontaneSfEx="http://fontane-nb.dariah.eu/SfEx" at '../fontane/surfaceExtract.xqm';
import module namespace fontaneLitVZ="http://fontane-nb.dariah.eu/LitVZ" at "../fontane/literaturverzeichnis.xqm";
import module namespace fontaneUeberblickskommentar="http://fontane-nb.dariah.eu/Ueberblickskommentar" at "../fontane/ueberblickskommentar.xqm";
import module namespace tgclient="http://textgrid.info/namespaces/xquery/tgclient" at "/db/apps/textgrid-connect/tgclient.xqm";
......@@ -113,43 +112,12 @@ let
$page := if(request:get-parameter-names() = 'page') then if(request:get-parameter('page', '') = '') then 'outer_front_cover' else request:get-parameter('page', '') else '',
$html :=
if ( (request:get-parameter('test', '') = '1') and ($page = '') )
then (: test if we can use a cached html :)
let $datacol := substring-before($docpath, '/xml/data/') || '/xml'
let $dbDocName := substring-after($docpath, 'xml/data/')
let $dbDocNameXhtml := replace($dbDocName, 'xml', 'xhtml')
let $metadata := xs:dateTime($meta//tgmd:lastModified)
let $lastChangeXhtml :=
if ( doc-available($datacol||'/xhtml/' || $dbDocNameXhtml) )
then( xmldb:last-modified('/db/sade-projects/textgrid/data/xml/xhtml', $dbDocNameXhtml) )
else( xs:dateTime('2005-09-28T21:38:18.089+02:00') )
let $lastChangeProcessing := xmldb:last-modified('/db/apps/SADE/modules/multiviewer','fontane.xqm')
return
if($metadata gt $lastChangeXhtml or $lastChangeProcessing gt $lastChangeXhtml)
then (let $transfo := fontaneTransfo:magic($EXtei)
let $store := (
xmldb:login(substring-before($docpath, '/xml/data/') || '/xml/xhtml', config:get('sade.user'), config:get('sade.password')),
xmldb:store( substring-before($docpath, '/xml/data/') || '/xml/xhtml' , $dbDocNameXhtml, <xhtml:body>{$transfo}</xhtml:body>)
(: ,:)
(: session:invalidate():)
)
return $transfo
)
else doc('/db/sade-projects/textgrid/data/xml/xhtml/'||$dbDocNameXhtml)//xhtml:body/*
else
if ( (request:get-parameter('test', '') = '1') and ($page != '') )
then
let $extract := fontaneSfEx:extract( $EXtei, $page )
let $rendered := fontaneTransfo:magic($extract)
return $rendered
else if(request:get-parameter-names() != 'test') then
if($EXuri = xmldb:get-child-collections('/db/sade-projects/textgrid/data/xml/xhtml')) then
let $path := '/db/sade-projects/textgrid/data/xml/xhtml/' || $EXuri || '/' || $page || '.xml'
return
doc($path)/xhtml:body/*
else <xhtml:div>The requested document is not available.</xhtml:div>
else mviewer:choose-xsl-and-transform($doc, $model)
let $toc:= fontaneTransfo:toc($EXtei)
......
......@@ -7,7 +7,6 @@ xquery version "3.1";
import module namespace templates="http://exist-db.org/xquery/templates" ;
import module namespace mviewer="http://sade/multiviewer" at "multiviewer/multiviewer.xqm" ;
import module namespace console="http://exist-db.org/xquery/console" at "java:org.exist.console.xquery.ConsoleModule";
import module namespace f-misc="http://fontane-nb.dariah.eu/ns/SADE/misc" at "fontane/misc.xqm";
import module namespace f-indexviewer="http://fontane-nb.dariah.eu/indexviewer" at "fontane/index-viewer.xqm";
import module namespace f-render="http://fontane-nb.dariah.eu/ns/SADE/render" at "fontane/render.xqm";
......
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