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

Merge branch 'dev' into jc/jqueryless

parents 457e504f 68e58f91
Loading
Loading
Loading
Loading
+83 −69
Original line number Diff line number Diff line
@@ -68,6 +68,13 @@ declare
%output:encoding("UTF-8")
%rest:path( "/{$project}/{$page=[a-zA-Z0-9_]+}.html")
function max:page($project, $page){
    let $dbPath := max.config:getProjectDBPath($project)
    return
        if (not($dbPath))
        then max:max-error(
                ' Configuration manquante pour le projet "'||$project||'" (fichier configuration/configuration.xml)',
                (), (), ())
        else
            try {
                switch ($page)
                    case "sommaire"
@@ -98,7 +105,8 @@ function max:page($project, $page){
            }
            catch err:config {max:max-error('', $err:description, $err:module, $err:line-number)}
            catch err:FODC0002 {max:max-error('', $err:description, $err:module, $err:line-number)}
    catch err:XPTY0004 {max:max-error('Configuration dupliquée - Veuillez vérifier votre fichier de configuration', $err:description,$err:module, $err:line-number)}
            catch err:FODC0007 {max:max-error('Édition inconnue - Veuillez vérifier votre fichier de configuration.', $err:description, $err:module, $err:line-number)}
            catch err:XPTY0004 {max:max-error('Configuration dupliquée - Veuillez vérifier votre fichier de configuration.', $err:description, $err:module, $err:line-number)}
};


@@ -279,8 +287,6 @@ function max:getHTMLByID($project, $id, $xsl, $xslparams as xs:string *, $wrap a
};




declare function max:transformEditionFragment($project, $xml, $route){
    let $xsltDoc := max.util:buildXSLTDoc(
            max.util:getDefaultTextXSL($project),
@@ -307,15 +313,23 @@ function max:max-error($message, $desc, $module, $line)
            <title>MaX - ERROR</title>
        </head>
        <body>
            <h1>Erreur MAX</h1>
            <div class='error'>
                <div>{if($message) then $message else 'MaX - Erreur'}</div>
                <div>
                    {if ($message) then $message else 'MaX - Erreur'}
                </div>
                {
                    if ($desc or $module or $line)
                    then
                        <div><h2>Trace BaseX</h2>
                            <ul>
                        <li>Description : <span>{$desc}</span></li>
                        <li>Module : <span>{$module}</span></li>
                        <li>Line : <span>{$line}</span></li>
                                {if ($desc) then <li>Description : <span>{$desc}</span></li> else ()}
                                {if ($module) then <li>Module : <span>{$module}</span></li> else ()}
                                {if ($line) then <li>Line : <span>{$line}</span></li> else ()}
                            </ul>
                        </div>
                    else ()
                }
            </div>
        </body>
    </html>
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ declare function local:buildEADDocumentTOC($projectId, $docPath){
            {
                for $c in $target/*:ead/*:archdesc/*:dsc
                return
                    <details id="details_{$c/@id}" open="">
                    <details id="details_{$c/ancestor::*:archdesc/@level}" open="">
                        <summary>
                        <a href="{$baseURI}{$projectId}/{$docPath}/{$c/ancestor::*:archdesc/@id}.html">
                            {$c/ancestor::*:archdesc/*:did/node()}
@@ -35,7 +35,7 @@ declare function local:childrenToc($component, $projectId, $docPath){
    return
       if($c/*:c)
        then
        <details  id="details_{$c/@id}">
        <details  id="details_{$c/@id}" otherlevel="{$c/@otherlevel}">
            <summary>
                <a href="{$baseURI}{$projectId}/{$docPath}/{$c/@id}.html">
                    {$c/@id}
+10 −2
Original line number Diff line number Diff line
@@ -251,7 +251,7 @@ new_edition_build(){
    mkdir $DIRECTORY/../editions
  fi
  mkdir $DIRECTORY/../editions/$1
  $BASEX_BIN -bprojectId=$1 -bdbPath=$2 -benvType=$3 $DIRECTORY"/xq/create_project_config.xq"
  $BASEX_BIN -bprojectId=$1 -bdbPath=$2 -benvType=$3 -bmaxPath=$DIRECTORY/.. $DIRECTORY"/xq/create_project_config.xq"
  include_project_config $1
  format_configuration_file
}
@@ -301,7 +301,7 @@ then
    new_edition_build $project_id $db_path $xmlns
    read -e -p "XML sources path ? " data_path
    db_project_feed $db_path $data_path
    mkdir $DIRECTORY/../editions/$project_id/fragments
    mkdir -p $DIRECTORY/../editions/$project_id/fragments/fr
    mkdir $DIRECTORY/../editions/$project_id/xq
    mkdir $DIRECTORY/../editions/$project_id/ui
    mkdir $DIRECTORY/../editions/$project_id/ui/css
@@ -313,6 +313,14 @@ then
    mkdir $DIRECTORY/../editions/$project_id/ui/xsl

    touch $DIRECTORY/../editions/$project_id/ui/css/$project_id.css

    #creates about frag page
    touch $DIRECTORY/../editions/$project_id/fragments/fr/about.frag.html
    echo "<section>" > $DIRECTORY/../editions/$project_id/fragments/fr/about.frag.html
    echo "<h1>À propos</h1>" >> $DIRECTORY/../editions/$project_id/fragments/fr/about.frag.html
    echo "<p>Modifiez moi dans editions/$project_id/fragments/fr/about.frag.html.</p>" >> $DIRECTORY/../editions/$project_id/fragments/fr/about.frag.html
    echo "</section>" >> $DIRECTORY/../editions/$project_id/fragments/fr/about.frag.html

    cp $DIRECTORY/menu_default.xml $DIRECTORY/../editions/$project_id/menu.xml
    if [ $xmlns = 'ead' ]
    then
+4 −0
Original line number Diff line number Diff line
@@ -9,4 +9,8 @@
    <id>sommaire</id>
    <target>sommaire.html</target>
  </entry>
  <entry type="main">
    <id>about</id>
    <target>about.html</target>
  </entry>
</menu>
+2 −1
Original line number Diff line number Diff line
(: création du fichier de configuration de base pour un nouveau projet:)

declare variable $maxPath external;
declare variable $projectId external;
declare variable $dbPath external;
declare variable $envType external;
@@ -25,4 +26,4 @@ let $config :=

        </edition>

return file:write('../editions/'||$projectId||'/'||$projectId||'_config_inc.xml', $config)
return file:write($maxPath || '/editions/'||$projectId||'/'||$projectId||'_config_inc.xml', $config)
Loading