Commit faa8b072 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

Merge branch 'mb/ead-corr-mineure' into 'dev'

Mb/ead corr mineure

See merge request pdn-certic/MaX!49
parents 51769cb9 07e69b77
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ function max.plugin.ead_basket:basketpdf($projectId, $items){
            </body>
        </html>

    let $pdf := max.util:xml2pdf($content, max.util:maxHome()||"ui/xsl/xhtml2fo.xsl",$projectId)
    let $pdf := max.util:xml2pdf($content, max.util:maxHome()||"ui/xsl/xhtml2fo.xsl",$projectId,$projectId)

    return
        (<rest:response>
+4 −2
Original line number Diff line number Diff line
@@ -14,13 +14,15 @@ declare
function max.plugins.ead2pdf:fragmentToPDF($project, $routeDoc, $id){
    let $dbPath := max.config:getProjectDBPath($project)
    let $eadHeader := doc($dbPath || '/' || $routeDoc)//*:eadheader/node()
    let $frontmatter := doc($dbPath || '/' || $routeDoc)//*:frontmatter/node()
    let $content:=
        <ead xmlns="urn:isbn:1-931666-22-9">
            <eadheader>{$eadHeader}</eadheader>
            <frontmatter>{$frontmatter}</frontmatter>
            <archdesc>{max.api:getXMLByID($dbPath, $id)}</archdesc>
        </ead>
    (: return $content :)
    let $pdf := max.util:xml2pdf($content, max.util:getProjectFoXsl($project), $project)
    let $pdf := max.util:xml2pdf($content, max.util:getProjectFoXsl($project), $project,$id)
    return
        (<rest:response>
            <http:response status="200">
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ function max.plugins.tei2pdf:fragmentToPDF($project, $routeDoc, $id){
            <text>{max.api:getXMLByID($dbPath, $id)}</text>
        </TEI>

    let $pdf := max.util:xml2pdf($content, max.util:getProjectFoXsl($project),$project)
    let $pdf := max.util:xml2pdf($content, max.util:getProjectFoXsl($project),$project,$id)
    return
        (<rest:response>
            <http:response status="200">
+4 −2
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

xquery version "3.0";

declare namespace ead="urn:isbn:1-931666-22-9";
declare variable $documentPath external;
let $title := doc($documentPath)/*:ead/*:eadheader/*:filedesc/*:titlestmt
return <span><title>{$title}</title></span>
 No newline at end of file


    doc($documentPath)//ead:ead/ead:eadheader/ead:filedesc/ead:titlestmt
+3 −2
Original line number Diff line number Diff line
@@ -77,9 +77,10 @@ declare function max.util:addHTMLClass($htmlNode as node(), $targetId as xs:stri


(:xml 2 fo 2 pdf:)
declare function max.util:xml2pdf($xml as element(), $xsl as xs:string, $project as xs:string){
declare function max.util:xml2pdf($xml as element(), $xsl as xs:string, $project as xs:string, $id){
let $projectPrettyName := max.config:getProjectPrettyName($project)
let $xsl := xslt:transform($xml, $xsl, map{ "prettyName":$projectPrettyName})
let $baseURI:= max.config:getBaseURI()
let $xsl := xslt:transform($xml, $xsl, map{ "prettyName":$projectPrettyName,"idProject":$id})
let $pdf := fop:transform($xsl)
return $pdf
(: return file:write-binary('fop.pdf', $pdf):)
Loading