From 1f4fa6ce005aec73cb9f5d816b38848ef690071a Mon Sep 17 00:00:00 2001 From: Joseph Bryan Date: Thu, 12 Feb 2015 13:24:26 -0500 Subject: [PATCH] add support for the ml8 REST rewriter (fixes #370) --- deploy/lib/server_config.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/deploy/lib/server_config.rb b/deploy/lib/server_config.rb index 7639d43a..9060defc 100644 --- a/deploy/lib/server_config.rb +++ b/deploy/lib/server_config.rb @@ -206,9 +206,11 @@ def self.init properties_file.gsub!(/rewrite-resolves-globally=/, "rewrite-resolves-globally=true") end + # rest applications don't use Roxy's MVC structure, so they can use MarkLogic's rewriter and error handler if app_type == "rest" - # rest applications don't use Roxy's MVC structure, so they can use MarkLogic's rewriter and error handler - properties_file.gsub!(/url-rewriter=\/roxy\/rewrite.xqy/, "url-rewriter=/MarkLogic/rest-api/rewriter.xqy") + # ML8 rest uses the new native rewriter + rewriter_name = (server_version == "8") ? "rewriter.xml" : "rewriter.xqy" + properties_file.gsub!(/url-rewriter=\/roxy\/rewrite.xqy/, "url-rewriter=/MarkLogic/rest-api/" + rewriter_name) properties_file.gsub!(/error-handler=\/roxy\/error.xqy/, "error-handler=/MarkLogic/rest-api/error-handler.xqy") end @@ -1020,7 +1022,7 @@ def settings } end end - + private def save_files_to_fs(target_db, target_dir) @@ -1185,7 +1187,7 @@ def deploy_src logger.info "Skipping deployment of src to #{dest_db}.." break end - + ignore_us = [] ignore_us << "^#{test_dir}.*$" unless test_dir.blank? || deploy_tests?(dest_db) ignore_us << "^#{app_config_file}$"