Loading max.xq +0 −15 Original line number Diff line number Diff line Loading @@ -355,18 +355,3 @@ declare %private function max:invokePluginXQueries($project, $routeDoc, $id){ catch * {max:max-error("Erreur code " || $err:code, $err:description,$err:module, $err:line-number)} }; (:declare:) (:%rest:GET:) (:%rest:path("/{$projectId}/test/fop"):) (:%rest:produces("application/pdf"):) (:function max:testFOP($projectId){:) (: let $xml := (doc('fop/exemple.xml')/*)[1]:) (: let $pdf := max.util:xml2pdf($xml, max.util:getProjectFoXsl($projectId)):) (: return:) (: (<rest:response>:) (: <http:response status="200">:) (: <http:header name="content-type" value="application/pdf"/>:) (: </http:response>:) (: </rest:response>,:) (: $pdf):) (:};:) No newline at end of file rxq/file.xqm +3 −2 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ module namespace max.file = 'pddn/max/file'; import module namespace max.util = 'pddn/max/util' at 'util.xqm'; import module namespace max.cons = 'pddn/max/cons' at 'cons.xqm'; (: Project's UI file: css, js, image ... :) Loading @@ -17,7 +18,7 @@ function max.file:projectUIFile( return if (file:exists($path)) then max.util:rawFile($path) else () else max.util:error404() }; (: Loading @@ -31,7 +32,7 @@ function max.file:UIFile( return if (file:exists($path)) then max.util:rawFile($path) else () else max.util:error404() }; (: Loading rxq/util.xqm +13 −0 Original line number Diff line number Diff line Loading @@ -341,4 +341,17 @@ declare function max.util:getDefaultTextXSL($project as xs:string) as xs:string{ return max.util:maxHome() || "/ui/xsl/" || $env || "/" || $env || ".xsl" }; (: Returns 404 response :) declare %output:method("text") %rest:path("") function max.util:error404() { <rest:response> <http:response status="404"> <http:header name="Content-Language" value="en"/> <http:header name="Content-Type" value="text/plain; charset=utf-8"/> </http:response> </rest:response>, "The requested resource is not available." }; Loading
max.xq +0 −15 Original line number Diff line number Diff line Loading @@ -355,18 +355,3 @@ declare %private function max:invokePluginXQueries($project, $routeDoc, $id){ catch * {max:max-error("Erreur code " || $err:code, $err:description,$err:module, $err:line-number)} }; (:declare:) (:%rest:GET:) (:%rest:path("/{$projectId}/test/fop"):) (:%rest:produces("application/pdf"):) (:function max:testFOP($projectId){:) (: let $xml := (doc('fop/exemple.xml')/*)[1]:) (: let $pdf := max.util:xml2pdf($xml, max.util:getProjectFoXsl($projectId)):) (: return:) (: (<rest:response>:) (: <http:response status="200">:) (: <http:header name="content-type" value="application/pdf"/>:) (: </http:response>:) (: </rest:response>,:) (: $pdf):) (:};:) No newline at end of file
rxq/file.xqm +3 −2 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ module namespace max.file = 'pddn/max/file'; import module namespace max.util = 'pddn/max/util' at 'util.xqm'; import module namespace max.cons = 'pddn/max/cons' at 'cons.xqm'; (: Project's UI file: css, js, image ... :) Loading @@ -17,7 +18,7 @@ function max.file:projectUIFile( return if (file:exists($path)) then max.util:rawFile($path) else () else max.util:error404() }; (: Loading @@ -31,7 +32,7 @@ function max.file:UIFile( return if (file:exists($path)) then max.util:rawFile($path) else () else max.util:error404() }; (: Loading
rxq/util.xqm +13 −0 Original line number Diff line number Diff line Loading @@ -341,4 +341,17 @@ declare function max.util:getDefaultTextXSL($project as xs:string) as xs:string{ return max.util:maxHome() || "/ui/xsl/" || $env || "/" || $env || ".xsl" }; (: Returns 404 response :) declare %output:method("text") %rest:path("") function max.util:error404() { <rest:response> <http:response status="404"> <http:header name="Content-Language" value="en"/> <http:header name="Content-Type" value="text/plain; charset=utf-8"/> </http:response> </rest:response>, "The requested resource is not available." };