http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/configuration-installer-factory.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/configuration-installer-factory.html b/documentation/bundles/configuration-installer-factory.html index 67aa156..21222b3 100644 --- a/documentation/bundles/configuration-installer-factory.html +++ b/documentation/bundles/configuration-installer-factory.html @@ -2,42 +2,62 @@ <head> <meta charset="utf-8"/> <title>Apache Sling on JBake</title> - <link rel="stylesheet" href="/res/css/site.css"/> - <link rel="stylesheet" href="/res/css/codehilite.css"/> + <link rel="stylesheet" href="/ng/res/css/site.css"/> + <link rel="icon" href="/ng/res/favicon.ico"/> <div class="title"> <div class="logo"> <a href="http://sling.apache.org"> - <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/> + <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/> </a> </div><div class="header"> <a href="http://www.apache.org"> - <img border="0" alt="Apache" src="/res/logos/apache.png"/> + <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/> </a> </div> </div> </head><body> <div class="menu"> - <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong> + <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p ><strong>Project info</strong><br/><a >href="/ng/downloads.cgi">Downloads</a><br/><a >href="http://www.apache.org/licenses/">License</a><br/><a >href="/ng/contributing.html">Contributing</a><br/><a >href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a >href="/ng/project-information.html">Project Information</a><br/><a >href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a >href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a >href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a > href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a >href="git://git.apache.org/sling.git">Git</a><br/><a >href="https://github.com/apache/sling">Github >Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a >href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a >href="http://www.apache.org/foundation/sponsorship.html">Become a >Sponsor</a><br/><a href="https://donate.apache. org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong> </div> <div class="main"> <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Configuration Installer Factory</h1></header><p>The configuration installer factory provides support for configurations to the <a href="/documentation/bundles/osgi-installer.html">OSGI installer</a>. The provisioning of artifacts is handled by installer providers like the file installer or the JCR installer.</p> <h2>Configurations</h2> <p>Configuration file names are related to the PID and factory PID. The structure of the file name is as follows:</p> -<p>filename ::= <pid> ( '-' <subname> )? ('.cfg'|'.config')</p> +<pre><code>filename ::= <pid> ( '-' <subname> )? ('.cfg'|'.config') +</code></pre> <p>If the form is <code><pid>('.cfg'|'.config')</code>, the file contains the properties for a Managed Service. The <code><pid></code> is then the PID of the Managed Service. See the Configuration Admin service for details.</p> <p>When a Managed Service Factory is used, the situation is different. The <code><pid></code> part then describes the PID of the Managed Service Factory. You can pick any <code><subname></code>, the installer will then create an instance for the factory for each unique name. For example:</p> -<p>com.acme.xyz.cfg // configuration for Managed Service // com.acme.xyz com.acme.abc-default.cfg // Managed Service Factory, // creates an instance for com.acme.abc</p> +<pre><code>com.acme.xyz.cfg // configuration for Managed Service +// com.acme.xyz +com.acme.abc-default.cfg // Managed Service Factory, +// creates an instance for com.acme.abc +</code></pre> <p>If a configuration is modified, the file installer will write the configuration back to a file to ensure peristence across restarts (if <code>sling.fileinstall.writeback</code> is enabled).</p> <h3>Property Files (.cfg)</h3> <p>Configuration files ending in '.cfg' are plain property files (<code>java.util.Property</code>). The format is simple:</p> -<p>file ::= ( header | comment ) * header ::= <header> ( ':' | '=' ) <value> ( '<nl> <value> ) * comment ::= '#' <any></p> +<pre><code>file ::= ( header | comment ) * +header ::= <header> ( ':' | '=' ) <value> ( '\<nl> <value> ) * +comment ::= '#' <any> +</code></pre> <p>Notice that this model only supports string properties. For example:</p> -<h1>default port</h1> -<p>ftp.port = 21</p> +<pre><code># default port +ftp.port = 21 +</code></pre> <h3>Configuration Files (.config)</h3> <p>Configuration files ending in '.config' use the format of the Apache Felix ConfigAdmin implementation. It allows to specify the type and cardinality of a configuration property and is not limited to string values.</p> <p>The first line of such a file might start with a comment line (a line starting with a #). Comments within the file are not allowed.</p> <p>The format is:</p> -<p>file ::= (comment) (header) * comment ::= '#' <any> header ::= prop '=' value prop ::= symbolic-name // 1.4.2 of OSGi Core Specification symbolic-name ::= token { '.' token } token ::= { [ 0..9 ] | [ a..z ] | [ A..Z ] | '_' | '-' } value ::= [ type ] ( '[' values ']' | '(' values ')' | simple ) values ::= simple { ',' simple } simple ::= '"' stringsimple '"' type ::= <1-char type code> stringsimple ::= <quoted string representation of the value where both '"' and '=' need to be escaped></p> +<pre><code>file ::= (comment) (header) * +comment ::= '#' <any> +header ::= prop '=' value +prop ::= symbolic-name // 1.4.2 of OSGi Core Specification +symbolic-name ::= token { '.' token } +token ::= { [ 0..9 ] | [ a..z ] | [ A..Z ] | '_' | '-' } +value ::= [ type ] ( '[' values ']' | '(' values ')' | simple ) +values ::= simple { ',' simple } +simple ::= '"' stringsimple '"' +type ::= <1-char type code> +stringsimple ::= <quoted string representation of the value where both '"' and '=' need to be escaped> +</code></pre> <p>The quoted string format is equal to the definition from HTTP 1.1 (<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec2.html">RFC2616</a>), except that both '"' and '=' need to be escaped.</p> <p>The 1 character type code is one of:</p> <ul>
http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/content-distribution.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/content-distribution.html b/documentation/bundles/content-distribution.html index 2b490b0..84f77b5 100644 --- a/documentation/bundles/content-distribution.html +++ b/documentation/bundles/content-distribution.html @@ -2,22 +2,22 @@ <head> <meta charset="utf-8"/> <title>Apache Sling on JBake</title> - <link rel="stylesheet" href="/res/css/site.css"/> - <link rel="stylesheet" href="/res/css/codehilite.css"/> + <link rel="stylesheet" href="/ng/res/css/site.css"/> + <link rel="icon" href="/ng/res/favicon.ico"/> <div class="title"> <div class="logo"> <a href="http://sling.apache.org"> - <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/> + <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/> </a> </div><div class="header"> <a href="http://www.apache.org"> - <img border="0" alt="Apache" src="/res/logos/apache.png"/> + <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/> </a> </div> </div> </head><body> <div class="menu"> - <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong> + <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p ><strong>Project info</strong><br/><a >href="/ng/downloads.cgi">Downloads</a><br/><a >href="http://www.apache.org/licenses/">License</a><br/><a >href="/ng/contributing.html">Contributing</a><br/><a >href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a >href="/ng/project-information.html">Project Information</a><br/><a >href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a >href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a >href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a > href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a >href="git://git.apache.org/sling.git">Git</a><br/><a >href="https://github.com/apache/sling">Github >Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a >href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a >href="http://www.apache.org/foundation/sponsorship.html">Become a >Sponsor</a><br/><a href="https://donate.apache. org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong> </div> <div class="main"> <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Content Distribution (org.apache.sling.distribution)</h1></header><p>[TOC]</p> <h2>Introduction</h2> @@ -28,89 +28,170 @@ <p>A forward distribution setup allows one to transfer content from a source instance to a farm of target instances. That is done by pushing the content from source to target.</p> <h4>Setup overview</h4> <ul> - <li>one source instance</li> - <li>one distribution agent connected to importer endpoints for all target instances.</li> - <li>N target instances</li> - <li>one distribution importer on each target instance used to import packages into the local instance.</li> + <li>one source instance + <ul> + <li>one distribution agent connected to importer endpoints for all target instances.</li> + </ul> + </li> + <li>N target instances + <ul> + <li>one distribution importer on each target instance used to import packages into the local instance.</li> + </ul> + </li> </ul> <h4>Sample configuration</h4> <ul> - <li>on source instance: one forward agent</li> + <li> + <p>on source instance: one forward agent</p> + <pre><code>org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-publish.json + name="publish" + packageImporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/importers/default"] +</code></pre> + </li> + <li> + <p>on target instance: one local importer</p> + <pre><code>org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-default + name="default" +</code></pre> + </li> </ul> -<p>org.apache.sling.distribution.agent.impl.ForwardDistributionAgentFactory-publish.json name="publish" packageImporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/importers/default"]</p> -<ul> - <li>on target instance: one local importer</li> -</ul> -<p>org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-default name="default"</p> <h3>Reverse distribution</h3> <p>A reverse distribution setup allows one to transfer content from a farm of source instances to a target instance. That is done by pulling the content from source instances into the target instance.</p> <h4>Setup overview</h4> <ul> - <li>one target instance</li> - <li>one distribution agent connected to exporter endpoints for all target instances.</li> - <li>N source instances</li> - <li>one distribution (queue) agent on each source instance; changes from the source instances are placed in the queues of these agents.</li> - <li>one distribution exporter on each source instance that exports packages from the queue agent.</li> + <li>one target instance + <ul> + <li>one distribution agent connected to exporter endpoints for all target instances.</li> + </ul> + </li> + <li>N source instances + <ul> + <li>one distribution (queue) agent on each source instance; changes from the source instances are placed in the queues of these agents.</li> + <li>one distribution exporter on each source instance that exports packages from the queue agent.</li> + </ul> + </li> </ul> <h4>Sample configuration</h4> <ul> - <li>on target instance: one reverse agent</li> -</ul> -<p>org.apache.sling.distribution.agent.impl.ReverseDistributionAgentFactory-reverse.json name="reverse" packageExporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/exporters/reverse"]</p> -<ul> - <li>on source instance: one queue agent and one exporter for that agent</li> + <li> + <p>on target instance: one reverse agent</p> + <pre><code>org.apache.sling.distribution.agent.impl.ReverseDistributionAgentFactory-reverse.json + name="reverse" + packageExporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/exporters/reverse"] +</code></pre> + </li> + <li> + <p>on source instance: one queue agent and one exporter for that agent</p> + <pre><code>org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json + name="reverse" + +org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse + name="reverse" + agent.target="(name=reverse)" +</code></pre> + </li> </ul> -<p>org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json name="reverse"</p> -<p>org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse name="reverse" agent.target="(name=reverse)"</p> <h3>Sync distribution</h3> <p>A sync distribution setup allows one to synchronize content in a farm of instances. That is done by using a coordinator instance (typically an author instance) that pulls content from all instances in a farm and pushes it back to all.</p> <h4>Setup overview:</h4> <ul> - <li>one coordinator instance</li> - <li>one distribution agent connected to exporter/importer endpoints for all farm instances.</li> - <li>N farm instances</li> - <li>one distribution (queue) agent on each farm instance; changes from these instances are placed in the queues of the queue agents.</li> - <li>one distribution exporter on each farm instance that exports packages from the queue agent.</li> - <li>one distribution importer on each farm instance used to import packages into the local instance.</li> + <li>one coordinator instance + <ul> + <li>one distribution agent connected to exporter/importer endpoints for all farm instances.</li> + </ul> + </li> + <li>N farm instances + <ul> + <li>one distribution (queue) agent on each farm instance; changes from these instances are placed in the queues of the queue agents.</li> + <li>one distribution exporter on each farm instance that exports packages from the queue agent.</li> + <li>one distribution importer on each farm instance used to import packages into the local instance.</li> + </ul> + </li> </ul> <h4>Sample configuration</h4> <ul> - <li>on coordinator instance: one sync agent</li> + <li> + <p>on coordinator instance: one sync agent</p> + <pre><code>org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory-sync.json + name="sync" + packageExporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/exporters/reverse", "http://localhost:4504/libs/sling/distribution/services/exporters/reverse"] + packageImporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/importers/default", "http://localhost:4504/libs/sling/distribution/services/importers/default"] +</code></pre> + </li> + <li> + <p>on each farm instance: one local exporter and one local importer</p> + <pre><code>org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json + name="reverse" + +org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse + name="reverse" + agent.target="(name=reverse)" + +org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-default + name="reverse" + agent.target="(name=reverse)" +</code></pre> + </li> </ul> -<p>org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory-sync.json name="sync" packageExporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/exporters/reverse", "http://localhost:4504/libs/sling/distribution/services/exporters/reverse"] packageImporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/importers/default", "http://localhost:4504/libs/sling/distribution/services/importers/default"]</p> -<ul> - <li>on each farm instance: one local exporter and one local importer</li> -</ul> -<p>org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json name="reverse"</p> -<p>org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse name="reverse" agent.target="(name=reverse)"</p> -<p>org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-default name="reverse" agent.target="(name=reverse)"</p> <h3>Multidatacenter sync distribution</h3> <p>A multidatacenter sync distribution setup allows one to synchronize content in a farm of publish instances across datacenters. This a variation of sync distribution but using a coordinator in each datacenter.</p> <h4>Setup overview</h4> <ul> - <li>one coordinator instance in each datacenter</li> - <li>one distribution agent for intra-datacenter synchronization. Like a regular sync agent it connects to all farm instances in its datacenter and syncronizes them. In addition to a regular sync agent it keeps the packages also in dedicated queues for the other DCs, so that the coordinators from the other DCs can pull the updates.</li> - <li>one distribution exporter for each queue dedicated for the remote DCs. The inter-dc coordinators from the other DCs will connect to these exporter endpoints.</li> - <li>one distribution agent for inter-datacenter synchronization; it conntects to the dedicated queues exposed by intra-dc coordinators from the other datacenters.</li> - <li>N farm instances in each datacenter</li> - <li>one distribution (queue) agent on each farm instance; changes from these instances are placed in the queues of the queue agents.</li> - <li>one distribution exporter on each farm instance that exports packages from the queue agent.</li> - <li>one distribution importer on each farm instance used to import packages into the local instance.</li> + <li>one coordinator instance in each datacenter + <ul> + <li>one distribution agent for intra-datacenter synchronization. Like a regular sync agent it connects to all farm instances in its datacenter and syncronizes them. In addition to a regular sync agent it keeps the packages also in dedicated queues for the other DCs, so that the coordinators from the other DCs can pull the updates.</li> + <li>one distribution exporter for each queue dedicated for the remote DCs. The inter-dc coordinators from the other DCs will connect to these exporter endpoints.</li> + <li>one distribution agent for inter-datacenter synchronization; it conntects to the dedicated queues exposed by intra-dc coordinators from the other datacenters.</li> + </ul> + </li> + <li>N farm instances in each datacenter + <ul> + <li>one distribution (queue) agent on each farm instance; changes from these instances are placed in the queues of the queue agents.</li> + <li>one distribution exporter on each farm instance that exports packages from the queue agent.</li> + <li>one distribution importer on each farm instance used to import packages into the local instance.</li> + </ul> + </li> </ul> <h4>Sample configuration</h4> <ul> - <li>on coordinator instance: one intradcsync agent with two exporters for the other dcs, and one interdcsync agent that connects to remote exporters.</li> -</ul> -<p>org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory-intradcsync name="intradcsync" packageExporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/exporters/reverse", "http://localhost:4504/libs/sling/distribution/services/exporters/reverse"] packageImporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/importers/default", "http://localhost:4504/libs/sling/distribution/services/importers/default"] passiveQueues=["dc2queue", "dc3queue"]</p> -<p>org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-dc2queue name="dc2queue" agent.target="(name=intradcsync)" queue="dc2queue"</p> -<p>org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-dc3queue name="dc3queue" agent.target="(name=intradcsync)" queue="dc3queue"</p> -<p>org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory-interdcsync name="interdcsync" packageExporter.endpoints=["http://localhost:5502/libs/sling/distribution/services/exporters/dc1queue", "http://localhost:6502/libs/sling/distribution/services/exporters/dc1queue"] packageImporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/importers/default", "http://localhost:4504/libs/sling/distribution/services/importers/default"]</p> -<ul> - <li>on each farm instance: one local exporter and one local importer</li> + <li> + <p>on coordinator instance: one intradcsync agent with two exporters for the other dcs, and one interdcsync agent that connects to remote exporters.</p> + <pre><code>org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory-intradcsync + name="intradcsync" + packageExporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/exporters/reverse", "http://localhost:4504/libs/sling/distribution/services/exporters/reverse"] + packageImporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/importers/default", "http://localhost:4504/libs/sling/distribution/services/importers/default"] + passiveQueues=["dc2queue", "dc3queue"] + +org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-dc2queue + name="dc2queue" + agent.target="(name=intradcsync)" + queue="dc2queue" + +org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-dc3queue + name="dc3queue" + agent.target="(name=intradcsync)" + queue="dc3queue" + +org.apache.sling.distribution.agent.impl.SyncDistributionAgentFactory-interdcsync + name="interdcsync" + packageExporter.endpoints=["http://localhost:5502/libs/sling/distribution/services/exporters/dc1queue", "http://localhost:6502/libs/sling/distribution/services/exporters/dc1queue"] + packageImporter.endpoints=["http://localhost:4503/libs/sling/distribution/services/importers/default", "http://localhost:4504/libs/sling/distribution/services/importers/default"] +</code></pre> + </li> + <li> + <p>on each farm instance: one local exporter and one local importer</p> + <pre><code>org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json + name="reverse" + +org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse + name="reverse" + agent.target="(name=reverse)" + +org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-default + name="default" +</code></pre> + </li> </ul> -<p>org.apache.sling.distribution.agent.impl.QueueDistributionAgentFactory-reverse.json name="reverse"</p> -<p>org.apache.sling.distribution.packaging.impl.exporter.AgentDistributionPackageExporterFactory-reverse name="reverse" agent.target="(name=reverse)"</p> -<p>org.apache.sling.distribution.packaging.impl.importer.LocalDistributionPackageImporterFactory-default name="default"</p> <h2>Additional options</h2> <h3>How to trigger distribution over HTTP?</h3> <h3>How to configure binary-less distribution?</h3> http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/content-loading-jcr-contentloader.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/content-loading-jcr-contentloader.html b/documentation/bundles/content-loading-jcr-contentloader.html index f9f5b5a..5651271 100644 --- a/documentation/bundles/content-loading-jcr-contentloader.html +++ b/documentation/bundles/content-loading-jcr-contentloader.html @@ -2,22 +2,22 @@ <head> <meta charset="utf-8"/> <title>Apache Sling on JBake</title> - <link rel="stylesheet" href="/res/css/site.css"/> - <link rel="stylesheet" href="/res/css/codehilite.css"/> + <link rel="stylesheet" href="/ng/res/css/site.css"/> + <link rel="icon" href="/ng/res/favicon.ico"/> <div class="title"> <div class="logo"> <a href="http://sling.apache.org"> - <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/> + <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/> </a> </div><div class="header"> <a href="http://www.apache.org"> - <img border="0" alt="Apache" src="/res/logos/apache.png"/> + <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/> </a> </div> </div> </head><body> <div class="menu"> - <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong> + <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p ><strong>Project info</strong><br/><a >href="/ng/downloads.cgi">Downloads</a><br/><a >href="http://www.apache.org/licenses/">License</a><br/><a >href="/ng/contributing.html">Contributing</a><br/><a >href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a >href="/ng/project-information.html">Project Information</a><br/><a >href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a >href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a >href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a > href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a >href="git://git.apache.org/sling.git">Git</a><br/><a >href="https://github.com/apache/sling">Github >Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a >href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a >href="http://www.apache.org/foundation/sponsorship.html">Become a >Sponsor</a><br/><a href="https://donate.apache. org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong> </div> <div class="main"> <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Content Loading and Nodetype Support (jcr.contentloader)</h1></header><p>Apache Sling provides support for initial content loading into a repository and for registering node types. The <code>sling-jcr-contentloader</code> bundle provides loading of content from a bundle into the repository and the <code>sling-jcr-base</code> bundle provides node type registration.</p> <h2>Initial Content Loading</h2> @@ -156,86 +156,171 @@ <p>The MIME type is derived from the file name extension by first trying to resolve it from the Bundle entry URL. If this does not resolve to a MIME type, the Sling MIME type resolution service is used to try to find a mime type. If all fals, the MIME type is defaulted to "application/octet-stream". </p> <h3>XML Descriptor Files</h3> <p>Nodes, Properties and in fact complete subtrees may be described in XML files using either the JCR SystemView format, or the format described below. In either case, the file must have the .xml extension.</p> -<p><node> <!-- -optional on top level, defaults to XML file name without .xml extension -required for child nodes ---> <name>xyz</name></p> -<!-- -optional, defaults to nt:unstructured ---> -<p><primaryNodeType>nt:file</primaryNodeType></p> -<!-- -optional mixin node type -may be repeated for multiple mixin node types ---> -<p><mixinNodeType>mix:versionable</mixinNodeType> <mixinNodeType>mix:lockable</mixinNodeType></p> -<!-- -Optional properties for the node. Each <property> element defines -a single property of the node. The element may be repeated. ---> -<p><property> <!-- -required property name ---> <name>prop</name></p> -<!-- -value of the property. -For multi-value properties, the values are defined by multiple -<value> elements nested inside a <values> element instead of a -single <value> element ---> -<p><value>property value as string</value></p> -<!-- -Optional type of the property value, defaults to String. -This must be one of the property type strings defined in the -JCR PropertyType interface. ---> -<p><type>String</type> </property></p> -<!-- -Additional child nodes. May be further nested. ---> -<p><node> .... </node> </node></p> +<pre><code><node> + <!-- + optional on top level, defaults to XML file name without .xml extension + required for child nodes + --> + <name>xyz</name> + + <!-- + optional, defaults to nt:unstructured + --> + <primaryNodeType>nt:file</primaryNodeType> + + <!-- + optional mixin node type + may be repeated for multiple mixin node types + --> + <mixinNodeType>mix:versionable</mixinNodeType> + <mixinNodeType>mix:lockable</mixinNodeType> + + <!-- + Optional properties for the node. Each <property> element defines + a single property of the node. The element may be repeated. + --> + <property> + <!-- + required property name + --> + <name>prop</name> + + <!-- + value of the property. + For multi-value properties, the values are defined by multiple + <value> elements nested inside a <values> element instead of a + single <value> element + --> + <value>property value as string</value> + + <!-- + Optional type of the property value, defaults to String. + This must be one of the property type strings defined in the + JCR PropertyType interface. + --> + <type>String</type> + </property> + + <!-- + Additional child nodes. May be further nested. + --> + <node> + .... + </node> +</node> +</code></pre> <h4>Using a custom XML format</h4> -<p>By writing an XSLT stylesheet file, you can use whatever XML format you prefer. The XML file references an XSLT stylesheet by using the xml-stylesheet processing instruction:</p> -<p><?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="my-transform.xsl" type="text/xsl"?> <!-- The path to my-transform.xsl is relative to this file --></p> -<p><your_custom_root_node> <your_custom_element> ... </your_custom_element> ... </your_custom_root_node></p> +<p>By writing an XSLT stylesheet file, you can use whatever XML format you prefer. The XML file references an XSLT stylesheet by using the xml-stylesheet processing instruction: </p> +<pre><code><?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet href="my-transform.xsl" type="text/xsl"?> <!-- The path to my-transform.xsl is relative to this file --> + +<your_custom_root_node> + <your_custom_element> + ... + </your_custom_element> +... +</your_custom_root_node> +</code></pre> <p>The my-transform.xsl file is then responsible for translating your format into one of the supported XML formats:</p> -<p><xsl:stylesheet version="1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:rep="internal" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"></p> -<p><xsl:template match="your_custom_element"> <node> ... </node> </xsl:template> ... </xsl:stylesheet></p> +<pre><code><xsl:stylesheet version="1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" + xmlns:sv="http://www.jcp.org/jcr/sv/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0" + xmlns:rep="internal" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + <xsl:template match="your_custom_element"> + <node> + ... + </node> + </xsl:template> + ... +</xsl:stylesheet> +</code></pre> <h3>JSON Descriptor Files</h3> <p>Nodes, Properties and in fact complete subtrees may be described in JSON files using the following skeleton structure (see <a href="http://www.json.org">http://www.json.org</a> or information on the syntax of JSON) :</p> -<p>{ // child node name "nodename" : {</p> -<p>// optional primary node type, default "nt:unstructured" "jcr:primaryType": "sling:ScriptedComponent",</p> -<p>// optional mixin node types as array "jcr:mixinTypes": [ ],</p> -<p>// additional properties as name value pairs. // Multi-value properties are defined as JSON array. // Property type is derived from the value</p> -<p>// String value (default) "sling:contentClass": "com.day.sling.jcr.test.Test",</p> -<p>// Multi-value String "sampleMulti": [ "v1", "v2" ],</p> -<p>// Long value, single and multi "sampleStruct": 1, "sampleStructMulti": [ 1, 2, 3 ],</p> -<p>// Date follows pattern yyyy-mm-ddTHH:MM:SS.sss±HH:MM "sampleDate": "2014-11-27T13:26:00.000+01:00",</p> -<p>// JCR Node Reference with name prefix (removed to derive node name) "jcr:reference:sampleRef": "386b0f48-49c3-4c58-8735-ceee6bfc1933",</p> -<p>// JCR Path with name prefix (removed to derive node name) "jcr:path:samplePath": "/content/data",</p> -<p>// JCR Name with name prefix (removed to derive node name) "jcr:name:sampleName": "data",</p> -<p>// URI with name prefix (removed to derive node name) "jcr:uri:sampleUri": "http://sling.apache.org/",</p> -<p>// Child nodes are simple JSON objects "sling:scripts": { "jcr:primaryType": "sling:ScriptList", "sling:Script": { "jcr:primaryType": "sling:Script", "sling:name": "/test/content/jsp/start.jsp", "sling:type": "jsp", "sling:glob": "*" } } }</p> +<pre><code>{ + // child node name + "nodename" : { + + // optional primary node type, default "nt:unstructured" + "jcr:primaryType": "sling:ScriptedComponent", + + // optional mixin node types as array + "jcr:mixinTypes": [ ], + + // additional properties as name value pairs. + // Multi-value properties are defined as JSON array. + // Property type is derived from the value + + // String value (default) + "sling:contentClass": "com.day.sling.jcr.test.Test", + + // Multi-value String + "sampleMulti": [ "v1", "v2" ], + + // Long value, single and multi + "sampleStruct": 1, + "sampleStructMulti": [ 1, 2, 3 ], + + // Date follows pattern yyyy-mm-ddTHH:MM:SS.sss±HH:MM + "sampleDate": "2014-11-27T13:26:00.000+01:00", + + // JCR Node Reference with name prefix (removed to derive node name) + "jcr:reference:sampleRef": "386b0f48-49c3-4c58-8735-ceee6bfc1933", + + // JCR Path with name prefix (removed to derive node name) + "jcr:path:samplePath": "/content/data", + + // JCR Name with name prefix (removed to derive node name) + "jcr:name:sampleName": "data", + + // URI with name prefix (removed to derive node name) + "jcr:uri:sampleUri": "http://sling.apache.org/", + + // Child nodes are simple JSON objects + "sling:scripts": { + "jcr:primaryType": "sling:ScriptList", + "sling:Script": { + "jcr:primaryType": "sling:Script", + "sling:name": "/test/content/jsp/start.jsp", + "sling:type": "jsp", + "sling:glob": "*" + } + } +} +</code></pre> <h3>Extractors</h3> <p>By default, the <code>sling-jcr-contentloader</code> bundle tries to extract certain file types during content loading. These include <code>json</code>, <code>xml</code>, <code>zip</code>, and <code>jar</code> files. Therefore all available extractors are used for content processing. However if some files should be put into the repository unextracted, the <code>ignoreImportProviders</code> directive can be used with a comma separated list of extensions that should not be extracted, like <code>ignoreImportProviders:="jar,zip"</code>. Please note that the value needs to be put into quotation marks if more than one value is used like in the example.</p> <h3>Workspace Targetting</h3> -<p>By default, initial content will be loaded into the default workspace. To override this, add a <code>Sling-Initial-Content-Workspace</code> bundle manifest header to specify the workspace. Note that <em>all</em> content from a bundle will be loaded into the same workspace.</p> +<p>By default, initial content will be loaded into the default workspace. To override this, add a <code>Sling-Initial-Content-Workspace</code> bundle manifest header to specify the workspace. Note that <em>all</em> content from a bundle will be loaded into the same workspace. </p> <h3>Example: Load i18n JSON files</h3> <p>The Sling Internationalization Support (i18n) supports providing JSON-filed based i18n files (see <a href="https://sling.apache.org/documentation/bundles/internationalization-support-i18n.html#json-file-based">i18n documentation</a>). In this case the JSON file is not interpreted as content definition file, but is stored as binary file in the repository. Additionally a mixin <code>mix:language</code> and a property <code>jcr:language</code> with the language code has to be set on the file node.</p> <p>This is an example how such an i18n file can be loaded from an OSGi bundle with the Sling Content Loader.</p> <p>Within your bundle header you have to define a separate path for the i18n files where you have to explicitly disable the JSON provider:</p> -<p><Sling-Initial-Content> SLING-INF/i18n;overwrite:=true;ignoreImportProviders:=json;path:=/apps/myapp/i18n </Sling-Initial-Content></p> +<pre><code><Sling-Initial-Content> + SLING-INF/i18n;overwrite:=true;ignoreImportProviders:=json;path:=/apps/myapp/i18n +</Sling-Initial-Content> +</code></pre> <p>The folder <code>SLING-INF/i18n</code> from your bundles contains a pair of files for each language, e.g.:</p> <ul> <li><code>en.json</code> - The JSON file containing the i18n keys</li> <li><code>en.json.xml</code> - Additional content descriptor file setting the mixing and language property</li> </ul> <p>Example for the content descriptor:</p> -<p><?xml version="1.0" encoding="UTF-8"?> <node> <name>en.json</name> <mixinNodeType>mix:language</mixinNodeType> <property> <name>jcr:language</name> <value>en</value> <type>String</type> </property> </node></p> +<pre><code><?xml version="1.0" encoding="UTF-8"?> +<node> + <name>en.json</name> + <mixinNodeType>mix:language</mixinNodeType> + <property> + <name>jcr:language</name> + <value>en</value> + <type>String</type> + </property> +</node> +</code></pre> <h2>Declared Node Type Registration</h2> <p>The <code>sling-jcr-base</code> bundle provides low-level repository operations which are at the heart of the functionality of Sling: * <em>Node Type Definitions</em> - The class <code>org.apache.sling.content.jcr.base.NodeTypeLoader</code> provides methods to register custom node types with a repository given a repository session and a node type definition file in CND format. This class is also used by this bundle to register node types on behalf of other bundles.</p> <p>Bundles may list node type definition files in CND format in the <code>Sling-Nodetypes</code> bundle header. This header is a comma-separated list of resources in the respective bundle. Each resource is taken and fed to the <code>NodeTypeLoader</code> to define the node types.</p> <p>After a bundle has entered the <em>resolved</em> state, the node types listed in the <code>Sling-Nodetypes</code> bundle header are registered with the repository.</p> -<p>Node types installed by this mechanism will never be removed again by the <code>sling-jcr-base</code> bundle.</p> +<p>Node types installed by this mechanism will never be removed again by the <code>sling-jcr-base</code> bundle. </p> <p>Starting with revision 911430, re-registration of existing node types is enabled by default. To disable this, add <code>;rereigster:=false</code> to the resource names for which re-registration should be disabled.</p> <div class="warning"> Support for re-registration of node types is relatively limited. In Jackrabbit, for example, only "trivial" changes are allowed. http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/context-aware-configuration/context-aware-configuration-default-implementation.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/context-aware-configuration/context-aware-configuration-default-implementation.html b/documentation/bundles/context-aware-configuration/context-aware-configuration-default-implementation.html index 417d7de..33bdb2a 100644 --- a/documentation/bundles/context-aware-configuration/context-aware-configuration-default-implementation.html +++ b/documentation/bundles/context-aware-configuration/context-aware-configuration-default-implementation.html @@ -2,22 +2,22 @@ <head> <meta charset="utf-8"/> <title>Apache Sling on JBake</title> - <link rel="stylesheet" href="/res/css/site.css"/> - <link rel="stylesheet" href="/res/css/codehilite.css"/> + <link rel="stylesheet" href="/ng/res/css/site.css"/> + <link rel="icon" href="/ng/res/favicon.ico"/> <div class="title"> <div class="logo"> <a href="http://sling.apache.org"> - <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/> + <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/> </a> </div><div class="header"> <a href="http://www.apache.org"> - <img border="0" alt="Apache" src="/res/logos/apache.png"/> + <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/> </a> </div> </div> </head><body> <div class="menu"> - <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong> + <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p ><strong>Project info</strong><br/><a >href="/ng/downloads.cgi">Downloads</a><br/><a >href="http://www.apache.org/licenses/">License</a><br/><a >href="/ng/contributing.html">Contributing</a><br/><a >href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a >href="/ng/project-information.html">Project Information</a><br/><a >href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a >href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a >href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a > href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a >href="git://git.apache.org/sling.git">Git</a><br/><a >href="https://github.com/apache/sling">Github >Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a >href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a >href="http://www.apache.org/foundation/sponsorship.html">Become a >Sponsor</a><br/><a href="https://donate.apache. org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong> </div> <div class="main"> <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Apache Sling Context-Aware Configuration - Default Implementation</h1></header><p>[TOC]</p> <h1>About</h1> @@ -50,7 +50,14 @@ </ul> <h1>Configuration persistence</h1> <p>Example for the resource structure for a configuration resource at <code>/conf/mysite</code>:</p> -<p>/conf /mysite /sling:configs /x.y.z.MyConfig @prop1 = 'value1' @prop2 = 123 @prop3= true</p> +<pre><code>/conf + /mysite + /sling:configs + /x.y.z.MyConfig + @prop1 = 'value1' + @prop2 = 123 + @prop3= true +</code></pre> <p>Explanation:</p> <ul> <li><code>sling:configs</code> is the bucket named which is used by the ConfigurationResolver by default for context-aware configurations. May be another name if you use the ConfigurationResourceResolver directly.</li> http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/context-aware-configuration/context-aware-configuration-override.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/context-aware-configuration/context-aware-configuration-override.html b/documentation/bundles/context-aware-configuration/context-aware-configuration-override.html index 4e6f765..3ee8408 100644 --- a/documentation/bundles/context-aware-configuration/context-aware-configuration-override.html +++ b/documentation/bundles/context-aware-configuration/context-aware-configuration-override.html @@ -2,22 +2,22 @@ <head> <meta charset="utf-8"/> <title>Apache Sling on JBake</title> - <link rel="stylesheet" href="/res/css/site.css"/> - <link rel="stylesheet" href="/res/css/codehilite.css"/> + <link rel="stylesheet" href="/ng/res/css/site.css"/> + <link rel="icon" href="/ng/res/favicon.ico"/> <div class="title"> <div class="logo"> <a href="http://sling.apache.org"> - <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/> + <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/> </a> </div><div class="header"> <a href="http://www.apache.org"> - <img border="0" alt="Apache" src="/res/logos/apache.png"/> + <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/> </a> </div> </div> </head><body> <div class="menu"> - <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong> + <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p ><strong>Project info</strong><br/><a >href="/ng/downloads.cgi">Downloads</a><br/><a >href="http://www.apache.org/licenses/">License</a><br/><a >href="/ng/contributing.html">Contributing</a><br/><a >href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a >href="/ng/project-information.html">Project Information</a><br/><a >href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a >href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a >href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a > href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a >href="git://git.apache.org/sling.git">Git</a><br/><a >href="https://github.com/apache/sling">Github >Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a >href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a >href="http://www.apache.org/foundation/sponsorship.html">Become a >Sponsor</a><br/><a href="https://donate.apache. org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong> </div> <div class="main"> <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Apache Sling Context-Aware Configuration - Override</h1></header><p>[TOC]</p> <h1>About</h1> @@ -26,7 +26,11 @@ <p>Via the <a href="http://sling.apache.org/documentation/bundles/context-aware-configuration/context-aware-configuration-spi.html">SPI</a> you can add your own override providers - but in most cases the built-in ones described in this page are sufficient. All override providers use the same override syntax.</p> <h1>Override syntax</h1> <p>Generally an override consists of one single line. Syntax examples:</p> -<p>{configName}/{propertyName}={propertyJsonValue} {configName}={propertyJsonObject} [{contextPath}]{configName}/{propertyName}={propertyJsonValue} [{contextPath}]{configName}={propertyJsonObject}</p> +<pre><code>{configName}/{propertyName}={propertyJsonValue} +{configName}={propertyJsonObject} +[{contextPath}]{configName}/{propertyName}={propertyJsonValue} +[{contextPath}]{configName}={propertyJsonObject} +</code></pre> <p>The different parts:</p> <ul> <li><code>{configName}</code> - Configuration name - can be a relative path with sub-resources</li> @@ -37,14 +41,24 @@ </ul> <p>When the syntax <code>{configName}/{propertyName}={propertyJsonValue}</code> is used, only this specific property is overwritten leaving all other properties in the configuration resource untouched. When the syntax <code>{configName}={propertyJsonObject}</code> is used, all configuration properties in the configuration resources are replaced with the set from the JSON object.</p> <p>Override string examples with real values:</p> -<p>my-config/property1="value 1" my-config/sub1/property1="value 1" my-config/property1=["value 1","value 2"] my-config/property1=123 x.y.z.MyConfig={"prop1"="value1","prop2"=[1,2,3],"prop3"=true,"prop4"=1.23} [/content/region1]my-config/property1="value 1" [/content/region1]my-config/sub1={"prop1":"value 1"}</p> +<pre><code>my-config/property1="value 1" +my-config/sub1/property1="value 1" +my-config/property1=["value 1","value 2"] +my-config/property1=123 +x.y.z.MyConfig={"prop1"="value1","prop2"=[1,2,3],"prop3"=true,"prop4"=1.23} +[/content/region1]my-config/property1="value 1" +[/content/region1]my-config/sub1={"prop1":"value 1"} +</code></pre> <p>If multiple statements are defined affecting the same content path, configuration name and property name, they overwrite each other. That means the override string defined last wins.</p> <h1>Built-in override providers</h1> <h2>Override via system properties</h2> <p>Allows to define configuration property overrides from system environment properties.</p> <p>The parameters are defined when starting the JVM using the -D command line parameter. Each parameter contains an override string. All parameter names have to be prefixed with the string <code>sling.caconfig.override.</code>.</p> <p>Example:</p> -<p>-Dsling.caconfig.override.my-config/sub1/property1=123 -D"sling.caconfig.override.my-config/property1=["value 1","value 2"]" -D"sling.caconfig.override.[/content/region1]x.y.z.MyConfig={"prop1"="value1","prop2"=[1,2,3],"prop3"=true,"prop4"=1.23}"</p> +<pre><code>-Dsling.caconfig.override.my-config/sub1/property1=123 +-D"sling.caconfig.override.my-config/property1=[\"value 1\",\"value 2\"]" +-D"sling.caconfig.override.[/content/region1]x.y.z.MyConfig={\"prop1\"=\"value1\",\"prop2\"=[1,2,3],\"prop3\"=true,\"prop4\"=1.23}" +</code></pre> <p>This provider is not active by default, it has to be activated via OSGi configuration ("Apache Sling Context-Aware System Property Configuration Override Provider").</p> <h2>Override via OSGi configuration</h2> <p>Allows to define configuration property overrides from OSGi configuration.</p> http://git-wip-us.apache.org/repos/asf/sling-site/blob/3a935d04/documentation/bundles/context-aware-configuration/context-aware-configuration-spi.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/context-aware-configuration/context-aware-configuration-spi.html b/documentation/bundles/context-aware-configuration/context-aware-configuration-spi.html index b179274..49d3c9d 100644 --- a/documentation/bundles/context-aware-configuration/context-aware-configuration-spi.html +++ b/documentation/bundles/context-aware-configuration/context-aware-configuration-spi.html @@ -2,22 +2,22 @@ <head> <meta charset="utf-8"/> <title>Apache Sling on JBake</title> - <link rel="stylesheet" href="/res/css/site.css"/> - <link rel="stylesheet" href="/res/css/codehilite.css"/> + <link rel="stylesheet" href="/ng/res/css/site.css"/> + <link rel="icon" href="/ng/res/favicon.ico"/> <div class="title"> <div class="logo"> <a href="http://sling.apache.org"> - <img border="0" alt="Apache Sling" src="/res/logos/sling.svg"/> + <img border="0" alt="Apache Sling" src="/ng/res/logos/sling.svg"/> </a> </div><div class="header"> <a href="http://www.apache.org"> - <img border="0" alt="Apache" src="/res/logos/apache.png"/> + <img border="0" alt="Apache" src="/ng/res/logos/apache.png"/> </a> </div> </div> </head><body> <div class="menu"> - <strong><a href="/documentation.html">Documentation</a></strong><br/><a href="/documentation/getting-started.html">Getting Started</a><br/><a href="/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/documentation/development.html">Development</a><br/><a href="/documentation/bundles.html">Bundles</a><br/><a href="/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/apidocs/sling9/index.html">Sling 9</a><br/><a href="/apidocs/sling8/index.html">Sling 8</a><br/><a href="/apidocs/sling7/index.html">Sling 7</a><br/><a href="/apidocs/sling6/index.html">Sling 6</a><br/><a href="/apidocs/sling5/index.html">Sling 5</a><br/><a href="/javadoc-io.html">Archive at javadoc.io</a><br/><p></p><strong>Project info</strong><br/><a h ref="/downloads.cgi">Downloads</a><br/><a href="http://www.apache.org/licenses/">License</a><br/><a href="/contributing.html">Contributing</a><br/><a href="/news.html">News</a><br/><a href="/links.html">Links</a><br/><a href="/project-information.html">Project Information</a><br/><a href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a href="/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a href="git://git.apache.org/sling.git">Git</a><br/><a href="https://github.com/apache/sling">Github Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a><br/><a href="https://donate.apache.org/">Donate!</a><br/><a href="http://www.apache.org/foun dation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/sitemap.html">Site Map</a></strong> + <strong><a href="/ng/documentation.html">Documentation</a></strong><br/><a href="/ng/documentation/getting-started.html">Getting Started</a><br/><a href="/ng/documentation/the-sling-engine.html">The Sling Engine</a><br/><a href="/ng/documentation/development.html">Development</a><br/><a href="/ng/documentation/bundles.html">Bundles</a><br/><a href="/ng/documentation/tutorials-how-tos.html">Tutorials & How-Tos</a><br/><a href="/ng/documentation/configuration.html">Configuration</a><p></p><a href="http://s.apache.org/sling.wiki">Wiki</a><br/><a href="http://s.apache.org/sling.faq">FAQ</a><br/><p></p><strong>API Docs</strong><br/><a href="/ng/apidocs/sling9/index.html">Sling 9</a><br/><a href="/ng/apidocs/sling8/index.html">Sling 8</a><br/><a href="/ng/apidocs/sling7/index.html">Sling 7</a><br/><a href="/ng/apidocs/sling6/index.html">Sling 6</a><br/><a href="/ng/apidocs/sling5/index.html">Sling 5</a><br/><a href="/ng/javadoc-io.html">Archive at javadoc.io</a><br/><p></p ><strong>Project info</strong><br/><a >href="/ng/downloads.cgi">Downloads</a><br/><a >href="http://www.apache.org/licenses/">License</a><br/><a >href="/ng/contributing.html">Contributing</a><br/><a >href="/ng/news.html">News</a><br/><a href="/ng/links.html">Links</a><br/><a >href="/ng/project-information.html">Project Information</a><br/><a >href="https://issues.apache.org/jira/browse/SLING">Issue Tracker</a><br/><a >href="http://ci.apache.org/builders/sling-trunk">Build Server</a><br/><a >href="/ng/project-information/security.html">Security</a><br/><p></p><strong>Source</strong><br/><a > href="http://svn.apache.org/viewvc/sling/trunk">Subversion</a><br/><a >href="git://git.apache.org/sling.git">Git</a><br/><a >href="https://github.com/apache/sling">Github >Mirror</a><br/><p></p><strong>Sponsorship</strong><br/><a >href="http://www.apache.org/foundation/thanks.html">Thanks</a><br/><a >href="http://www.apache.org/foundation/sponsorship.html">Become a >Sponsor</a><br/><a href="https://donate.apache. org/">Donate!</a><br/><a href="http://www.apache.org/foundation/buy_stuff.html">Buy Stuff</a><br/><p></p><strong><a href="/ng/sitemap.html">Site Map</a></strong> </div> <div class="main"> <div class="row"><div class="small-12 columns"><section class="wrap"><header><h1>Apache Sling Context-Aware Configuration - SPI</h1></header><p>[TOC]</p> <h1>About</h1>