Loading plugins/sources_export/sources_export.xqm +9 −4 Original line number Diff line number Diff line Loading @@ -6,12 +6,16 @@ import module namespace max.config = 'pddn/max/config' at '../../rxq/config.xqm' declare %rest:GET %output:media-type('application/octet-stream') %rest:path("/{$project}/export") function max.plugin.sources_export:export($project){ %output:media-type("application/octet-stream") %rest:path("/{$project}/{$archive}.zip") function max.plugin.sources_export:export($project, $archive){ if($project != $archive) then fn:error(xs:QName("err:sources_export"), "Archive does not exist : '" || $archive||".zip'") else let $db := max.config:getProjectDBPath($project) let $tmpDir := file:create-temp-dir('max-export',$project) let $zipName := $project||'.zip' let $tmpDir := file:create-temp-dir('max-export',$project) let $dest := $tmpDir ||'/'||$zipName return ( db:export($db, $tmpDir), Loading @@ -26,6 +30,7 @@ function max.plugin.sources_export:export($project){ ), file:delete($tmpDir,true()) ) }; declare %private function max.plugin.sources_export:makeZip($project,$directory, $dest){ Loading Loading
plugins/sources_export/sources_export.xqm +9 −4 Original line number Diff line number Diff line Loading @@ -6,12 +6,16 @@ import module namespace max.config = 'pddn/max/config' at '../../rxq/config.xqm' declare %rest:GET %output:media-type('application/octet-stream') %rest:path("/{$project}/export") function max.plugin.sources_export:export($project){ %output:media-type("application/octet-stream") %rest:path("/{$project}/{$archive}.zip") function max.plugin.sources_export:export($project, $archive){ if($project != $archive) then fn:error(xs:QName("err:sources_export"), "Archive does not exist : '" || $archive||".zip'") else let $db := max.config:getProjectDBPath($project) let $tmpDir := file:create-temp-dir('max-export',$project) let $zipName := $project||'.zip' let $tmpDir := file:create-temp-dir('max-export',$project) let $dest := $tmpDir ||'/'||$zipName return ( db:export($db, $tmpDir), Loading @@ -26,6 +30,7 @@ function max.plugin.sources_export:export($project){ ), file:delete($tmpDir,true()) ) }; declare %private function max.plugin.sources_export:makeZip($project,$directory, $dest){ Loading