Commit 191f7ef0 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

xsl par défaut dans un dossier core. Les surcharges(document_toc.xsl, toc.xsl,...

xsl par défaut dans un dossier core. Les surcharges(document_toc.xsl, toc.xsl, etc.)  doivent maintenant être placées directement sous ui/xsl et non sous ui/xsl/(tei|ead)
parent 27a52724
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ Ce fichier par défaut se trouve dans <span class="dossier">[projet-]MaX</span>/
## Modification de la mise en forme du menu

Le menu HTML est le résultat de la transformation du fichier <span class="dossier">mon-edition</span>/<span class="fichier">menu.xml</span> par la feuille XSL par défaut placée dans <span class="dossier">[projet-]MaX</span>/<span class="dossier">ui</span>/<span class="dossier">xsl</span>/<span class="fichier">menu.xsl</span>.    
Une feuille de transformation placée dans <span class="dossier">mon-edition</span>/<span class="dossier">ui</span>/<span class="dossier">xsl</span>/<span class="fichier">menu.xsl</span> peut remplacer celle disponible par défaut. 
Une feuille de transformation placée dans <span class="dossier">mon-edition</span>/<span class="dossier">ui</span>/<span class="dossier">xsl</span>/core/<span class="fichier">menu.xsl</span> peut remplacer celle disponible par défaut. 

Trois paramètres sont disponibles dans cette XSL :

+3 −3
Original line number Diff line number Diff line
@@ -90,10 +90,10 @@ Exemple de listing (généré par la XQuery par défaut de MaX) compatible avec


Pour modifier la XSL par défaut, il faut créer un fichier <span class="fichier">toc.xsl</span>.    
 <span class="dossier">[projet-]editions</span>/<span class="dossier">[edition]</span>/<span class="dossier">ui</span>/<span class="dossier">xsl</span>/<span class="dossier">[tei ou ead]</span>/<span class="fichier">toc.xsl</span>.    
 <span class="dossier">[projet-]editions</span>/<span class="dossier">[edition]</span>/<span class="dossier">ui</span>/<span class="dossier">xsl</span>/<span class="fichier">toc.xsl</span>.    
 Cette XSL permet detransformer le résultat de la XQuery par défaut ou celle qui la surcharge (<span class="dossier">[projet-]editions</span>/<span class="dossier">[edition]</span>/<span class="dossier">xq</span>/<span class="fichier">toc.xq</span>) en HTML.

En l’absence d'un tel fichier, MaX exécutera <span class="dossier">[projet-]MaX</span>/<span class="dossier">ui</span>/<span class="dossier">xsl</span>/<span class="dossier">[tei ou ead]</span>/<span class="fichier">toc.xsl</span>.
En l’absence d'un tel fichier, MaX exécutera <span class="dossier">[projet-]MaX</span>/<span class="dossier">ui</span>/<span class="dossier">xsl</span>/<span class="fichier">toc.xsl</span>.



@@ -217,7 +217,7 @@ Afin d'être compatible avec la feuille de transformation XSL appliquée par dé

La XSL par défaut peut également surchargée : 
Il faut alors créer un fichier <span class="fichier">document_toc.xsl</span>.    
<span class="dossier">[projet-]editions</span>/<span class="dossier">[edition]</span>/<span class="dossier">ui</span>/<span class="dossier">xsl</span>/<span class="dossier">[tei ou ead]</span>/<span class="fichier">document_toc.xsl</span>    
<span class="dossier">[projet-]editions</span>/<span class="dossier">[edition]</span>/<span class="dossier">ui</span>/<span class="dossier">xsl</span>/<span class="fichier">document_toc.xsl</span>    

Cette XSL permet de transformer le résultat de la XQuery (XQuery par défaut ou surcharge présente dans <span class="dossier">[projet-]editions</span>/<span class="dossier">[edition]</span>/<span class="dossier">xq</span>/<span class="fichier">document_toc.xq</span> ) en HTML.    
Cette XSL reçoit en entrée :
+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,$projectId)
    let $pdf := max.util:xml2pdf($content, max.util:maxHome()||"ui/xsl/core/xhtml2fo.xsl",$projectId,$projectId)

    return
        (<rest:response>
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ declare variable $max.cons:MENU_FILE := "menu.xml";
declare variable $max.cons:PLUGIN_FOLDER_NAME := "plugins";

(: menu XSL. :)
declare variable $max.cons:MENU_XSL_FILEPATH := "ui/xsl/menu.xsl";
declare variable $max.cons:MENU_XSL_FILEPATH := "ui/xsl/core/menu.xsl";

(: project toc query :)
declare variable $max.cons:TOC_QUERY_FILEPATH := "xq/toc.xq";
+4 −4
Original line number Diff line number Diff line
@@ -195,7 +195,8 @@ declare function max.util:maxHome(){
    Returns resource file path from the edition folder if exists, from the max default one if not.
:)
declare function max.util:getResourceFilePath($projectId, $path){
    let $editionFilePath := max.util:maxHome()  || "editions/" || $projectId || "/" || $path
    let $overPath := if(contains($path,'core/')) then replace($path,'core/','') else $path
    let $editionFilePath := max.util:maxHome()  || "editions/" || $projectId || "/" || $overPath
    return
        if(file:exists($editionFilePath))
        then $editionFilePath
@@ -253,7 +254,7 @@ declare function max.util:getProjectMenuXSL($projectId) {
declare function max.util:getProjectTOCXSL($projectId) {

    let $xmlFormat := max.config:getXMLFormat($projectId)
    let $xsltFile := max.util:getResourceFilePath($projectId, "/ui/xsl/" || $xmlFormat||"/" || $max.cons:TOC_XSL_FILEPATH)
    let $xsltFile := max.util:getResourceFilePath($projectId, "/ui/xsl/"|| $max.cons:TOC_XSL_FILEPATH)
    return if(file:exists($xsltFile))
    then $xsltFile
    else max.util:getResourceFilePath($projectId, "/ui/xsl/" || $max.cons:TOC_XSL_FILEPATH)
@@ -314,8 +315,7 @@ declare function max.util:getDocumentTitleXQueryFile($xmlFormat as xs:string){
 Returns project's doc toc XSL
:)
declare function max.util:getProjectDocumentTOCXSL($projectId){
    let $xmlFormat:=max.config:getXMLFormat($projectId)
    let $xsltFile := file:parent(file:parent(static-base-uri())) || "editions/" || $projectId || "/ui/xsl/" || $xmlFormat|| "/" || $max.cons:DOCUMENT_TOC_XSL_FILEPATH
    let $xsltFile := file:parent(file:parent(static-base-uri())) || "editions/" || $projectId || "/ui/xsl/"  || $max.cons:DOCUMENT_TOC_XSL_FILEPATH
    return if(file:exists($xsltFile))
    then $xsltFile
    else file:parent(file:parent(static-base-uri())) || "ui/xsl/" || max.config:getXMLFormat($projectId) ||'/'|| $max.cons:DOCUMENT_TOC_XSL_FILEPATH
Loading