Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
#63 Load HTML modules as XML. Otherwise, MarkLogic doesn't recognize …
Browse files Browse the repository at this point in the history
…index.html and you get a blank page.
  • Loading branch information
dmcassel committed Mar 19, 2013
1 parent 5a0bcd1 commit c83fc3a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions deploy/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ content-forests-per-host=1
bootstrap-port-five=8002
bootstrap-port-four=8000

#
# If true, .html files under the src directory will be loaded as XML.
# If false, they will be loaded using the MarkLogic default behavior, which is
# to treat them as text.
#
load-html-as-xml=true

#
# The ports used by your application
#
Expand Down
4 changes: 3 additions & 1 deletion deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@ def deploy_modules
# modules_db = @properties['ml.modules-db']
app_config_file = File.join xquery_dir, "/app/config/config.xqy"
test_config_file = File.join test_dir, "/test-config.xqy"
load_html_as_xml = @properties['ml.load-html-as-xml']

modules_databases.each do |dest_db|
ignore_us = []
Expand All @@ -689,7 +690,8 @@ def deploy_modules
:add_prefix => "/",
:remove_prefix => xquery_dir,
:db => dest_db,
:ignore_list => ignore_us
:ignore_list => ignore_us,
:load_html_as_xml => load_html_as_xml

if File.exist? app_config_file
buffer = File.read app_config_file
Expand Down
1 change: 1 addition & 0 deletions deploy/lib/xcc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def build_load_uri(target_uri, options, commit)
url << "&repair=none" if options[:repairlevel] == "none"
url << "&repair=full" if options[:repairlevel] == "full"

url << "&format=xml" if options[:load_html_as_xml] && target_uri["\.html"]
url << "&format=xml" if options[:format] == "xml"
url << "&format=text" if options[:format] == "text"
url << "&format=binary" if options[:format] == "binary"
Expand Down

0 comments on commit c83fc3a

Please sign in to comment.