Commit a6950edc authored by dje's avatar dje
Browse files

simplication max.util:rawFile, + correctif readme

parent 32ead2ee
Loading
Loading
Loading
Loading
+8 −0
Changes for max.xq: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -30,6 +30,14 @@ function max:home(){
   </html>
};

(:MaX Home:)
declare
%rest:GET
%rest:path( "/favicon.ico")
function max:favicon(){
  max.util:rawFile(file:parent(static-base-uri())||'ui/images/favicon.ico')
};


(:
declare option db:chop 'false';
+1 −1
Changes for readme.md: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ Par défaut, la page de sommaire liste les documents présents dans la collectio
 * Pour l'EAD, les éléments **ead/ead:archdesc/ead:did/ead:unittitle//text()**

## Surchage du comportement
La modification du comportement par défaut se fait par l'ajout d'un fichier XQUERY **toc.xq**, dans le répertoire **editions/<projectId>/xq/**.
La modification du comportement par défaut se fait par l'ajout d'un fichier XQUERY **toc.xq**, dans le répertoire **editions/[projectId]/xq/**.
Ce fichier doit à minima déclarer les variables qui lui sont automatiquement passées en paramètres par MAX :

```
+1 −1
Changes for rxq/ead_treeview/ead_treeview.xqm: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ declare
%rest:path("editions/plugins/treeview/resources/{$file=.+}")
function ead_treeview:getThemeResource($file){
  let $path := file:parent(static-base-uri()) || "/resources/"  || $file
    return max.util:rawFile($file, $path)
  return max.util:rawFile($path)
};


+4 −4
Changes for rxq/file.xqm: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ function max.file:pluginFile(
  $file as xs:string
) as item()+ {
  let $path := file:parent(file:parent(static-base-uri())) || "/plugins/" || $pluginName ||  "/" || $file
  return max.util:rawFile($file, $path)
  return max.util:rawFile($path)
};

(:
@@ -29,7 +29,7 @@ function max.file:projectUIFile(
  $filePath as xs:string){
    
    let $path := file:parent(file:parent(static-base-uri())) || "/editions/" || $project || "/ui/"  || $filePath
    return max.util:rawFile($filePath, $path)
    return max.util:rawFile($path)
  
};

@@ -43,7 +43,7 @@ function max.file:UIFile(
  $filePath as xs:string){
    
    let $path := file:parent(file:parent(static-base-uri())) || "/ui/"  || $filePath
    return max.util:rawFile($filePath, $path)
    return max.util:rawFile($path)
  
};

@@ -57,6 +57,6 @@ function max.file:UIAddonFile(
  $uiAddonName as xs:string,
  $file as xs:string){   
    let $path := file:parent(file:parent(static-base-uri())) || "/ui/uiAddons/" || $uiAddonName || "/" || $file
    return max.util:rawFile($file, $path)
    return max.util:rawFile($path)
  
};
 No newline at end of file
+1 −1
Changes for rxq/util.xqm: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ declare namespace xsl = "http://www.w3.org/1999/XSL/Transform";
(:
: Returns binary-file
:)
declare function max.util:rawFile($file, $path) as item()+{
declare function max.util:rawFile($path) as item()+{
    web:response-header(map { 'media-type': web:content-type($path) }),
    file:read-binary($path)