Commit 59fba5ad authored by Arnaud Daret's avatar Arnaud Daret
Browse files

Test pour inclure un fragment depuis un autre

parent 0ce26064
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -108,6 +108,24 @@ function max:page($project, $page){
    catch err:XPTY0004 {max:max-error('Configuration dupliquée - Veuillez vérifier votre fichier de configuration', $err:description,$err:module, $err:line-number)}
};

(:gets a project's HTML fragment page:)
declare
%rest:GET
%output:method("xml")
%output:indent("no")
%output:encoding("UTF-8")
%rest:path( "/{$project}/html_fragment/{$page=[a-zA-Z0-9_]+}")
function max:html_fragment($project, $page){
    try {
        let $content := max.html:getHTMLFragmentFile($project, $page)
        return $content
    }
    catch err:FODC0002 {max:max-error('Page/fragment ' || $page || ' introuvable ou mal formé', $err:description, $err:module, $err:line-number)}
    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)}
};


declare
%rest:GET