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

First stab at #808: accept unwrapped config parts, replace ml-config.xml with ml-config/ #813

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
297 changes: 182 additions & 115 deletions deploy/lib/server_config.rb

Large diffs are not rendered by default.

394 changes: 281 additions & 113 deletions deploy/lib/xquery/setup.xqy

Large diffs are not rendered by default.

231 changes: 231 additions & 0 deletions deploy/sample/ml-config.sample/databases/content-db.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
<!--Application Database Configuration-->
<database xmlns="http://marklogic.com/xdmp/database">
<database-name>${content-db}</database-name>
<forests-per-host>${content-forests-per-host}</forests-per-host>
@ml.schemas-mapping
@ml.triggers-mapping
<forests>
<forest-id name="${content-db}"/>
@ml.forest-data-dir-xml
</forests>

<!-- See sample/default-docs-config.sample.xml for default settings and indexes of Documents database -->

<uri-lexicon>true</uri-lexicon>
<collection-lexicon>true</collection-lexicon>
<directory-creation>manual</directory-creation>
<maintain-last-modified>false</maintain-last-modified>
<!--
<fragment-roots>
<fragment-root>
<namespace-uri>http://www.marklogic.com/ns/sample</namespace-uri>
<localname>frag-root</localname>
</fragment-root>
</fragment-roots>
<fragment-parents>
<fragment-parent>
<namespace-uri>http://www.marklogic.com/ns/sample</namespace-uri>
<localname>frag-parents</localname>
</fragment-parent>
</fragment-parents>
-->
<!--
<fields>
<field>
<field-name></field-name>
<field-path>
<path>some/xpath</path>
<weight>1.0</weight>
</field-path>
<word-lexicons/>
<included-elements/>
<excluded-elements/>
<tokenizer-overrides/>
<stemmed-searches>basic</stemmed-searches>
<fast-phrase-searches>true</fast-phrase-searches>
<fast-case-sensitive-searches>true</fast-case-sensitive-searches>
<fast-diacritic-sensitive-searches>true</fast-diacritic-sensitive-searches>
</field>
<field>
<field-name/>
<include-root>true</include-root>
<fast-case-sensitive-searches>false</fast-case-sensitive-searches>
<fast-diacritic-sensitive-searches>false</fast-diacritic-sensitive-searches>
<fast-phrase-searches>false</fast-phrase-searches>
<one-character-searches>false</one-character-searches>
<stemmed-searches>basic</stemmed-searches>
<three-character-searches>false</three-character-searches>
<three-character-word-positions>false</three-character-word-positions>
<trailing-wildcard-searches>false</trailing-wildcard-searches>
<trailing-wildcard-word-positions>false</trailing-wildcard-word-positions>
<two-character-searches>false</two-character-searches>
<value-positions>false</value-positions>
<value-searches>false</value-searches>
<word-searches>false</word-searches>
<word-lexicons/>
<included-elements>
<included-element>
<namespace-uri>http://ns.com</namespace-uri>
<localname>blah</localname>
<weight>1.0</weight>
<attribute-namespace-uri/>
<attribute-localname/>
<attribute-value/>
</included-element>
</included-elements>
<excluded-elements/>
</field>
</fields>
-->
<range-element-indexes>
<!--
Sample for:
<name xmlns="http://marklogic.com/ns/sample">bob<name>

<range-element-index>
<scalar-type>string</scalar-type>
<namespace-uri>http://marklogic.com/ns/sample</namespace-uri>
<localname>name</localname>
<collation>http://marklogic.com/collation/codepoint</collation>
<range-value-positions>false</range-value-positions>
</range-element-index>
-->
</range-element-indexes>
<range-element-attribute-indexes>
<!--
Sample for:
<person name="bob" xmlns="http://marklogic.com/ns/sample"/>

<range-element-attribute-index>
<scalar-type>string</scalar-type>
<parent-namespace-uri>http://marklogic.com/ns/sample</parent-namespace-uri>
<parent-localname>person</parent-localname>
<namespace-uri/>
<localname>name</localname>
<collation>http://marklogic.com/collation/codepoint</collation>
<range-value-positions>false</range-value-positions>
</range-element-attribute-index>
-->
</range-element-attribute-indexes>
<range-field-indexes>
<!--
<range-field-index>
<scalar-type>date</scalar-type>
<field-name>sample</field-name>
<collation/>
<range-value-positions>false</range-value-positions>
<invalid-values>ignore</invalid-values>
</range-field-index>
-->
</range-field-indexes>

<path-namespaces>
<!--
<path-namespace>
<prefix>sample</prefix>
<namespace-uri>http://marklogic.com/ns/sample</namespace-uri>
</path-namespace>
-->
</path-namespaces>

<range-path-indexes>
<!--
<range-path-index>
<scalar-type>string</scalar-type>
<collation>http://marklogic.com/collation/codepoint</collation>
<path-expression>/sample:root/sample:child</path-expression>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</range-path-index>
-->
</range-path-indexes>

<geospatial-element-indexes>
<!--
<geospatial-element-index>
<namespace-uri>http://www.marklogic.com/ns/sample</namespace-uri>
<localname>geo-element</localname>
<coordinate-system>wgs84</coordinate-system>
<point-format>point</point-format>
<range-value-positions>false</range-value-positions>
<invalid-values>reject</invalid-values>
</geospatial-element-index>
-->
</geospatial-element-indexes>

<geospatial-element-attribute-pair-indexes>
<!--
Sample for:
<geo lat="37.237162" lon="-115.8099747" xmlns="http://marklogic.com/ns/sample"/>

<geospatial-element-attribute-pair-index>
<parent-namespace-uri>http://marklogic.com/ns/sample</parent-namespace-uri>
<parent-localname>geo</parent-localname>
<latitude-namespace-uri/>
<latitude-localname>lat</latitude-localname>
<longitude-namespace-uri/>
<longitude-localname>lon</longitude-localname>
<coordinate-system>wgs84</coordinate-system>
<range-value-positions>false</range-value-positions>
</geospatial-element-attribute-pair-index>
-->
</geospatial-element-attribute-pair-indexes>
<geospatial-element-pair-indexes>
<!--
Sample for:
<geo xmlns="http://marklogic.com/ns/sample">
<lat>37.237162</lat>
<lon>-115.8099747</lon>
</geo>

<geospatial-element-pair-index>
<parent-namespace-uri>http://marklogic.com/ns/sample</parent-namespace-uri>
<parent-localname>geo</parent-localname>
<latitude-namespace-uri>http://marklogic.com/ns/sample</latitude-namespace-uri>
<latitude-localname>lat</latitude-localname>
<longitude-namespace-uri>http://marklogic.com/ns/sample</longitude-namespace-uri>
<longitude-localname>lon</longitude-localname>
<coordinate-system>wgs84</coordinate-system>
<range-value-positions>true</range-value-positions>
</geospatial-element-pair-index>
-->
</geospatial-element-pair-indexes>
<geospatial-element-child-indexes>
<!--
Sample for:
<geo xmlns="http://marklogic.com/ns/sample">
<pos>37.237162,-115.8099747</pos>
</geo>

<geospatial-element-child-index>
<parent-namespace-uri>http://marklogic.com/ns/sample</parent-namespace-uri>
<parent-localname>geo</parent-localname>
<namespace-uri>http://marklogic.com/ns/sample</namespace-uri>
<localname>pos</localname>
<coordinate-system>wgs84</coordinate-system>
<point-format>point</point-format>
<range-value-positions>false</range-value-positions>
</geospatial-element-child-index>
-->
</geospatial-element-child-indexes>
<element-word-lexicons>
<!--
<element-word-lexicon>
<namespace-uri>http://www.marklogic.com/ns/sample</namespace-uri>
<localname>sample-element</localname>
<collation>http://marklogic.com/collation/</collation>
</element-word-lexicon>
-->
</element-word-lexicons>
<element-attribute-word-lexicons>
<!--
<element-attribute-word-lexicon>
<parent-namespace-uri>http://www.marklogic.com/ns/sample</parent-namespace-uri>
<parent-localname>sample-element</parent-localname>
<namespace-uri/>
<localname>sample-attribute</localname>
<collation>http://marklogic.com/collation/</collation>
</element-attribute-word-lexicon>
-->
</element-attribute-word-lexicons>
</database>
32 changes: 32 additions & 0 deletions deploy/sample/ml-config.sample/databases/modules-db.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--Create Application Modules Database-->
<database xmlns="http://marklogic.com/xdmp/database">
<database-name>${modules-db}</database-name>
<forests>
<forest-id name="${modules-db}"/>
</forests>
<stemmed-searches>off</stemmed-searches>
<word-searches>false</word-searches>
<word-positions>false</word-positions>
<fast-phrase-searches>false</fast-phrase-searches>
<fast-reverse-searches>false</fast-reverse-searches>
<fast-case-sensitive-searches>false</fast-case-sensitive-searches>
<fast-diacritic-sensitive-searches>false</fast-diacritic-sensitive-searches>
<fast-element-word-searches>false</fast-element-word-searches>
<element-word-positions>false</element-word-positions>
<fast-element-phrase-searches>false</fast-element-phrase-searches>
<element-value-positions>false</element-value-positions>
<attribute-value-positions>false</attribute-value-positions>
<three-character-searches>false</three-character-searches>
<three-character-word-positions>false</three-character-word-positions>
<fast-element-character-searches>false</fast-element-character-searches>
<trailing-wildcard-searches>false</trailing-wildcard-searches>
<trailing-wildcard-word-positions>false</trailing-wildcard-word-positions>
<fast-element-trailing-wildcard-searches>false</fast-element-trailing-wildcard-searches>
<word-lexicons/>
<two-character-searches>false</two-character-searches>
<one-character-searches>false</one-character-searches>
<uri-lexicon>true</uri-lexicon>
<collection-lexicon>false</collection-lexicon>
<directory-creation>automatic</directory-creation>
<maintain-last-modified>false</maintain-last-modified>
</database>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@ml.rest-modules-db-xml
1 change: 1 addition & 0 deletions deploy/sample/ml-config.sample/databases/schemas-db.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@ml.schemas-db-xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@ml.test-content-db-xml
2 changes: 2 additions & 0 deletions deploy/sample/ml-config.sample/databases/test-modules-db.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!--Create Test Modules Database-->
@ml.test-modules-db-xml
2 changes: 2 additions & 0 deletions deploy/sample/ml-config.sample/databases/triggers-db.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!--Create a Triggers Database-->
@ml.triggers-db-xml
17 changes: 17 additions & 0 deletions deploy/sample/ml-config.sample/forests/forests.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<configuration default-group="${group}">
<!--Assignments-->
<assignments xmlns="http://marklogic.com/xdmp/assignments" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://marklogic.com/xdmp/assignments assignments.xsd">
<assignment>
<forest-name>${content-db}</forest-name>
@ml.forest-data-dir-xml
</assignment>
@ml.test-content-db-assignment
@ml.test-modules-db-assignment
@ml.rest-modules-db-assignment
<assignment>
<forest-name>${modules-db}</forest-name>
</assignment>
@ml.schemas-assignment
@ml.triggers-assignment
</assignments>
</configuration>
13 changes: 13 additions & 0 deletions deploy/sample/ml-config.sample/groups/default-group.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<configuration default-group="${group}">
<!--
default-group applies to databases

${group} defaults to "Default", you can override in build.properties or {env}.properties
Note: if you change ml.group, make sure to assign hosts to it! See <hosts> below.
-->
<groups xmlns="http://marklogic.com/xdmp/group">
<group>
<group-name>${group}</group-name>
</group>
</groups>
</configuration>
4 changes: 4 additions & 0 deletions deploy/sample/ml-config.sample/hosts/bootstrap-host.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<host xmlns="http://marklogic.com/xdmp/hosts">
<host-name>@ml.server-name</host-name>
<group name="${group}"/>
</host>
12 changes: 12 additions & 0 deletions deploy/sample/ml-config.sample/security/amps/sample-amp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--
Sample amp. See the Understanding and Using Security Guide section 5.2 for
information about amps.
http://community.marklogic.com/pubs/5.0/books/security.pdf
-->
<amp xmlns="http://marklogic.com/xdmp/security">
<namespace>http://marklogic.com/roxy</namespace>
<local-name>sample</local-name>
<doc-uri>/app/models/sample.xqy</doc-uri>
<db-name>${modules-db}</db-name>
<role-name>${app-role}</role-name>
</amp>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!--
SSL Certificate, automatically inserted if ssl properties are enabled in build or env properties
-->
<certificates xmlns="http://marklogic.com/xdmp/pki">
@ml.ssl-certificate-xml
</certificates>
4 changes: 4 additions & 0 deletions deploy/sample/ml-config.sample/security/credentials.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<credentials xmlns="http://marklogic.com/xdmp/security">
<aws-access-key>1234abc</aws-access-key>
<aws-secret-key>1234abc</aws-secret-key>
</credentials>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!--
Sample security
-->
<external-security xmlns="http://marklogic.com/xdmp/security">
<external-security-name>test</external-security-name>
<description>a big test</description>
<authentication>ldap</authentication>
<cache-timeout>300</cache-timeout>
<authorization>ldap</authorization>
<ldap-server-uri>ldap://dc1.mltest1.local:389</ldap-server-uri>
<ldap-base>CN=Users,DC=MLTEST1,DC=LOCAL</ldap-base>
<ldap-attribute>sAMAccountName</ldap-attribute>
<ldap-default-user/>
<ldap-password/>
</external-security>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!--
Sample mimetype.
-->
<mimetype xmlns="http://marklogic.com/xdmp/mimetypes">
<name>application/crazy</name>
<extension>crazy stuff</extension>
<format>text</format>
</mimetype>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!--
Sample execute privilege.
-->
<privilege xmlns="http://marklogic.com/xdmp/security">
<privilege-name>my-action</privilege-name>
<action>http://marklogic.com/custom/privilege/my-action</action>
<kind>execute</kind>
</privilege>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!--
Sample URI privilege.
-->
<privilege xmlns="http://marklogic.com/xdmp/security">
<privilege-name>users-uri</privilege-name>
<action>/users/</action>
<kind>uri</kind>
</privilege>
Loading