betagouv / SPPNautSPO

Generator and S3 interface for SPPNaut Startup
European Union Public License 1.2
0 stars 0 forks source link

Enlevons les dépendances à www/xml/document.xml #13

Open kolok opened 1 year ago

kolok commented 1 year ago

Nous avons de nombreux messages dans le log concernant l'absence de ce fichier car il est utilisé pour déterminer l'auteur ou calculer un "padding"

message d'erreurs :

Recoverable error on line 128 of document.xsl:
  FODC0005: java.io.FileNotFoundException:
  /tmp/sppnaut/2287d71c-9d45-42fe-841a-841312d366c9/www/xml/document.xml (No such file or directory)
Recoverable error on line 482 of ouvrage.xsl:
  FODC0005: Document has been marked not available:
  file:/tmp/sppnaut/2287d71c-9d45-42fe-841a-841312d366c9/www/xml/document.xml

code document.xsl :

<!-- auteur -->
<axf:document-info name="author">
    <xsl:attribute name="value">
        <xsl:choose>
            <xsl:when test="document('../../www/xml/document.xml', /)">
                <xsl:value-of select="document('../../www/xml/document.xml', /)/liste/env/domain"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select=".//md:editeur/md:identite/md:abrev"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:attribute>
</axf:document-info>

code ouvrage.xsl :

<!-- construction du graphique -->
<fo:external-graphic>
    <xsl:if test="@orientation != 90 or not(exists(@orientation))">
        <!--                                <xsl:attribute name="padding-top">3mm</xsl:attribute>-->
        <!-- optimisation de l'affichage des illustrations (si on a la largeur dans www/document.xml, alors on la prends) -->
        <xsl:variable name="with" select="document('../../www/xml/document.xml', /)/liste/referentiel/ouvrage[@id=$idOuvrage]/illustrations/document[nom = concat(current()/numero, 'jpg')]/property/@dimension"/>
        <xsl:choose>
            <xsl:when test="$with != '' and xs:integer(substring-before($with, ':')) &lt; 430"/>
            <xsl:otherwise>
                <xsl:attribute name="padding-top">3mm</xsl:attribute>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:if>

Cependant, nous n'avons pas trouvé de différence de padding et l'auteur peut-être calcler différemment

… à investiguer

Propositions :

rik commented 1 year ago

Le fichier document.xml étant généré par SPO, on ne peut pas en dépendre car il ne sera plus généré quand on éteindra MacGenese.

Il nous faut donc enlever toutes les dépendances.