diff software/eXist/webapp/mpdl/page-query-result.xql @ 11:d6f528ad5d96

TEI Unterst?tzung, Fehlerbehebungen, externe Objekte
author Josef Willenborg <jwillenborg@mpiwg-berlin.mpg.de>
date Fri, 11 Mar 2011 13:34:02 +0100
parents 1ec29fdd0db8
children 469d927b9ca7
line wrap: on
line diff
--- a/software/eXist/webapp/mpdl/page-query-result.xql	Fri Mar 11 13:33:26 2011 +0100
+++ b/software/eXist/webapp/mpdl/page-query-result.xql	Fri Mar 11 13:34:02 2011 +0100
@@ -13,6 +13,7 @@
 declare namespace dcterms="http://purl.org/dc/terms";
 declare namespace xhtml="http://www.w3.org/1999/xhtml";
 declare namespace echo="http://www.mpiwg-berlin.mpg.de/ns/echo/1.0/";
+declare namespace TEI="http://www.tei-c.org/ns/1.0";
 
 let $mpdlDocUri := request:get-parameter("document", "")
 let $queryType := request:get-parameter("query-type", "")
@@ -54,6 +55,8 @@
   then $document/archimedes/info
   else if ($docbase = 'echo')
   then $document/echo:echo/echo:metadata
+  else if ($docbase = 'tei')
+  then $document/TEI:TEI/TEI:teiHeader
   else ''
 
 let $pageBreaks := 
@@ -61,6 +64,8 @@
   then $document//pb
   else if ($docbase = 'echo')
   then $document//echo:pb
+  else if ($docbase = 'tei')
+  then $document//TEI:pb
   else $document//pb
 let $countPagesTemp := count($pageBreaks)
 let $countPages := 
@@ -69,7 +74,7 @@
   else 1
 
 (: xQuery inline execution does not work in module so it has to be done here  :) 
-let $xQueryPageSize := 100
+let $xQueryPageSize := 1000
 let $xQueryResultEval := 
   if ($queryType = 'xpath' or $queryType = 'xquery' and $query != "")
   then util:eval-inline($document, $query)
@@ -159,6 +164,8 @@
   then $metadata/locator
   else if ($docbase = 'echo')
   then $metadata/dcterms:identifier
+  else if ($docbase = 'tei')
+  then $metadata/TEI:fileDesc/TEI:publicationStmt/TEI:idno
   else $metadata/dcterms:identifier
 let $echoDocIdentifier := 
   if ($documentIdentifier != '')
@@ -181,6 +188,8 @@
   then concat("/permanent/archimedes/", $documentName)
   else if ($docbase = 'echo')
   then concat("/permanent/library/", $echoDocIdentifier)
+  else if ($docbase = 'tei')
+  then $documentIdentifier
   else ''
 let $imagesDocDirectoryIndexMetaUrl := 
   if ($mode = "image" or $mode = "text" or $mode = "textPollux" or $mode = "gis")
@@ -200,6 +209,8 @@
 let $pageImageFileNameWithoutExtension := 
   if ($docbase = 'echo')
   then concat("/", string($pb1/@file))
+  else if ($docbase = 'tei')
+  then concat("/", string($pb1/@facs))
   else ''
 let $imageFileName :=
   if ($reqPF = '')
@@ -224,6 +235,8 @@
   then count($pb1/following::figure[1]/preceding::figure) + 1
   else if ($docbase = 'echo')
   then count($pb1/following::echo:figure[1]/preceding::echo:figure) + 1
+  else if ($docbase = 'tei')
+  then count($pb1/following::TEI:figure[1]/preceding::TEI:figure) + 1
   else ()
 
 let $pageFragmentTmp := 
@@ -411,7 +424,7 @@
   if ($errorCode < 10 and $reqExport = "pdf")
   then mpdl-text:html2pdf($language, $xmlResult, $xslFilePath, $titleStr, $pn, $mode) 
   else if ($errorCode < 10 and not($reqExport = "pdf"))
-  then mpdl-text:transform($xmlResult, $xslFilePath)
+  then mpdl-text:transform($xmlResult, $xslFilePath) 
   else 
     <div>{$xmlResult}</div>  (:  error xml result  :)
 let $result :=