Commit 2bd1febd authored by dje's avatar dje
Browse files

en cours: suppression du mot 'editions' dans les routes

parent 9e072e8d
Loading
Loading
Loading
Loading
+11 −11
Changes for max.xq: 11 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ declare option db:chop 'false';
declare
%rest:GET
%output:method("html")
%rest:path( "/editions/{$project}")
%rest:path( "/{$project}")
function max:projectHome($project){
   web:redirect(request:uri() || '/accueil')
};
@@ -47,7 +47,7 @@ declare
%rest:GET
%output:method("html")
%output:indent("no")
%rest:path( "editions/{$project}/{$page=[a-zA-Z0-9_]+}")
%rest:path( "/{$project}/{$page=[a-zA-Z0-9_]+}")
function max:page($project, $page){
  try{
   switch($page)
@@ -91,7 +91,7 @@ declare
%rest:GET
%output:method("html")
%output:indent("no")
%rest:path("/editions/{$project}/sommaire/{$doc=[^plugins].*\.xml|.*\.svg}")
%rest:path("/{$project}/sommaire/{$doc=[^plugins].*\.xml|.*\.svg}")
function max:documentTOC($project,$doc){
    max.html:render($project, "sommaire", max.toc:getDocumentTOC($project, $doc))
};
@@ -101,7 +101,7 @@ declare
%rest:GET
%output:method("html")
%output:indent("no")
%rest:path("/editions/{$project}/{$routeDoc=[^plugins].*\.xml}/{$id}")
%rest:path("/{$project}/{$routeDoc=[^plugins].*\.xml}/{$id}")
function max:htmlFragmentWithNavigationBar($project, $routeDoc, $id){

    let $dbPath := max.config:getProjectDBPath($project)
@@ -140,7 +140,7 @@ declare
%rest:GET
%output:method("html")
%output:indent("no")
%rest:path("/editions/{$project}/{$routeDoc=[^plugins].*\.xml}/{$id}/target/{$targetId}/{$search}")
%rest:path("/{$project}/{$routeDoc=[^plugins].*\.xml}/{$id}/target/{$targetId}/{$search}")
function max:htmlFragmentAndTargetSearchWithNavigationBar($project, $routeDoc, $id, $targetId, $search){
 
    
@@ -163,7 +163,7 @@ declare
%rest:GET
%output:method("html")
%output:indent("no")
%rest:path("/editions/{$project}/{$routeDoc=[^plugins].*\.xml}/focus/{$idFocus}")
%rest:path("/{$project}/{$routeDoc=[^plugins].*\.xml}/focus/{$idFocus}")
function max:htmlFragmentTargetIdWithNavigationBar($project, $routeDoc, $idFocus){
    copy $c := max:getFullDocument($project, $routeDoc)
    modify (
@@ -179,7 +179,7 @@ declare
%rest:GET
%output:method("html")
%output:indent("no")
%rest:path("/editions/{$project}/{$routeDoc=[^plugins].*\.xml}/focus/{$idPart}/{$idFocus}")
%rest:path("/{$project}/{$routeDoc=[^plugins].*\.xml}/focus/{$idPart}/{$idFocus}")
function max:htmlFragmentTargetPartAndIdWithNavigationBar($project, $routeDoc,$idPart, $idFocus){
  copy $c := max:htmlFragmentWithNavigationBar($project, $routeDoc, $idPart)
    modify (
@@ -192,7 +192,7 @@ function max:htmlFragmentTargetPartAndIdWithNavigationBar($project, $routeDoc,$i
declare
%rest:GET
%output:method("html")
%rest:path("/editions/{$project}/checkplugins")
%rest:path("/{$project}/checkplugins")
function max:checkPlugin($project){
    let $plugins := max.config:getPluginNameList($project)
    return
@@ -222,7 +222,7 @@ function max:checkPlugin($project){
declare
%rest:GET
%output:method("html")
%rest:path("editions/{$project}/fragment/{$id}")
%rest:path("/{$project}/fragment/{$id}")
function max:getXMLByID($project, $id){
  max.api:getXMLByID(max.config:getProjectDBPath($project), $id)
};
@@ -234,7 +234,7 @@ declare
%rest:query-param("xsl", "{$xsl}")
%rest:query-param("xslparams","{$xslparams}")
%rest:query-param("wrap", "{$wrap}")
%rest:path("editions/{$project}/fragment_html/{$id}")
%rest:path("/{$project}/fragment_html/{$id}")
function max:getHTMLByID($project, $id, $xsl, $xslparams as xs:string *, $wrap as xs:string ?)as element(){
  let $xml := max.api:getXMLByID(max.config:getProjectDBPath($project), $id)
  let $xsltDoc := max.util:buildXSLTDoc(
@@ -263,7 +263,7 @@ declare
%rest:GET
%output:method("html")
%output:indent("no")
%rest:path("/editions/{$project}/doc/{$doc=.*\.xml|.*\.svg}")
%rest:path("/{$project}/doc/{$doc=.*\.xml|.*\.svg}")
function max:getFullDocument($project, $doc){
  
  let $xmlDoc := (doc(max.config:getProjectDBPath($project) || "/" || $doc)/*)[1]
+4 −4
Changes for plugins/search/search.xqm: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ declare variable $max.plugin.search:BACK_TO_TEXT_ID_PARAMETER := "backToTextID";
declare
%rest:GET
%output:method("html")
%rest:path("/editions/{$project}/rechercher")
%rest:path("/{$project}/rechercher")
function max.plugin.search:searchPage($project){
  let $routeList := for $d in collection( max.config:getProjectDBPath($project)) return base-uri($d) (:max.route:HTMLRouteList($project)//a/@href :)
  let $routeSelect := <select id='searchSelect'>{
@@ -54,7 +54,7 @@ function max.plugin.search:searchPage($project){
declare
%rest:GET
%output:method("html")
%rest:path("editions/{$project}/search/report")
%rest:path("/{$project}/search/report")
function max.plugin.search:check($project){
  let $pluginConfig := max.config:getPluginByName($project, $max.plugin.search:PLUGIN_ID)
  
@@ -79,7 +79,7 @@ declare
%output:method("html")
%rest:query-param("search", "{$search}")
%rest:query-param("docs", "{$docs}")
%rest:path("editions/{$project}/search")
%rest:path("/{$project}/search")
function max.plugin.search:plap($project,$search, $docs){
  let $plugin := max.config:getPluginByName($project, $max.plugin.search:PLUGIN_ID)
  let $tag := string($plugin//parameter[@key=$max.plugin.search:TAG_PARAMETER]/@value)
@@ -119,7 +119,7 @@ declare
%rest:query-param("search", "{$search}")
%rest:query-param("docs", "{$docs}")
%rest:query-param("transform", "{$transform}", "no")
%rest:path("editions/{$project}/deprecatedsearch")
%rest:path("/{$project}/deprecatedsearch")
function max.plugin.search:search($project, $search as xs:string, $docs as item()+, $transform as xs:string){
  
  let $dbPath := max.config:getProjectDBPath($project)
+3 −3
Changes for rxq/alignment.xqm: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ import module namespace max.util = 'pddn/max/util' at 'util.xqm';
declare
%rest:GET
%output:method("html")
%rest:path("/editions/{$project}/{$doc}/{$id1}/{$id2}")
%rest:path("/{$project}/{$doc}/{$id1}/{$id2}")
function max.alignment:alignedHTML($project, $doc, $id1, $id2){
   let $dbPath := max.config:getProjectDBPath($project)
   let $xsltDoc := max.util:buildXSLTDoc(
@@ -79,10 +79,10 @@ declare function max.alignment:buildFragmentLinkFromID($base, $project, $routeId
  return 
  if(not($isAligned))
  then 
    $base || "/" || $project || "/" || $routeId || "/" || $fragmentID
    $base  || $project || "/" || $routeId || "/" || $fragmentID
  else
        let $firstPrefix := max.config:getFirstAlignmentPrefix($routeId)
        let $secondPrefix := max.config:getSecondAlignmentPrefix($routeId)
        let $idPointer2 := $secondPrefix || substring-after($fragmentID, $firstPrefix)  
        return $base || "/" || $project || "/" || $routeId  || "/" || $fragmentID || "/" ||  $idPointer2 
        return $base ||  $project || "/" || $routeId  || "/" || $fragmentID || "/" ||  $idPointer2 
};
 No newline at end of file
+1 −1
Changes for rxq/cons.xqm: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ declare variable $max.cons:TEI := "tei";
declare variable $max.cons:EAD := "ead";

(: Base Dir:)
declare variable $max.cons:BASE_DIR := "/editions";
declare variable $max.cons:BASE_DIR := "/";
declare variable $max.cons:PLUGINS_BASE_DIR := "/plugins";

(: route path name (in URLs):)
+4 −4
Changes for rxq/file.xqm: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ import module namespace max.util = 'pddn/max/util' at 'util.xqm';
 : @return rest response and binary file
 :)
declare
  %rest:path("editions/{$project}/plugins/{$pluginName}/{$file}")
  %rest:path("/{$project}/plugins/{$pluginName}/{$file}")
function max.file:pluginFile(
  $project,
  $pluginName as xs:string,
@@ -23,7 +23,7 @@ function max.file:pluginFile(
Project's UI file: css, js, image ...
:)
declare
  %rest:path("/editions/{$project}/ui/{$filePath=.*}")
  %rest:path("/{$project}/ui/{$filePath=.*}")
function max.file:projectUIFile(
  $project as xs:string,
  $filePath as xs:string){
@@ -37,7 +37,7 @@ function max.file:projectUIFile(
 Global ui css,images,f font, js ... file
:)  
declare
  %rest:path("/editions/{$project=[a-zA-Z\_\-]+}/core/ui/{$filePath=.*}")
  %rest:path("/{$project=[a-zA-Z\_\-]+}/core/ui/{$filePath=.*}")
function max.file:UIFile(
  $project as xs:string,
  $filePath as xs:string){
@@ -52,7 +52,7 @@ function max.file:UIFile(
 uiAddon css or js file
:)  
declare
  %rest:path("/editions/ui/uiAddons/{$uiAddonName}/{$file}")
  %rest:path("/ui/uiAddons/{$uiAddonName}/{$file}")
function max.file:UIAddonFile(
  $uiAddonName as xs:string,
  $file as xs:string){   
Loading