Loading max.xq +33 −32 Original line number Diff line number Diff line Loading @@ -206,38 +206,6 @@ declare %private function max:applySearchMarkup($html as node(), $search as xs:s } }; (:Call the check plugin method (on a specified project:) declare %rest:GET %output:method("html") %output:html-version("5.0") %output:indent("no") %output:encoding("UTF-8") %rest:path("/{$project}/checkplugins.html") function max:checkPlugin($project){ let $plugins := max.config:getEnabledPluginNames($project) return if (not($plugins)) then <div id='pluginsReport'>Aucun plugin pour {$project}.</div> else let $reports := <ul>{for $plugin in $plugins return try { xquery:invoke(request:uri() || "/../" || $plugin || "/report") } catch err:FODC0002 {<div>Méthode {$plugin || "/report"} manquante.</div>} } </ul> let $report := <div id='pluginsReport'> <div>Installed plugin(s): {string-join($plugins, ', ')}</div> {$reports} </div> return $report }; (:Returns XML fragment identified by $id:) declare Loading Loading @@ -369,3 +337,36 @@ declare %private function max:invokePluginXQueries($project, $routeDoc, $id){ catch * {max:max-error("Erreur code " || $err:code, $err:description, $err:module, $err:line-number)} }; (:Call the check plugin method (on a specified project:) (:declare:) (:%rest:GET:) (:%output:method("html"):) (:%output:html-version("5.0"):) (:%output:indent("no"):) (:%output:encoding("UTF-8"):) (:%rest:path("/{$project}/checkplugins.html"):) (:function max:checkPlugin($project){:) (: let $plugins := max.config:getEnabledPluginNames($project):) (: return:) (: if (not($plugins)):) (: then <div id='pluginsReport'>Aucun plugin pour {$project}.</div>:) (: else:) (: let $reports :=:) (: <ul>{for $plugin in $plugins:) (: return:) (: try:) (: {:) (: xquery:invoke(request:uri() || "/../" || $plugin || "/report"):) (: }:) (: catch err:FODC0002 {<div>Méthode {$plugin || "/report"} manquante.</div>}:) (: }:) (: </ul>:) (: let $report :=:) (: <div id='pluginsReport'>:) (: <div>Installed plugin(s): {string-join($plugins, ', ')}</div>:) (: {$reports}:) (: </div>:) (: return $report:) (:};:) No newline at end of file rxq/alignment.xqm +2 −2 Original line number Diff line number Diff line Loading @@ -42,8 +42,8 @@ declare function max.alignment:runAlignmentQuery($project, $routeId, $id1 as xs: let $queryFile := max.config:getTextAlignmentQueryFile($routeId) return if($queryFile) then xquery:invoke( $queryFile, then xquery:eval( xs:anyURI($queryFile), map{ 'fragmentId':$id1, 'firstPrefix': max.config:getFirstAlignmentPrefix($routeId), Loading rxq/html.xqm +2 −2 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ declare %private function max.html:buildMetas($projectId, $xmlFragment){ let $metadatas := if (file:exists($f)) then xquery:invoke($f, map xquery:eval(xs:anyURI($f), map { 'project' : $projectId, 'requestPath' : request:path(), Loading Loading @@ -372,7 +372,7 @@ declare function max.html:invokePluginXQueries($project, $routeDoc, $id){ let $pluginXQ := max.util:maxHome()||'/plugins/' || $pluginName || '/'|| $pluginName ||'.xq' return if(file:exists($pluginXQ)) then xquery:invoke($pluginXQ, xquery:eval(xs:anyURI($pluginXQ), map { 'baseURI' : max.config:getBaseURI(), Loading rxq/toc.xqm +2 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ declare function max.toc:getProjectTOC($project){ let $xml := if(file:exists($tocFile)) then xquery:invoke($tocFile,map xquery:eval(xs:anyURI($tocFile),map { 'project':$project, 'baseURI': max.config:getBaseURI(), Loading Loading @@ -41,7 +41,7 @@ declare function max.toc:getProjectTOC($project){ declare function max.toc:getDocumentTOC($project, $doc){ let $tocQuery := max.util:getDocumentTOCXQueryFile($project) let $xml := xquery:invoke($tocQuery,map let $xml := xquery:eval(xs:anyURI($tocQuery),map { 'project':$project, 'baseURI': max.config:getBaseURI(), 'dbPath':max.config:getProjectDBPath($project), Loading rxq/util.xqm +4 −4 Original line number Diff line number Diff line Loading @@ -183,7 +183,7 @@ declare function max.util:list-db-resources($projectId, $dbName, $baseURI, $xmln declare function max.util:getDocTitle($dbName, $docPath, $xmlFormat){ let $docTitleQueryFile := max.util:getDocumentTitleXQueryFile($xmlFormat) return xquery:invoke($docTitleQueryFile,map {'documentPath': $dbName ||'/'|| $docPath}) xquery:eval(xs:anyURI($docTitleQueryFile),map {'documentPath': $dbName ||'/'|| $docPath}) }; Loading Loading @@ -229,8 +229,8 @@ declare function max.util:getTextHookFragment($projectId, $doc){ return if(file:exists($xqueryFile)) then xquery:invoke( $xqueryFile, xquery:eval( xs:anyURI($xqueryFile), map { 'project':$projectId, 'baseURI': max.config:getBaseURI(), Loading Loading @@ -259,7 +259,7 @@ declare function max.util:getProjectTOCXSL($projectId) { let $xsltFile := max.util:getResourceFilePath($projectId, "/ui/xsl/"|| $max.cons:TOC_XSL_FILEPATH) return if(file:exists($xsltFile)) then $xsltFile else max.util:getResourceFilePath($projectId, "/ui/xsl/" || $max.cons:TOC_XSL_FILEPATH) else max.util:getResourceFilePath($projectId, "/ui/xsl/core/" || $max.cons:TOC_XSL_FILEPATH) }; Loading Loading
max.xq +33 −32 Original line number Diff line number Diff line Loading @@ -206,38 +206,6 @@ declare %private function max:applySearchMarkup($html as node(), $search as xs:s } }; (:Call the check plugin method (on a specified project:) declare %rest:GET %output:method("html") %output:html-version("5.0") %output:indent("no") %output:encoding("UTF-8") %rest:path("/{$project}/checkplugins.html") function max:checkPlugin($project){ let $plugins := max.config:getEnabledPluginNames($project) return if (not($plugins)) then <div id='pluginsReport'>Aucun plugin pour {$project}.</div> else let $reports := <ul>{for $plugin in $plugins return try { xquery:invoke(request:uri() || "/../" || $plugin || "/report") } catch err:FODC0002 {<div>Méthode {$plugin || "/report"} manquante.</div>} } </ul> let $report := <div id='pluginsReport'> <div>Installed plugin(s): {string-join($plugins, ', ')}</div> {$reports} </div> return $report }; (:Returns XML fragment identified by $id:) declare Loading Loading @@ -369,3 +337,36 @@ declare %private function max:invokePluginXQueries($project, $routeDoc, $id){ catch * {max:max-error("Erreur code " || $err:code, $err:description, $err:module, $err:line-number)} }; (:Call the check plugin method (on a specified project:) (:declare:) (:%rest:GET:) (:%output:method("html"):) (:%output:html-version("5.0"):) (:%output:indent("no"):) (:%output:encoding("UTF-8"):) (:%rest:path("/{$project}/checkplugins.html"):) (:function max:checkPlugin($project){:) (: let $plugins := max.config:getEnabledPluginNames($project):) (: return:) (: if (not($plugins)):) (: then <div id='pluginsReport'>Aucun plugin pour {$project}.</div>:) (: else:) (: let $reports :=:) (: <ul>{for $plugin in $plugins:) (: return:) (: try:) (: {:) (: xquery:invoke(request:uri() || "/../" || $plugin || "/report"):) (: }:) (: catch err:FODC0002 {<div>Méthode {$plugin || "/report"} manquante.</div>}:) (: }:) (: </ul>:) (: let $report :=:) (: <div id='pluginsReport'>:) (: <div>Installed plugin(s): {string-join($plugins, ', ')}</div>:) (: {$reports}:) (: </div>:) (: return $report:) (:};:) No newline at end of file
rxq/alignment.xqm +2 −2 Original line number Diff line number Diff line Loading @@ -42,8 +42,8 @@ declare function max.alignment:runAlignmentQuery($project, $routeId, $id1 as xs: let $queryFile := max.config:getTextAlignmentQueryFile($routeId) return if($queryFile) then xquery:invoke( $queryFile, then xquery:eval( xs:anyURI($queryFile), map{ 'fragmentId':$id1, 'firstPrefix': max.config:getFirstAlignmentPrefix($routeId), Loading
rxq/html.xqm +2 −2 Original line number Diff line number Diff line Loading @@ -337,7 +337,7 @@ declare %private function max.html:buildMetas($projectId, $xmlFragment){ let $metadatas := if (file:exists($f)) then xquery:invoke($f, map xquery:eval(xs:anyURI($f), map { 'project' : $projectId, 'requestPath' : request:path(), Loading Loading @@ -372,7 +372,7 @@ declare function max.html:invokePluginXQueries($project, $routeDoc, $id){ let $pluginXQ := max.util:maxHome()||'/plugins/' || $pluginName || '/'|| $pluginName ||'.xq' return if(file:exists($pluginXQ)) then xquery:invoke($pluginXQ, xquery:eval(xs:anyURI($pluginXQ), map { 'baseURI' : max.config:getBaseURI(), Loading
rxq/toc.xqm +2 −2 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ declare function max.toc:getProjectTOC($project){ let $xml := if(file:exists($tocFile)) then xquery:invoke($tocFile,map xquery:eval(xs:anyURI($tocFile),map { 'project':$project, 'baseURI': max.config:getBaseURI(), Loading Loading @@ -41,7 +41,7 @@ declare function max.toc:getProjectTOC($project){ declare function max.toc:getDocumentTOC($project, $doc){ let $tocQuery := max.util:getDocumentTOCXQueryFile($project) let $xml := xquery:invoke($tocQuery,map let $xml := xquery:eval(xs:anyURI($tocQuery),map { 'project':$project, 'baseURI': max.config:getBaseURI(), 'dbPath':max.config:getProjectDBPath($project), Loading
rxq/util.xqm +4 −4 Original line number Diff line number Diff line Loading @@ -183,7 +183,7 @@ declare function max.util:list-db-resources($projectId, $dbName, $baseURI, $xmln declare function max.util:getDocTitle($dbName, $docPath, $xmlFormat){ let $docTitleQueryFile := max.util:getDocumentTitleXQueryFile($xmlFormat) return xquery:invoke($docTitleQueryFile,map {'documentPath': $dbName ||'/'|| $docPath}) xquery:eval(xs:anyURI($docTitleQueryFile),map {'documentPath': $dbName ||'/'|| $docPath}) }; Loading Loading @@ -229,8 +229,8 @@ declare function max.util:getTextHookFragment($projectId, $doc){ return if(file:exists($xqueryFile)) then xquery:invoke( $xqueryFile, xquery:eval( xs:anyURI($xqueryFile), map { 'project':$projectId, 'baseURI': max.config:getBaseURI(), Loading Loading @@ -259,7 +259,7 @@ declare function max.util:getProjectTOCXSL($projectId) { let $xsltFile := max.util:getResourceFilePath($projectId, "/ui/xsl/"|| $max.cons:TOC_XSL_FILEPATH) return if(file:exists($xsltFile)) then $xsltFile else max.util:getResourceFilePath($projectId, "/ui/xsl/" || $max.cons:TOC_XSL_FILEPATH) else max.util:getResourceFilePath($projectId, "/ui/xsl/core/" || $max.cons:TOC_XSL_FILEPATH) }; Loading