Commit 7b706bc1 authored by dje's avatar dje
Browse files

début gestion modifiée des différents types de TOC

parent 0880aeb0
Loading
Loading
Loading
Loading
+2 −2
Changes for max.xq: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ function max:getFullDocument($project, $doc){



declare
(: declare
%rest:GET
%output:method("html")
%rest:path("/editions/about")
@@ -307,7 +307,7 @@ function max:about(){
                                    'details': $details

                                }) 
};
}; :)


declare function max:transformEditionFragment($project, $xml, $route){
+7 −6
Changes for rxq/config.xqm: 7 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -89,14 +89,15 @@ declare function max.config:getPluginsBaseURI($project) as xs:string{
};

(:
  gets a project route list type from config file
  gets a project toc  type from config file
:)
declare function max.config:getRouteListType($projectId){
  try{
declare function max.config:getTOCType($projectId) as xs:string{
  (: try{ :)
     max.config:checkConfiguration($projectId),
     string(doc($max.config:CONFIGURATION_FILE)//edition[@xml:id=$projectId]/routeList/@type)
   }
   catch *{fn:error(xs:QName("err:config"), "Please check your MaX configuration file (duplicate inclusion, wrong inclusion path ...) ")}
     let $type := string(doc($max.config:CONFIGURATION_FILE)//edition[@xml:id=$projectId]/toc/@type)
     return if($type) then $type else 'auto'
   (: }
   catch *{fn:error(xs:QName("err:config"), "Please check your MaX configuration file (duplicate inclusion, wrong inclusion path ...) ")} :)
};

(:
+8 −3
Changes for rxq/cons.xqm: 8 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -27,13 +27,18 @@ declare variable $max.cons:PLUGIN_FOLDER_NAME := "plugins";
declare variable $max.cons:DOCUMENT_TOC_QUERY_FILEPATH := "xq/document_toc.xq";

(: Route query file path "editionName" sub directory :)
declare variable $max.cons:ROUTE_QUERY_FILEPATH := "xq/route.xq";
(: declare variable $max.cons:ROUTE_QUERY_FILEPATH := "xq/route.xq"; :)

(:Project TOC  types:)
declare variable $max.cons:AUTO_TOC := "auto";
declare variable $max.cons:CUSTOM_TOC := "custom";
declare variable $max.cons:STATIC_HTML_TOC := "static";

(:ROUTE LIST types:)
declare variable $max.cons:CONFIG_LIST_ROUTE_TYPE := "listing";
(: declare variable $max.cons:CONFIG_LIST_ROUTE_TYPE := "listing";
declare variable $max.cons:HTML_FILE_ROUTE_TYPE := "html";
declare variable $max.cons:XQUERY_ROUTE_TYPE := "xquery";
declare variable $max.cons:DEFAULT_ROUTE_TYPE := "default";
declare variable $max.cons:DEFAULT_ROUTE_TYPE := "default"; :)

(:context Key properties:)
declare variable $max.cons:PROJECT_CONTEXT_KEY := "project";
−4
Changes for rxq/html.xqm: 0 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -55,7 +55,6 @@ declare function max.html:render(
                    max.html:renderTemplate(doc("../ui/templates/default.html"),
                                    map{
                                      'projectId':$projectId,
                                      (: 'devListCombobox': $devListCombobox, :)
                                      'menu': $menu,
                                      'head': $head,
                                      'content' : $wrapped,
@@ -190,9 +189,6 @@ as element(link)*
                type="text/css" 
                href="{max.config:getBaseURI() || '/' || $projectId || '/' || $pluginDirectory|| '/'|| $pluginAddon || '.css'}"/>
          else() 
          
          
          
   return ($pluginsCSS,$cssProject)
 
};
+6
Changes for rxq/toc.xqm: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -9,8 +9,14 @@ import module namespace max.util = 'pddn/max/util' at 'util.xqm';

(:get project table of contents:)
declare function max.toc:getProjectTOC($project){
    let $tocType := max.config:getTOCType($project)
    let $resources := max.util:list-db-resources(max.config:getProjectDBPath($project), $max.cons:TOC || '/')
    return switch ($tocType)
           case $max.cons:AUTO_TOC
                  return <div id='routeList'>{$resources}</div>
           default
                 return <div id='routeList'>{$resources}</div>    
            
};

(: