Loading rxq/config.xqm +4 −13 Original line number Diff line number Diff line Loading @@ -155,28 +155,19 @@ declare function max.config:getXMLFormat($project as xs:string){ }; (: Returns resource file path from the edition folder if exists, from the max default one if not. :) declare function max.config:getResourceFile($projectId, $path){ let $editionFile := file:parent(file:parent(static-base-uri())) || "editions/" || $projectId || "/" || $path return if(file:exists($editionFile)) then $editionFile else file:parent(file:parent(static-base-uri())) || $path }; (: Returns project's menu xsl :) declare function max.config:getProjectMenuXSL($projectId) { max.config:getResourceFile($projectId, $max.cons:MENU_XSL_FILEPATH ) max.util:getResourceFilePath($projectId, $max.cons:MENU_XSL_FILEPATH ) }; (: Returns project's TOC xsl :) declare function max.config:getProjectTOCXSL($projectId) { max.config:getResourceFile($projectId, "/ui/xsl/" || $max.cons:TOC_XSL_FILEPATH) max.util:getResourceFilePath($projectId, "/ui/xsl/" || $max.cons:TOC_XSL_FILEPATH) }; Loading @@ -184,7 +175,7 @@ declare function max.config:getProjectTOCXSL($projectId) { Returns project's TOC xsl :) declare function max.config:getDocumentTitleTOCXSL($projectId) { max.config:getResourceFile($projectId, "/ui/xsl/" || $max.cons:DOCUMENT_TITLE_XSL_FILEPATH) max.util:getResourceFilePath($projectId, "/ui/xsl/" || $max.cons:DOCUMENT_TITLE_XSL_FILEPATH) }; (: Loading rxq/util.xqm +11 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,17 @@ declare function max.util:maxHome(){ file:resolve-path(file:parent(file:parent(static-base-uri()))) }; (: Returns resource file path from the edition folder if exists, from the max default one if not. :) declare function max.util:getResourceFilePath($projectId, $path){ let $editionFilePath := max.util:maxHome() || "editions/" || $projectId || "/" || $path return if(file:exists($editionFilePath)) then $editionFilePath else max.util:maxHome() || $path }; (:---------------------------------------------------------------------------------:) Loading Loading
rxq/config.xqm +4 −13 Original line number Diff line number Diff line Loading @@ -155,28 +155,19 @@ declare function max.config:getXMLFormat($project as xs:string){ }; (: Returns resource file path from the edition folder if exists, from the max default one if not. :) declare function max.config:getResourceFile($projectId, $path){ let $editionFile := file:parent(file:parent(static-base-uri())) || "editions/" || $projectId || "/" || $path return if(file:exists($editionFile)) then $editionFile else file:parent(file:parent(static-base-uri())) || $path }; (: Returns project's menu xsl :) declare function max.config:getProjectMenuXSL($projectId) { max.config:getResourceFile($projectId, $max.cons:MENU_XSL_FILEPATH ) max.util:getResourceFilePath($projectId, $max.cons:MENU_XSL_FILEPATH ) }; (: Returns project's TOC xsl :) declare function max.config:getProjectTOCXSL($projectId) { max.config:getResourceFile($projectId, "/ui/xsl/" || $max.cons:TOC_XSL_FILEPATH) max.util:getResourceFilePath($projectId, "/ui/xsl/" || $max.cons:TOC_XSL_FILEPATH) }; Loading @@ -184,7 +175,7 @@ declare function max.config:getProjectTOCXSL($projectId) { Returns project's TOC xsl :) declare function max.config:getDocumentTitleTOCXSL($projectId) { max.config:getResourceFile($projectId, "/ui/xsl/" || $max.cons:DOCUMENT_TITLE_XSL_FILEPATH) max.util:getResourceFilePath($projectId, "/ui/xsl/" || $max.cons:DOCUMENT_TITLE_XSL_FILEPATH) }; (: Loading
rxq/util.xqm +11 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,17 @@ declare function max.util:maxHome(){ file:resolve-path(file:parent(file:parent(static-base-uri()))) }; (: Returns resource file path from the edition folder if exists, from the max default one if not. :) declare function max.util:getResourceFilePath($projectId, $path){ let $editionFilePath := max.util:maxHome() || "editions/" || $projectId || "/" || $path return if(file:exists($editionFilePath)) then $editionFilePath else max.util:maxHome() || $path }; (:---------------------------------------------------------------------------------:) Loading