You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2019/05/20 11:23:20 UTC

svn commit: r1859550 [3/26] - in /jackrabbit/site/live/archive: ./ wiki/ wiki/JCR/ wiki/JCR/attachments/ wiki/JCR/attachments/115513387/ wiki/JCR/attachments/115513390/ wiki/JCR/attachments/115513408/ wiki/JCR/attachments/115513413/ wiki/JCR/attachment...

Added: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingConfiguration_115513335.html
URL: http://svn.apache.org/viewvc/jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingConfiguration_115513335.html?rev=1859550&view=auto
==============================================================================
--- jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingConfiguration_115513335.html (added)
+++ jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingConfiguration_115513335.html Mon May 20 11:23:18 2019
@@ -0,0 +1,315 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>Apache Jackrabbit : ApacheSling SlingConfiguration</title>
+        <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    </head>
+
+    <body class="theme-default aui-theme-default">
+        <div id="page">
+            <div id="main" class="aui-page-panel">
+                <div id="main-header">
+                    <div id="breadcrumb-section">
+                        <ol id="breadcrumbs">
+                            <li class="first">
+                                <span><a href="index.html">Apache Jackrabbit</a></span>
+                            </li>
+                                                    <li>
+                                <span><a href="Home_70731.html">Home</a></span>
+                            </li>
+                                                    <li>
+                                <span><a href="ApacheSling_115513331.html">ApacheSling</a></span>
+                            </li>
+                                                </ol>
+                    </div>
+                    <h1 id="title-heading" class="pagetitle">
+                                                <span id="title-text">
+                            Apache Jackrabbit : ApacheSling SlingConfiguration
+                        </span>
+                    </h1>
+                </div>
+
+                <div id="content" class="view">
+                    <div class="page-metadata">
+                        
+        
+    
+        
+    
+        
+        
+            Created by <span class='author'> ASF Infrabot</span> on May 20, 2019
+                        </div>
+                    <div id="main-content" class="wiki-content group">
+                    <h1 id="ApacheSlingSlingConfiguration-ConfigurationSupport">Configuration Support</h1>
+
+
+<h2 id="ApacheSlingSlingConfiguration-Introduction">Introduction</h2>
+
+<p>Configuration in Sling is aligned with respective support by the OSGi specification:</p>
+
+<ul>
+	<li>Framework and Java system properties are available through the <code>BundleContext.getProperty(String)</code> method. These properties are provided in Sling through the Sling launcher.</li>
+	<li>Bundle Header values are available through the <code>Bundle.getHeaders()</code> and <code>Bundle.getHeaders(String)</code> methods. These header values are set by the bundle developer in the <code>META-INF/MANIFEST.MF</code> file. In fact, all main manifest attributes are available through these methods.</li>
+	<li>Components managed by the Service Component Runtime and declared in component descriptor files listed in the <code>Service-Component</code> manifest header access configuration properties through the <code>ComponentContext.getProperties()</code> method. These properties have three sources:
+	<ol>
+		<li>Configuration specified specifically for factory components</li>
+		<li>Properties retrieved from the Configuration Admin Service</li>
+		<li>Properties set in the component descriptor</li>
+	</ol>
+	</li>
+	<li>Configuration properties provided to <code>ManagedService</code> and <code>ManagedServiceFactory</code> instances by the Configuration Admin Service.
+<br class="atl-forced-newline"/></li>
+</ul>
+
+
+<p>For the discussion to follow we differentiate between intial configuration provided by Framework and system properties and managed configuration provided by the Configuration Admin Service.</p>
+
+<p>Components managed by the Service Component Runtime are generally configured (as listed above) through the descriptor properties and configuration set by Configuration Admin Service configuration. The descriptor property values may be seen as configuration default values set by the component developer, which may be overwritten by user configuration through the Configuration Admin Service. Components may but are not required to make use of Framework properties by accessing the <code>BundleContext</code> through the <code>ComponentContext</code> given to the <code>activate(ComponentContext)</code> method of the component.</p>
+
+
+
+<h2 id="ApacheSlingSlingConfiguration-InitialConfiguration">Initial Configuration</h2>
+
+<p>The lifecycle of the OSGi framework implemented by an instance of the <code>org.apache.felix.framework.Felix</code> class is managed by the Sling launcher class <code>org.apache.sling.launcher.Sling</code>. This class is used by the standalone main class (<code>org.apache.sling.launcher.main.Main</code>) and the Sling Servlet (<code>org.apache.sling.launcher.servlet.SlingServlet</code>) to control the lifecycle.</p>
+
+<p>The Sling launcher is responsible to provide the Framework properties to the OSGi framework. The properties are prepared as a <code>java.util.Properties</code> instance as follows (later steps may overwrite properties defined in earlier steps) :</p>
+
+<ol>
+	<li>Load core properties from the embedded <code>sling.properties</code> file.</li>
+	<li>Resolve any property file inclusions. This is mainly used to resolve the correct JRE package definitions for the JRE version used.</li>
+	<li>Overwrite with any properties provided by the main class or the Sling Servlet.</li>
+	<li>Make sure the <code>sling.home</code> property is set defining a sensible default value if missing<br/>
+   1. Load the contents of the {<code>${sling.home}/sling.properties</code>} file<br/>
+   1. Overwrite properties with Java system properties. This step only considers system properties of the same names as properties already existing. That is, the system properties are not just copied into the properties here. Additionally this step my be omitted if the <code>sling.ignoreSystemProperties</code> property is set to <code>true</code>.<br/>
+   1. Resolve any property file inclusions. This may be used to provide more configurability depending on the integration.<br/>
+   1. Handle OSGi boot delegation support (see below).<br/>
+   1. Resolve property references of the form <code>${propName</code>}</li>
+	<li>For each property value starting with <code>ontext:/</code> do the following, assuming the value to be an URL with scheme <code>context:</code>:</li>
+</ol>
+<ul>
+	<li>Copy the application resource to <code>${sling.home</code>} preserving the URL path unless such a file already exists.</li>
+	<li>Replace the property value with the path to the newly created file. The path has the form {<code>${sling.home}/relpath</code>}.<br/>
+   1. Store the properties as {<code>${sling.home}/sling.properties</code>} to be re-used on next startup<br/>
+   1. Setup Bundle auto installation for the Felix Framework</li>
+</ul>
+
+
+<p>Using file system copies of the initial configuration and referred files, it is easy to modify this configuration without the need to unpack and repackage the web application archive.</p>
+
+<p>The only property really required is actually the <code>sling.home</code> property, which defines the file system location where runtime files will be placed. The default if this property is missing will be <em>sling</em> in the current working directory as defined the <code>user.dir</code> system property.</p>
+
+
+
+<h3 id="ApacheSlingSlingConfiguration-StandaloneApplication">Standalone Application</h3>
+
+<p>When launching Sling as a standalone application the <code>sling-app.jar</code> file is used. This is an executable JAR File. The <code>sling.properties</code> file as well as the <code>sling_install.properties</code> and JRE specific properties files are located at the root of the JAR file hierarchy.</p>
+
+<p>The standalone application currently sets properties for the third step of the configuration setup to ensure the HTTP Servlet integration is using the Apache Felix <em>http.jetty</em> bundle. Additionally system properties may be set using the <code>-D</code> command line switch of the Java binary.</p>
+
+<p>In addition the following command line arguments are accepted:</p>
+
+<div class="table-wrap"><table class="confluenceTable"><tbody>
+<tr>
+<td class="confluenceTd"><p> <strong>Argument</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Sling property</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Description</strong> </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>-l loglevel</code> </p></td>
+<td class="confluenceTd"><p> <code>org.apache.sling.log.level</code> </p></td>
+<td class="confluenceTd"><p> The initial loglevel (0..4, FATAL, ERROR, WARN, INFO, DEBUG) </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>-f logfile</code> </p></td>
+<td class="confluenceTd"><p> <code>org.apache.sling.log.file</code> </p></td>
+<td class="confluenceTd"><p> The log file, &quot;-&quot; for stdout </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>-c slinghome</code> </p></td>
+<td class="confluenceTd"><p> <code>sling.home</code> </p></td>
+<td class="confluenceTd"><p> the sling context directory </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>-a address</code> </p></td>
+<td class="confluenceTd"><ul class="alternate">
+	
+</ul>
+</td>
+<td class="confluenceTd"><p> the interfact to bind to (use 0.0.0.0 for any) (not supported yet) </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>-p port</code> </p></td>
+<td class="confluenceTd"><p> <code>org.osgi.service.http.port</code> </p></td>
+<td class="confluenceTd"><p> the port to listen to (default 8080) </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>-h</code> </p></td>
+<td class="confluenceTd"><ul class="alternate">
+	
+</ul>
+</td>
+<td class="confluenceTd"><p> Prints a simple usage message and exits. </p></td>
+</tr>
+</tbody></table></div>
+
+
+<p>The standalone application exits with status code 0 (zero) if Sling terminates normally, that is if the OSGi framework is stopped or if just the usage note has been displayed. If any error occurrs during command line parsing, the cause is printed to the error output and the application exists with status code 1 (one). If the OSGi framework fails to start, the cause is printed to the error output and the application exists with status code 2.</p>
+
+
+<h3 id="ApacheSlingSlingConfiguration-WebApplication">Web Application</h3>
+
+<p>When launching Sling as a web application using the <code>sling-servlet.war</code> or any derived Web Application archive file, the <code>sling.properties</code> file is located in the <code>WEB-INF</code> folder along with the <code>sling_install.properties</code> and JRE specific properties files.</p>
+
+<p>The Sling Servlet uses the Servlet Context and Servlet <code>init-param</code> configurations to prepare the properties for the third step of the configuration setup.</p>
+
+<p>If the OSGi framework fails to startup for any reason a <code>javax.servlet.UnavailableException</code>.</p>
+
+
+
+<h3 id="ApacheSlingSlingConfiguration-PropertyFileInclusions">Property File Inclusions</h3>
+
+<p>Twice in the configuration setup (second and seventh step) any property file inclusions will be handled. Property files may be included by defining one or more properties containing a comma-separated list of properties files to include. Property file inclusion looks at the <code>sling.include</code> property and any other property whose prefix is <code>sling.include.</code>. When such properties exist, the files listed in those properties are included.</p>
+
+<p>The order of handling the property file inclusion properties is defined as their natural sort order. So the properties of the files listed in the <code>sling.include.first</code> property will be loaded before the files listed in the <code>sling.include.second</code> but after the files listed in the <code>sling.include.a</code> property.</p>
+
+<p>Any file which does not exist is silently ignored.</p>
+
+<p>The names of the files are resolved as follows:</p>
+
+<p>   1. If a resource exists at the same location as the initial <code>sling.properties</code> file packaged with the application, that resource is used<br/>
+   1. If the name is a relative file name, it is looked for in the <code>sling.home</code> directory<br/>
+   1. If the name is an absolute file name, it is used as is</p>
+
+<p><strong>Example</strong></p>
+
+<p>The packaged <code>sling.properties</code> file contains the following properties file inclusion setting:</p>
+
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+<pre>sling.include.jre = jre-${java.specification.version}.properties
+</pre>
+</div></div>
+
+<p>This is used to include the JRE package list to be made visible inside the OSGi framework.</p>
+
+
+
+<h3 id="ApacheSlingSlingConfiguration-OSGiBootDelegationSupport">OSGi Boot Delegation Support</h3>
+
+<p>Some packages may have to be shared between bundles in an OSGi framework and the rest of Java VM in which the framework has been launched. This is especially true for OSGi framework instances launched in embedding such as Servlet Containers. In the case of a Sling Application accessing a JCR Repository launched in a different Web Application, this mainly concerns an API packages as well as the JNDI Initial Factory package(s).</p>
+
+<p>To cope with this sharing issue, the OSGi core specification defined two properties, which may list packages to be used from the environment:</p>
+
+
+<p> <strong>org.osgi.framework.system.packages</strong></p>
+
+
+ <div class="indent20 inline" style="margin-left: 20px;"><style type="text/css">div.inline p:first-child { display: inline; }</style><p> This property lists package names which are added to the list of exported packages of the system bundle of the OSGi framework. These packages are used in the resolution process just as any package listed in an <code>Export-Package</code> bundle manifest header.</p></div>
+<p> <strong>org.osgi.framework.bootdelegation</strong></p>
+ <div class="indent20 inline" style="margin-left: 20px;"><style type="text/css">div.inline p:first-child { display: inline; }</style><p> This property lists packages, which are always used from the environment. As such, these packages will never be looked up in package wirings as are packages imported by listing them in the <code>Import-Package</code> bundle manifest header.</p></div>
+
+
+<p>Sometimes, especially in the Servlet Container case, it is important to use the shared classes from the container and not resolve using standard OSGi resolution. In such cases, the packages of these shared classes must be listed in the <code>org.osgi.framework.bootdelegation</code> property. Sling contains a mechanism to extend the default setting of the <code>org.osgi.framework.bootdelegation</code> property by adding properties prefixed with <code>sling.bootdelegation.</code>. The value of each of these prefixed properties is conditionally appended to the <code>org.osgi.framework.bootdelegation</code> property. <em>Conditionally</em> means, that the property name may contain the fully qualified name of a class, which is checked to see whether to add the property value or not.</p>
+
+<p><strong>Examples</strong></p>
+
+<div class="table-wrap"><table class="confluenceTable"><tbody>
+<tr>
+<td class="confluenceTd"><p> <code>sling.bootdelegation.simple = com.some.package</code> </p></td>
+<td class="confluenceTd"><p> This setting unconditionally adds the <code>com.some.package</code> package to the <code>org.osgi.framework.bootdelegation</code> property </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>sling.bootdelegation.class.com.some.other.Main = com.some.other</code> </p></td>
+<td class="confluenceTd"><p> This setting checks whether the <code>com.some.other.Main</code> package is known. If so, the <code>com.some.other</code> package is added to the <code>org.osgi.framework.bootdelegation</code> property. Otherwise the <code>com.some.other</code> package is not added - and therefore must be exported by a bundle if required for use inside the framework. </p></td>
+</tr>
+</tbody></table></div>
+
+
+
+<p><strong>Note</strong> Even though packages listed in the <code>org.osgi.framework.bootdelegation</code> property will always be loaded from the environment, any bundles using these packages must still import them (through <code>Import-Package</code> or <code>DynamicImport-Package</code>) and the bundles must resolve for being usable.</p>
+
+
+
+<h2 id="ApacheSlingSlingConfiguration-Recommendationsforpropertynames">Recommendations for property names</h2>
+
+<p>The following system property names are reserved:</p>
+
+<ul>
+	<li>Names starting with <code>org.osgi.</code> are reserved for OSGi defined Framework properties</li>
+	<li>Names starting with <code>org.apache.felix.</code> are reserved for the Felix Framework</li>
+	<li>Names starting with {<code>sling.</code> are reserved for Sling</li>
+</ul>
+
+
+<p>To prevent property name collisions, I suggest the following convention:</p>
+
+<ul>
+	<li>Use fully qualified property names for initial configuration through Framework properties</li>
+	<li>Use unqualified property names for configuration through the Configuration Admin Service</li>
+</ul>
+
+
+
+<h2 id="ApacheSlingSlingConfiguration-WellKnownProperties">Well Known Properties</h2>
+
+<p>The following table is a collection of well known property names from different parts of Project Sling.</p>
+
+<div class="table-wrap"><table class="confluenceTable"><tbody>
+<tr>
+<td class="confluenceTd"><p> <strong>Property</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Description</strong> </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>sling.home</code> </p></td>
+<td class="confluenceTd"><p> Defines the file system location where Project Sling will write copies of the initial configuration. This property should also be used to define other local file system locations such as the directory to use for the Apache Felix Bundle Cache ({<code>${sling.home}/felix</code>} by default). If this property is not set it defaults to {<code>${user.dir}/sling</code>}. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>sling.home.url</code> </p></td>
+<td class="confluenceTd"><p> Contains the Sling directory set in the <code>sling.home</code> property as a valid URL. This property may be used in situations where the Sling directory is required as an URL. This property is automatically set by the Sling application and may not be modified by configuration files. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>sling.ignoreSystemProperties</code> </p></td>
+<td class="confluenceTd"><p> Whether to overwrite any configuration properties with Java system properties or not. By default this property is set to <code>true</code> by the Sling Servlet but not set by the Sling main class. The reason to set this by default in the Sling Servlet is to not induce values from the environment, which may not be appropriate in the Web Application case. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>obr.repository.url</code> </p></td>
+<td class="confluenceTd"><p> A comma-separated list of OSGi Bundle Repository URLs. See <em>Important Properties</em> on the page <a class="createlink" href="/confluence/pages/createpage.action?spaceKey=JCR&amp;title=..%2FSlingInitialStartup&amp;linkCreation=true&amp;fromPageId=115513335">Initial Provisioning and Startup</a>. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>sling.install.bundles</code> </p></td>
+<td class="confluenceTd"><p> A comma-separated list of start level numbers. See <em>Important Properties</em> on the page <a class="createlink" href="/confluence/pages/createpage.action?spaceKey=JCR&amp;title=..%2FSlingInitialStartup&amp;linkCreation=true&amp;fromPageId=115513335">Initial Provisioning and Startup</a>. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>sling.install.&lt;n&gt;</code> </p></td>
+<td class="confluenceTd"><p> A comma-separated list of bundle specifications. See <em>Important Properties</em> on the page <a class="createlink" href="/confluence/pages/createpage.action?spaceKey=JCR&amp;title=..%2FSlingInitialStartup&amp;linkCreation=true&amp;fromPageId=115513335">Initial Provisioning and Startup</a>. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>org.apache.sling.log.*</code> </p></td>
+<td class="confluenceTd"><p> Properties providing initial configuration to the Sling Log Service. See <em>Important Properties</em> on the page <a class="createlink" href="/confluence/pages/createpage.action?spaceKey=JCR&amp;title=..%2FSlingInitialStartup&amp;linkCreation=true&amp;fromPageId=115513335">Initial Provisioning and Startup</a>. </p></td>
+</tr>
+</tbody></table></div>
+
+
+
+
+<h2 id="ApacheSlingSlingConfiguration-ConfigurationAdminService">Configuration Admin Service</h2>
+
+<p>Configuration of the system entities, such as services and components, by the system administrator is supported the Configuration Admin Service. The Configuration Admin Service acts as the center for the management of the configuration data, to which GUI-based tools will connect to retrieve and update configuration data. The Configuration Admin Service is responsible for persisting the configuration data and for providing configuration consumers with the configuration data. Specifically services registered with the <code>ManagedService</code> or <code>ManagedServiceFactory</code> interfaces are updated with the configuration upon updated. The Service Component Runtime on the other hand recognizes updated configuration and provides it to the managed components as defined in the OSGi Declarative Services Specification.</p>
+
+<p>By default the Configuration Admin Service is installed when Sling is started for the first time. This service is used by the Service Component Runtime launching the OSGi components declared in the bundles with configuration values. The Sling Management Console provides a simple GUI to manage these configuration elements on the <em>Configuration</em> page.</p>
+
+<p>For more information on the Configuration Admin Service refer to the OSGi Configuration Admin Service Specification in the OSGi Service Platform Service Compendium book.</p>
+                    </div>
+
+                    
+                                                      
+                </div>             </div> 
+            <div id="footer" role="contentinfo">
+                <section class="footer-body">
+                    <p>Document generated by Confluence on May 20, 2019 11:11</p>
+                    <div id="footer-logo"><a href="http://www.atlassian.com/">Atlassian</a></div>
+                </section>
+            </div>
+        </div>     </body>
+</html>

Propchange: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingConfiguration_115513335.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingConfiguration_115513335.html
------------------------------------------------------------------------------
    svn:executable = *

Added: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideDefaultMappings_115513336.html
URL: http://svn.apache.org/viewvc/jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideDefaultMappings_115513336.html?rev=1859550&view=auto
==============================================================================
--- jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideDefaultMappings_115513336.html (added)
+++ jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideDefaultMappings_115513336.html Mon May 20 11:23:18 2019
@@ -0,0 +1,202 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>Apache Jackrabbit : ApacheSling SlingGuideDefaultMappings</title>
+        <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    </head>
+
+    <body class="theme-default aui-theme-default">
+        <div id="page">
+            <div id="main" class="aui-page-panel">
+                <div id="main-header">
+                    <div id="breadcrumb-section">
+                        <ol id="breadcrumbs">
+                            <li class="first">
+                                <span><a href="index.html">Apache Jackrabbit</a></span>
+                            </li>
+                                                    <li>
+                                <span><a href="Home_70731.html">Home</a></span>
+                            </li>
+                                                    <li>
+                                <span><a href="ApacheSling_115513331.html">ApacheSling</a></span>
+                            </li>
+                                                </ol>
+                    </div>
+                    <h1 id="title-heading" class="pagetitle">
+                                                <span id="title-text">
+                            Apache Jackrabbit : ApacheSling SlingGuideDefaultMappings
+                        </span>
+                    </h1>
+                </div>
+
+                <div id="content" class="view">
+                    <div class="page-metadata">
+                        
+        
+    
+        
+    
+        
+        
+            Created by <span class='author'> ASF Infrabot</span> on May 20, 2019
+                        </div>
+                    <div id="main-content" class="wiki-content group">
+                    <h1 id="ApacheSlingSlingGuideDefaultMappings-DefaultContentMappingandRequestRendering">Default Content Mapping and Request Rendering</h1>
+
+<p>One of the big obstacles in quick adoption of Sling might arguably be the requirement for multiple developments, such as...</p>
+
+<ol>
+	<li>Creating a <code>Content</code> implementation (or decide on reusing an existing implementation)</li>
+	<li>Defining the mapping descriptor to map the repository contents to the <code>Content</code> object and vice versa</li>
+	<li>Optionally create a node type defintion file in <em>CND</em> format</li>
+	<li>Creating a <code>Component</code> implementation (or decide on reusing an existing implementation)</li>
+	<li>Package this all up into an OSGi Bundle for deployment
+<br class="atl-forced-newline"/></li>
+</ol>
+
+
+<p>While these steps make sense in an ideal world we all know does not exist (with the exception of Utopia, but there are no computers in Utopia), helpers for rapid development are needed. These helpers come in the form of usefull defaults on various levels.</p>
+
+
+
+<h2 id="ApacheSlingSlingGuideDefaultMappings-DefaultContentMapping">Default Content Mapping</h2>
+
+<p>When a request is processed by Sling, one step is to resolve the request URL into a <code>Content</code> object. This works by checking the request URL for the longest match with an existing JCR repository node. The path of this node is then used to load the <code>Content</code> object through the <code>ContentManager.load(String)</code> method. If no mapping exists for the given node, an exception is thrown and the request fails.</p>
+
+<p>In such a case of missing content mapping, a default <code>Content</code> mapping is defined in the form of the <code>org.apache.sling.content.jcr.DefaultContent</code> class. This mapping has the following features:</p>
+
+<ul>
+	<li>The <code>DefaultContent</code> class is a <code>java.util.Map</code>. Thus all properties may be accessed using the familiar <code>Map</code> API.</li>
+	<li>All non-protected properties of the node are loaded. Single value properties become scalar objects, while multi value properties become <code>java.util.List</code> objects.</li>
+	<li>The types of the repository values are mapped according to the JCR specification for mapping between Property types and Java types.</li>
+	<li>A few properties have special significance. See below.</li>
+	<li>Creating new instances of this class and inserting these into the repository creates nodes of type <code>nt:unstructured</code>. When loading instances of this class the actual primary type of the node does not matter.
+<br class="atl-forced-newline"/>
+<br class="atl-forced-newline"/></li>
+</ul>
+
+
+<div class="table-wrap"><table class="confluenceTable"><tbody>
+<tr>
+<td class="confluenceTd"><p> <strong>Property</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Type</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Description</strong> </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>path</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> The path of the node from which the content was loaded. This must not be modified by application programs, unless you are prepared for unexpected behaviour when storing the object. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>primaryType</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> The primary node type of the (existing) node. This property is purely informational and will never be used when inserting new content or writing back content. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>mixinTypes</code> </p></td>
+<td class="confluenceTd"><p> List of String </p></td>
+<td class="confluenceTd"><p> The mixin node types of the (existing) node. This property is purely informational and will never be used when inserting new content or writing back content. If the node has no mixin node types, this property does not exist. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>sling:componentId</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> The component ID of the component used to handle requests to this content. This property may be modified by application programs (though you should be aware of the consequences) and is used as the result of the <code>Content.getComponentId()</code> method. </p></td>
+</tr>
+</tbody></table></div>
+
+
+
+
+<h2 id="ApacheSlingSlingGuideDefaultMappings-DefaultComponentSelection">Default Component Selection</h2>
+
+<p>After having mapped the JCR repository node into the <code>Content</code> object the <code>Component</code> to actually handle the request must be resolved. This is done by calling the <code>Content.getComponentId()</code> method and looking up this component ID in an internal table. If either the <code>Content.getComponentId()</code> method returns <code>null</code> or no component is registered with the requested component ID a default resolution processing takes place as follows:</p>
+
+<ol>
+	<li>Let <code>cid</code> be the result of calling <code>Content.getComponentId()</code><br/>
+   1. If <code>cid</code> is <code>null</code>, let <code>cid</code> be the result of calling =Content.getPath()}}} (this is never <code>null</code>)</li>
+	<li>Check for a component with the given <code>cid</code> and use it if existing</li>
+	<li>Otherwise, remove any leading slash from <code>cid</code> and replace slashes by dots and check for a component with this modified <code>cid</code> and use it if existing</li>
+	<li>Otherwise, let <code>cid</code> be the fully qualified name of the <code>Content</code> object class and check for a component with this modified <code>cid</code> and use it if existing</li>
+	<li>Otherwise and if <code>cid</code> ends with the string <em>Content</em>, remove that suffix and check for a component with this modified <code>cid</code> and use it if existing</li>
+	<li>Otherwise, append <code>Component</code> to the end of <code>cid</code> and and check for a component with this modified <code>cid</code> and use it if existing</li>
+	<li>Otherwise, let <code>cid</code> be the value of the <code>org.apache.sling.components.DefaultComponent.ID</code> field and check for a component with this modified <code>cid</code> and use it if existing</li>
+	<li>Finally, fail without having found a component to use - this is highly unlikely, though, because the default component is part of the Sling Core bundle and should always be available.
+<br class="atl-forced-newline"/>
+<br class="atl-forced-newline"/></li>
+</ol>
+
+
+<h3 id="ApacheSlingSlingGuideDefaultMappings-DefaultComponent"><a class="createlink" href="/confluence/pages/createpage.action?spaceKey=JCR&amp;title=DefaultComponent&amp;linkCreation=true&amp;fromPageId=115513336">DefaultComponent</a></h3>
+
+<p>The default component first checks whether the request is sent with parameters and will update the <code>Content</code> object with the parameters as follows:</p>
+
+<ul>
+	<li>If the <code>Content</code> object is a <code>java.util.Map</code> (such as is the case for the <code>DefaultContent</code>) the properties will directly accessed through the <code>Map</code>} API. Otherwise, the <code>Content</code> object is wrapped inside a <code>org.apache.commons.collections.BeanMap</code> to access the fields through the <code>Map</code> API.</li>
+	<li>Any properties listed in the <code>_delete</code> parameter are removed. The <code>_delete</code> parameter may contain a comma-separated list of property names and may occurr multiple times.</li>
+	<li>All other parameters are used to set property values, where any existing properties will be replaced and all properties not listed in the parameters remain unmodified. If a parameter occurrs only once a single value property is set, if  parameter occurrs multiple times, a multi value property is set as a list of strings. Note, that any data type conversion may happen only by the =BeanMap= as required and thus lead to failure to update a single proeperty.
+<br class="atl-forced-newline"/></li>
+</ul>
+
+
+<p>After the optional update phase, the fields of the <code>Content</code> object are written back. Again, the <code>Content</code> object is either accessed as a <code>Map</code> directly if it is a <code>Map</code> or packed in a <code>BeanMap</code> otherwise. The format of the output is deduced from the request URL's extension as returned by the <code>ComponentRequest.getExtension()</code> method:</p>
+
+<div class="table-wrap"><table class="confluenceTable"><tbody>
+<tr>
+<td class="confluenceTd"><p> <strong>Extension</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Format</strong> </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>html</code>, <code>htm</code> </p></td>
+<td class="confluenceTd"><p> HTML, UTF-8 encoded </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>xml</code> </p></td>
+<td class="confluenceTd"><p> XML, UTF-8 encoded </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>txt</code> </p></td>
+<td class="confluenceTd"><p> Plain text, UTF-8 encoded </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>properties</code> </p></td>
+<td class="confluenceTd"><p> Java Properties file format suitable for a normal properties file </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>json</code> </p></td>
+<td class="confluenceTd"><p> JSON, UTF-8 encoded  </p></td>
+</tr>
+</tbody></table></div>
+
+
+
+<h3 id="ApacheSlingSlingGuideDefaultMappings-DefaultScript">Default Script</h3>
+
+<p>The easiest way to develop and deploy a component is to create a scripted component in the repository by just creating a node of type <code>sling:scriptedComponent</code> and creating a single JSP script at <code>jsp/start.jsp</code> below the component node. After that you can refer to that component by the path of the component node and get the <code>start.jsp</code> script called.</p>
+
+<p>For more more elaborate script selection you may of course create more scripts and refer to them below the <code>sling:scripts</code> node of the component node.</p>
+
+
+<h2 id="ApacheSlingSlingGuideDefaultMappings-RapidDevelopmentPrimer">Rapid Development Primer</h2>
+
+<p>To summarize, for rapid development you will have to execute the following steps:</p>
+
+<ol>
+	<li>Create a <code>sling:ScriptedComponent</code> node, for example at <code>/some/sample/component</code></li>
+	<li>Create a JSP script file at <code>jsp/start.jsp</code> below that node; that would be <code>/some/sample/component/jsp/start.jsp</code> in the example</li>
+	<li>Create one or more nodes of any type, for example <code>nt:unstructured</code>, which have a single value string property named <code>sling:componentId</code> referring to the component via its path</li>
+	<li>Request the node by typing its path in your browser's address field</li>
+</ol>
+                    </div>
+
+                    
+                                                      
+                </div>             </div> 
+            <div id="footer" role="contentinfo">
+                <section class="footer-body">
+                    <p>Document generated by Confluence on May 20, 2019 11:11</p>
+                    <div id="footer-logo"><a href="http://www.atlassian.com/">Atlassian</a></div>
+                </section>
+            </div>
+        </div>     </body>
+</html>

Propchange: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideDefaultMappings_115513336.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideDefaultMappings_115513336.html
------------------------------------------------------------------------------
    svn:executable = *

Added: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideInstall_115513337.html
URL: http://svn.apache.org/viewvc/jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideInstall_115513337.html?rev=1859550&view=auto
==============================================================================
--- jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideInstall_115513337.html (added)
+++ jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideInstall_115513337.html Mon May 20 11:23:18 2019
@@ -0,0 +1,131 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>Apache Jackrabbit : ApacheSling SlingGuideInstall</title>
+        <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    </head>
+
+    <body class="theme-default aui-theme-default">
+        <div id="page">
+            <div id="main" class="aui-page-panel">
+                <div id="main-header">
+                    <div id="breadcrumb-section">
+                        <ol id="breadcrumbs">
+                            <li class="first">
+                                <span><a href="index.html">Apache Jackrabbit</a></span>
+                            </li>
+                                                    <li>
+                                <span><a href="Home_70731.html">Home</a></span>
+                            </li>
+                                                    <li>
+                                <span><a href="ApacheSling_115513331.html">ApacheSling</a></span>
+                            </li>
+                                                </ol>
+                    </div>
+                    <h1 id="title-heading" class="pagetitle">
+                                                <span id="title-text">
+                            Apache Jackrabbit : ApacheSling SlingGuideInstall
+                        </span>
+                    </h1>
+                </div>
+
+                <div id="content" class="view">
+                    <div class="page-metadata">
+                        
+        
+    
+        
+    
+        
+        
+            Created by <span class='author'> ASF Infrabot</span> on May 20, 2019
+                        </div>
+                    <div id="main-content" class="wiki-content group">
+                    <h1 id="ApacheSlingSlingGuideInstall-InstallingandUpgradingBundles">Installing and Upgrading Bundles</h1>
+
+<p>OSGi bundles installed in the OSGi framework, which is provided by Sling, may be upgraded or removed and new bundles may be installed by using the Sling Management Console. This page is about using the Sling Management Console for those tasks.</p>
+
+<p>Basically, you have two choices to install and upgrade bundles: Upload the bundle files or install them from a Bundle Repository.</p>
+
+
+
+<h2 id="ApacheSlingSlingGuideInstall-SlingManagementConsole">Sling Management Console</h2>
+
+<p>The Sling Management Console is installed by default when Sling is running and may be reached at on the page <code>/sling</code> in the Sling Context by default. For example if you installed the Sling Web Application in the <code>/sample</code> context of the Servlet Container running at <code><a href="http://somehost:4402" class="external-link" rel="nofollow">http://somehost:4402</a></code>, you would access the Sling Management Console at <code><a href="http://somehost:4402/sample/sling" class="external-link" rel="nofollow">http://somehost:4402/sample/sling</a></code>.</p>
+
+<p>You will be prompted for a user name and password to access the Sling Management Console. This password is preset to be <em>admin</em> for the user name and <em>admin</em> for the password.</p>
+
+<p>NB: Both the username and password and the location of the Sling Management Console inside the Web Application Context is configurable in the <em>Sling Management Console</em> configuration on the <em>Configuration</em> page.</p>
+
+
+
+<h2 id="ApacheSlingSlingGuideInstall-InstallingandupgradingbundlesbyUpload">Installing and upgrading bundles by Upload</h2>
+
+<p>To install a new bundle or upgrade an already installed bundle, go to the <em>Bundles</em> page in the Sling Management Console. At the top and the bottom of the page you have a form to specify and upload a bundle as a file :</p>
+
+<ul>
+	<li>Select the bundle file to upload</li>
+	<li>Click the <em>Start</em> checkbox, if you want to start the bundle after installation. If the bundle is upgraded, this checkbox is ignored.</li>
+	<li>Specify the start level of the bundle in the <em>Start Level</em> field. This must be a number higher than 0 and is ignored for bundles, which are already installed. Most of the time, you will use the default value.</li>
+	<li>Click the <em>Install or Update</em> button
+<br class="atl-forced-newline"/></li>
+</ul>
+
+
+<p>After clicking the button, the bundle file will be uploaded. If a bundle with the same bundle symbolic name is already installed, the respective bundle will be updated with the new bundle file. Otherwise the bundle file will be installed as a new bundle and its start level is set as defined. Additionally the bundle will optionally be started.</p>
+
+<p>After having updated a bundle, you should also refresh the packages by clicking on the <em>Refresh Packages</em> button. The reson for this is, that the old version of the bundle is still used by other bundles even after upgrading to a new version. Only when the packages are refreshed any users of the bundle will be relinked to use the new bundle version. As this might be a somewhat lengthy operation, which also stops and restarts using bundles, this operation has to be executed explicitly.</p>
+
+<p>Also, if you plan to upgrade multiple bundles, you may wish to upgrade all bundles before repackaging the using bundles.</p>
+
+
+
+<h2 id="ApacheSlingSlingGuideInstall-InstallingandupgradingbundlesfromtheBundleRepository">Installing and upgrading bundles from the Bundle Repository</h2>
+
+<p>The OSGi Bundle Repository is a repository of bundles, from which Sling may download and install or upgrade bundles very easily. Unlike the installation of bundles by file upload, the ~OSGi Bundle Repository has the functionality to resolve and dependencies of bundles to be installed.</p>
+
+<p>Say you wish to install bundle <em>X</em> which depends on packages provided by bundle <em>Y</em>. When uploading bundle <em>X</em> as a file it will not resolve, that is Sling (the OSGi framework actually) is not able to ensure proper operation of bundle <em>X</em> and thus prevents the bundle from being started and used. You will have to manually upload bundle <em>Y</em> yourself. When using the OSGi Bundle Repository, you just select bundle <em>X</em> for installation and the bundle repository will find out, that bundle <em>Y</em> is also required and will automatically download and install it along with bundle <em>X</em>.</p>
+
+
+<h3 id="ApacheSlingSlingGuideInstall-TheBundleRepositorypage">The Bundle Repository page</h3>
+
+<p>Installation or update of bundles may be done on the <em>Bundle Repository</em> page of the Sling Management Console. In the upper part of the page, you will see a list (usually just a single entry) of OSGi Bundle Repositories known to Sling. In the lower part of the list you see the bundles available from these repositories. To install or update bundles, just check the respective button and click on the <em>Deploy Selected</em> or <em>Deploy and Start Selected</em> button at the bottom of the page depending on whether you want to start the bundle(s) after installation or not.</p>
+
+<p>See below for more information on OSGi Bundle Repository management.</p>
+
+
+
+<h3 id="ApacheSlingSlingGuideInstall-TheBundlespage">The Bundles page</h3>
+
+<p>You may also want to upgrade already installed bundles from the <em>Bundles</em> page of the Sling Management Console. For each bundle listed in this page, there is an <em>Upgrade</em> button. If there is an upgrade to the installed bundle available in the OSGi Bundle Repository, the button is enabled and clicking on the button will upgrade the respective bundle. If no upgrade is available from the OSGi Bundle Repository, this button is disabled.</p>
+
+
+
+<h3 id="ApacheSlingSlingGuideInstall-ManagingOSGiBundleRepositories">Managing OSGi Bundle Repositories</h3>
+
+<p>Currently management of known OSGi Bundle Repositories is very simple. If a configured bundle repository is not available on startup, it will be marked as being inactive. If you know the repository is now available, you may click on the <em>Refresh</em> button, to activate it. Similarly, the contents of the repository may be modified by for example adding new bundles or updating bundles in the repository, these changes will be made known to Sling by clicking the <em>Refresh</em> button.</p>
+
+<p>There exists no GUI functionality yet to add a new repository to the list of known repositories. Instead you may submit a request with parameters <code>action</code> whose value must be <code>refreshOBR</code> and <code>repository</code> whose value must be the URL to the repository descriptor file generally called <code>repository.xml</code>.</p>
+
+<p>For example, if you run Sling on <code><a href="http://localhost:7402/sample" class="external-link" rel="nofollow">http://localhost:7402/sample</a></code> with default location of the Sling Management Console, the following request would add a repository at <code>/tmp/repo/repository.xml</code> in the filesystem:</p>
+
+<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
+<pre>http://localhost:7402/sample/sling/bundlerepo?action=refreshOBR&amp;repository=file:///tmp/repo/repository.xml
+</pre>
+</div></div>
+
+<p>Note: Only use <code>file:</code> URLs if you know Sling has access to the named file !</p>
+                    </div>
+
+                    
+                                                      
+                </div>             </div> 
+            <div id="footer" role="contentinfo">
+                <section class="footer-body">
+                    <p>Document generated by Confluence on May 20, 2019 11:11</p>
+                    <div id="footer-logo"><a href="http://www.atlassian.com/">Atlassian</a></div>
+                </section>
+            </div>
+        </div>     </body>
+</html>

Propchange: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideInstall_115513337.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideInstall_115513337.html
------------------------------------------------------------------------------
    svn:executable = *

Added: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideRepositoryUse_115513338.html
URL: http://svn.apache.org/viewvc/jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideRepositoryUse_115513338.html?rev=1859550&view=auto
==============================================================================
--- jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideRepositoryUse_115513338.html (added)
+++ jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideRepositoryUse_115513338.html Mon May 20 11:23:18 2019
@@ -0,0 +1,424 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <title>Apache Jackrabbit : ApacheSling SlingGuideRepositoryUse</title>
+        <link rel="stylesheet" href="styles/site.css" type="text/css" />
+        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    </head>
+
+    <body class="theme-default aui-theme-default">
+        <div id="page">
+            <div id="main" class="aui-page-panel">
+                <div id="main-header">
+                    <div id="breadcrumb-section">
+                        <ol id="breadcrumbs">
+                            <li class="first">
+                                <span><a href="index.html">Apache Jackrabbit</a></span>
+                            </li>
+                                                    <li>
+                                <span><a href="Home_70731.html">Home</a></span>
+                            </li>
+                                                    <li>
+                                <span><a href="ApacheSling_115513331.html">ApacheSling</a></span>
+                            </li>
+                                                </ol>
+                    </div>
+                    <h1 id="title-heading" class="pagetitle">
+                                                <span id="title-text">
+                            Apache Jackrabbit : ApacheSling SlingGuideRepositoryUse
+                        </span>
+                    </h1>
+                </div>
+
+                <div id="content" class="view">
+                    <div class="page-metadata">
+                        
+        
+    
+        
+    
+        
+        
+            Created by <span class='author'> ASF Infrabot</span> on May 20, 2019
+                        </div>
+                    <div id="main-content" class="wiki-content group">
+                    <h1 id="ApacheSlingSlingGuideRepositoryUse-HowtoaccessJCRRepositorieswithSling">How to access JCR Repositories with Sling</h1>
+
+<p>Sling provides a number of bundles to make using a JCR Repository easy:</p>
+
+<p> <strong>jackrabbit-api</strong></p>
+
+ <div class="indent20 inline" style="margin-left: 20px;"><style type="text/css">div.inline p:first-child { display: inline; }</style><p> Provides JCR and Jackrabbit API interfaces and classes as well as the Jackrabbit commons library classes. Finally, this bundle implements the core for session pooling, which is used by the jackrabbit-server and jackrabbit-client bundles.</p></div>
+<p> <strong>jackrabbit-server</strong></p>
+ <div class="indent20 inline" style="margin-left: 20px;"><style type="text/css">div.inline p:first-child { display: inline; }</style><p> This bundle supports running embedded Jackrabbit repositories using the default persistence manager. Any repositories instantiated by this bundle may optionally be registered with an RMI registry and a JNDI context.</p></div>
+<p> <strong>jackrabbit-client</strong></p>
+ <div class="indent20 inline" style="margin-left: 20px;"><style type="text/css">div.inline p:first-child { display: inline; }</style><p> This bundle supports accessing a repository through RMI or JNDI.</p></div>
+<p> <strong>jackrabbit-text-extractors</strong></p>
+ <div class="indent20 inline" style="margin-left: 20px;"><style type="text/css">div.inline p:first-child { display: inline; }</style><p> Add support to extract text for indexing for the workspace indexer.</p></div>
+
+
+<p>This page contains short descriptions on how to use each bundle.</p>
+
+
+
+<h2 id="ApacheSlingSlingGuideRepositoryUse-JackrabbitAPIandCommons">Jackrabbit API and Commons</h2>
+
+<p>The <em>Jackrabbit API and Commons</em> (<code>org.apache.sling.jackrabbit-api</code>) bundle provides the following functionality:</p>
+
+<ul>
+	<li>Exports JCR API, Version 1.0</li>
+	<li>Export Jackrabbit API, currently Version 1.3</li>
+	<li>Exports the <code>SlingRepository</code> interface providing configurable default workspace and admin session</li>
+	<li>Implements Session Pooling and provides an abstract implementation of the <code>SlingRepository</code> interface with Session Pooling support
+<br class="atl-forced-newline"/></li>
+</ul>
+
+
+<p>Bundles providing access to repositories register an OSGi service with the name <code>javax.jcr.Repository</code>. If the actual repository implements more interfaces, such as a Jackrabbit repository or an extension of the <code>AbstractSlingRepository</code>, all implemented interfaces should be also listed as service names.</p>
+
+
+
+<h2 id="ApacheSlingSlingGuideRepositoryUse-EmbeddedJackrabbitRepository">Embedded Jackrabbit Repository</h2>
+
+<p>The <em>Jackrabbit Embedded Repository</em> (<code>org.apache.sling.jackrabbit-server</code>) bundle provides the following functionality:</p>
+
+<ul>
+	<li>Contains and exports all of the Jackrabbit Core library</li>
+	<li>Implements the <code>SlingRepository</code> interface backed by a Jackrabbit repository</li>
+	<li>Registers a OSGi Component Factory to create repository instances on demand</li>
+	<li>Registers repository instances as OSGi services as <code>javax.jcr.Repository</code>, <code>org.apache.jackrabbit.api.JackrabbitRepository</code>, <code>org.apache.sling.jcr.SlingRepository</code></li>
+	<li>Contains enough third-party libraries pertinent to Jackrabbit to run a Jackrabbit with the default persistence manager</li>
+	<li>Supports registration of repositories with an RMI Registry and a JNDI context.
+<br class="atl-forced-newline"/>
+<br class="atl-forced-newline"/>
+<br class="atl-forced-newline"/></li>
+</ul>
+
+
+<h3 id="ApacheSlingSlingGuideRepositoryUse-Configuration">Configuration</h3>
+
+
+<p>Configuration of the repositories started by this bundle is split into two parts: (1) configuration of the OSGi service mainly configuring the Session Pool, user names and passwords for administrative and anonymous sessions, RMI/JNDI registration information; and (2) repository configuration itself contained in a traditional <code>repository.xml</code> file.</p>
+
+<p>**NOTE**: For this bundle to be operative, the OSGi container must provide the OSGi Configuration Admin Service, from which the configuration is retrieved and which is used to persist the configuration objects.</p>
+
+
+
+<h4 id="ApacheSlingSlingGuideRepositoryUse-OSGiServiceConfiguration">OSGi Service Configuration</h4>
+
+<p>OSGi service configuration is managed through the OSGi Configuration Admin Service and supports the following properties:</p>
+
+<div class="table-wrap"><table class="confluenceTable"><tbody>
+<tr>
+<td class="confluenceTd"><p> <strong>Name</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Type</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Default</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Description</strong> </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>home</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><ul class="alternate">
+	
+</ul>
+</td>
+<td class="confluenceTd"><p> The directory in which to launch the Jackrabbit repository. This property is required and has no default value. If this path is relative, it is resolved relative to the path set in the <code>sling.home</code> framework property available through the bundle context. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>config</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><ul class="alternate">
+	
+</ul>
+</td>
+<td class="confluenceTd"><p> The name of the repository configuration file. This property is required and has no default value. If this path is relative, it is resolved relative to the path set in the <code>sling.home</code> property. If this name is an URL, it must be a valid URL which may be connected to and read from. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>autostart</code> </p></td>
+<td class="confluenceTd"><p> boolean </p></td>
+<td class="confluenceTd"><p> <code>true</code> </p></td>
+<td class="confluenceTd"><p> Whether to start the repository immediately (<code>true</code>) or on demand when first accessed. As the object created for the configuration and registered as an OSGi service is actually a facade to the real repository object, the start of the repository may be delayed until actually accessed. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>defaultWorkspace</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>default</code> </p></td>
+<td class="confluenceTd"><p> The name of the workspace to which sessions are created if no workspace name is supplied to the login method used. If this workspace does not exist, it will automatically be created through an administrative session using the user name and password configured. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>admin.name</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>admin</code> </p></td>
+<td class="confluenceTd"><p> The name used to create administrative sessions implementing the <code>SlingRepository.loginAdministrative(String)</code> method. The Sling framework is using administrative sesions for all sorts of task requiring administrative privileges such as creating the configured <code>defaultWorkspace</code> if required. Therefore this user has to have full access to the repository and all its workspace(s). </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>admin.password</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>admin</code> </p></td>
+<td class="confluenceTd"><p> The password used to create administrative sesions. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>anonymous.name</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>anonymous</code> </p></td>
+<td class="confluenceTd"><p> The name used to create anonymous sessions, which are created when any of the <code>Repository.login</code> methods is called without a <code>Credentials</code> object. The Sling framework mainly uses anonymous sessions to handle unauthenticated requests. If this property is not set or set to a name not accepted by the repository, unauthenticated requests will of course fail. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>anonymous.password</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>anonymous</code> </p></td>
+<td class="confluenceTd"><p> The password used to create anonymous sessions.</p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>pool.maxActive</code> </p></td>
+<td class="confluenceTd"><p> int </p></td>
+<td class="confluenceTd"><p> -1 </p></td>
+<td class="confluenceTd"><p> The maximum number of sessions per user allowed to be active at a given moment. If this property is set to a value larger than zero, only the given number of sesions may be logged in at the same time. Further requests first wait for a session to become available and fail if no session becomes available. If this property is set to a negative value - the default value of this property is -1 - the number of active sesions is virtually unlimited. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>pool.maxActiveWait</code> </p></td>
+<td class="confluenceTd"><p> int </p></td>
+<td class="confluenceTd"><p> 1 </p></td>
+<td class="confluenceTd"><p> The number of seconds to wait for a session to become available if the maximum number of active sessions has been reached. If no session becomes available within this timeframe the login attempt fails with a <code>org.apache.sling.jcr.TooManySessionsException</code>. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>pool.maxIdle</code> </p></td>
+<td class="confluenceTd"><p> int </p></td>
+<td class="confluenceTd"><p> 10 </p></td>
+<td class="confluenceTd"><p> The number of sessions to keep in the session pool. If a user tries to login, the session pool is first consulted for an existing session. Only if no session exists, a new session is created. If the user finally logs out, the session is put back into the pool, unless the number of sessions idling in the pool has already reached this number. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>name</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><ul class="alternate">
+	
+</ul>
+</td>
+<td class="confluenceTd"><p> The name to use to register the repository with a JNDI context and the RMI registry. If this property is not set, the repository is not registered in both the JNDI context and the RMI registry. See below for more information. </p></td>
+</tr>
+</tbody></table></div>
+
+
+
+<h4 id="ApacheSlingSlingGuideRepositoryUse-InitialConfiguration">Initial Configuration</h4>
+
+<p>When the bundle is launched, the bundle activator checks to see for at least one concrete configuration object for the repository component. If no such configuration object exists, one is created to ensure that a repository is available out of the box.</p>
+
+<p>If the activator finds an OSGI configuration object, nothing needs to be done. Otherwise a new configuration object with default configuration with the <code>home</code>, <code>config</code> and <code>name</code> properties set as listed below is created and stored with the Configuration Admin Service. Storing the configuration results in having the repository launched as the Configuration Admin Service provides this configuration object to the OSGi component factory which in turn then launches the repository. Said configuration properties are defined as follows:</p>
+
+<div class="table-wrap"><table class="confluenceTable"><tbody>
+<tr>
+<td class="confluenceTd"><p> <strong>Name</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Value</strong> </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>home</code> </p></td>
+<td class="confluenceTd"><p> {<code>${sling.home}/jackrabbit</code>} </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>config</code> </p></td>
+<td class="confluenceTd"><p> {<code>${sling.home}/repository.xml</code>} </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>name</code> </p></td>
+<td class="confluenceTd"><p> <code>jackrabbit.repository</code> </p></td>
+</tr>
+</tbody></table></div>
+
+
+<p>The Jackrabbit Repository Configuration file in the Sling home directory is copied from within the Jackrabbit Embedded Repository Bundle, if it does no exist yet. Any existing <code>repository.xml</code> file is not overwritten.</p>
+
+
+
+<h4 id="ApacheSlingSlingGuideRepositoryUse-RMIRegistration">RMI Registration</h4>
+
+<p>Registration with an RMI registry is handled with a separate component, which listens for OSGi services of the name <code>javax.jcr.Repository</code> to be registered. Upon such a registration, the RMI registrar checks the service properties for a <code>name</code> property. If the property is found, that name is used to bind the repository with the RMI registry. When the repository is unregistered it is also unbound from the RMI registry.</p>
+
+<p>The RMI registrar is configured with the port number at which the RMI registry is to be expected. If an RMI registry is already running at this port, this registry is used. Otherwise a registry is created to listen on the configured port. If another RMI registry is already running in the same Java VM (but on a different port), the RMI registrar cannot create another RMI registry (only one RMI registry per Java VM is possible), the RMI registrar is not operational and repositories will not be registered with RMI.</p>
+
+<p>When the RMI registrar is terminated and has created its own RMI registry, the registry is destroyed. Otherwise the registry is left alone.</p>
+
+<p><strong>Configuration</strong></p>
+
+<div class="table-wrap"><table class="confluenceTable"><tbody>
+<tr>
+<td class="confluenceTd"><p> <strong>Name</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Type</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Default</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Description</strong> </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>port</code> </p></td>
+<td class="confluenceTd"><p> Integer </p></td>
+<td class="confluenceTd"><p> 1099 </p></td>
+<td class="confluenceTd"><p> The port at which to create (or expect) the registry. If no registry is available on this port or can be created to listen on this port, the RMI registrar remains inactive and will not register repositories at all. </p></td>
+</tr>
+</tbody></table></div>
+
+
+
+<h4 id="ApacheSlingSlingGuideRepositoryUse-JNDIRegistration">JNDI Registration</h4>
+
+<p>Registration with a JNDI context is handled with a separate component, which listens for OSGi services of the name <code>javax.jcr.Repository</code> to be registered. Upon such a registration, the JNDI registrar checks the service properties for a <code>name</code> property. If the property is found, that name is used to bind the repository with the JNDI context. When the repository service is unregistered it is also unbound from the JNDI context.</p>
+
+<p>The JNDI context is managed by the JNDI registrar component through its configuration. The registrar uses the platform to access a JNDI initial context. If the JNDI context is to be visible outside the OSGi framework but in the same Java VM instance (for example in a different Web Application if the Sling is started as a web application), the JNDI Initial Context class <em>must</em> be loaded through a class loader common to the OSGi framework and the user outside of the framework.</p>
+
+<p>The default configuration of the JNDI registrar uses the <code>org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory</code> class as its initial context factory. If the initial context cannot be created, the JNDI registrar remains inactive and will register repositories with JNDI.</p>
+
+<p>*Configuration*</p>
+
+<div class="table-wrap"><table class="confluenceTable"><tbody>
+<tr>
+<td class="confluenceTd"><p> <strong>Name</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Type</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Default</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Description</strong> </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>java.naming.factory.initial</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory</code> </p></td>
+<td class="confluenceTd"><p> The fully qualified name of the JNDI Initial Context factory. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>java.naming.provider.url</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> {{</p>
+<a href="http://www.apache.org/jackrabbit" class="external-link" rel="nofollow">http://www.apache.org/jackrabbit</a>
+<p>}} </p></td>
+<td class="confluenceTd"><p> The JNDI Provider URL. </p></td>
+</tr>
+</tbody></table></div>
+
+
+
+
+<h5 id="ApacheSlingSlingGuideRepositoryUse-ExternalClients">External Clients</h5>
+
+<p>If the context needs to be shared with clients outside the OSGi framework (but inside the same Java VM instance), the class referred to in the <code>java.naming.factory.initial</code> property must be available in a common class loader. Additionally, the JCR and Jackrabbit APIs must also be available from the same location. Finally, all the Java packages (the JNDI <a class="createlink" href="/confluence/pages/createpage.action?spaceKey=JCR&amp;title=InitialContextFactory&amp;linkCreation=true&amp;fromPageId=115513338">InitialContextFactory</a> class as well as the JCR and Jackrabbit APIs) must be made available to the OSGi framework bundles.</p>
+
+<p>To enable such class sharing, the respective Java packages must be declared in the <code>sling.properties</code> file as part of the <code>org.osgi.framework.bootdelegation</code> property. The Sling (and derived) Web Applications provides support to setup this property depending on the environment it is running in: If the <code>javax.jcr.Repository</code> class is visible in the Web Application, it is assumed that the JCR and Jackrabbit API classes are contained in a shared class loader and hence the respective packages are added to the <code>bootdelegation</code> property automatically.</p>
+
+<p>Note, that you may well place the <em>Jackrabbit API and Commons</em> (<code>org.apache.sling.jackrabbit-api</code>) bundle jar file into the shared class loader, as this file contains all the required packages and classes. Just be sure, to list all exports of the bundle in the <code>org.osgi.framework.bootdelegation</code> framework property (without the <em>uses</em> clauses).</p>
+
+
+
+<h2 id="ApacheSlingSlingGuideRepositoryUse-ExternalJackrabbitRepository">External Jackrabbit Repository</h2>
+
+<p>Accessing a JCR Repository running outside of the OSGi framework is supported by the <em>Jackrabbit Repository Accessor</em> (<code>org.apache.sling.jackrabbit-client</code>) bundle. This bundle provides a single factory component registering Repository services as they are found from JNDI or RMI. Each configuration tries to access a repository.</p>
+
+
+<h4 id="ApacheSlingSlingGuideRepositoryUse-OSGiServiceConfiguration.1">OSGi Service Configuration</h4>
+
+<p>OSGi service configuration is managed through the OSGi Configuration Admin Service and supports the following properties:</p>
+
+<div class="table-wrap"><table class="confluenceTable"><tbody>
+<tr>
+<td class="confluenceTd"><p> <strong>Name</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Type</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Default</strong> </p></td>
+<td class="confluenceTd"><p> <strong>Description</strong> </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>defaultWorkspace</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>default</code> </p></td>
+<td class="confluenceTd"><p> The name of the workspace to which sessions are created if no workspace name is supplied to the login method used. If this workspace does not exist, it will automatically be created through an administrative session using the user name and password configured. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>admin.name</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>admin</code> </p></td>
+<td class="confluenceTd"><p> The name used to create administrative sessions implementing the <code>SlingRepository.loginAdministrative(String)</code> method. The Sling framework is using administrative sesions for all sorts of task requiring administrative privileges such as creating the configured <code>defaultWorkspace</code> if required. Therefore this user has to have full access to the repository and all its workspace(s). </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>admin.password</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>admin</code> </p></td>
+<td class="confluenceTd"><p> The password used to create administrative sesions. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>anonymous.name</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>anonymous</code> </p></td>
+<td class="confluenceTd"><p> The name used to create anonymous sessions, which are created when any of the <code>Repository.login</code> methods is called without a <code>Credentials</code> object. The Sling framework mainly uses anonymous sessions to handle unauthenticated requests. If this property is not set or set to a name not accepted by the repository, unauthenticated requests will of course fail. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>anonymous.password</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>anonymous</code> </p></td>
+<td class="confluenceTd"><p> The password used to create anonymous sessions.</p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>pool.maxActive</code> </p></td>
+<td class="confluenceTd"><p> int </p></td>
+<td class="confluenceTd"><p> -1 </p></td>
+<td class="confluenceTd"><p> The maximum number of sessions per user allowed to be active at a given moment. If this property is set to a value larger than zero, only the given number of sesions may be logged in at the same time. Further requests first wait for a session to become available and fail if no session becomes available. If this property is set to a negative value - the default value of this property is -1 - the number of active sesions is virtually unlimited. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>pool.maxActiveWait</code> </p></td>
+<td class="confluenceTd"><p> int </p></td>
+<td class="confluenceTd"><p> 1 </p></td>
+<td class="confluenceTd"><p> The number of seconds to wait for a session to become available if the maximum number of active sessions has been reached. If no session becomes available within this timeframe the login attempt fails with a <code>org.apache.sling.jcr.TooManySessionsException</code>. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>pool.maxIdle</code> </p></td>
+<td class="confluenceTd"><p> int </p></td>
+<td class="confluenceTd"><p> 10 </p></td>
+<td class="confluenceTd"><p> The number of sessions to keep in the session pool. If a user tries to login, the session pool is first consulted for an existing session. Only if no session exists, a new session is created. If the user finally logs out, the session is put back into the pool, unless the number of sessions idling in the pool has already reached this number. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>name</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>jackrabbit.repository</code> </p></td>
+<td class="confluenceTd"><p> The name of the repository to access in either the JNDI context or the RMI registry. If the repository is accessible through JNDI, this property must contain the full RMI URL of the form ==~//host~port/name==. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>java.naming.factory.initial</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> <code>org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory</code> </p></td>
+<td class="confluenceTd"><p> The fully qualified name of the JNDI Initial Context factory. This property is only needed in case the repository is to be accessed through JNDI. Otherwise this property is ignored. </p></td>
+</tr>
+<tr>
+<td class="confluenceTd"><p> <code>java.naming.provider.url</code> </p></td>
+<td class="confluenceTd"><p> String </p></td>
+<td class="confluenceTd"><p> {{</p>
+<a href="http://www.apache.org/jackrabbit" class="external-link" rel="nofollow">http://www.apache.org/jackrabbit</a>
+<p>}} </p></td>
+<td class="confluenceTd"><p> The JNDI Provider URL. This property is only needed in case the repository is to be accessed through JNDI. Otherwise this property is ignored. </p></td>
+</tr>
+</tbody></table></div>
+
+
+
+<h5 id="ApacheSlingSlingGuideRepositoryUse-AccessingaRepositorythroughJNDI">Accessing a Repository through JNDI</h5>
+
+<p>If the existing repository has to be accessed through JNDI, the Initial Context classes must be shared with the provider of the repository. In the case of running Sling as a Web Application, the JNDI Initial Context class must be loaded from a shared class loader. Likewise, all the JCR and Jackrabbit API classes must also be loaded from a shared class loader. Otherwise the JNDI context cannot be accessed or the repository found may not be of the correct Java type.</p>
+
+<p>To enable such class sharing, the respective Java packages must be declared in the <code>sling.properties</code> file as part of the <code>org.osgi.framework.bootdelegation</code> property. The Sling (and derived) Web Applications provides support to setup this property depending on the environment it is running in: If the <code>javax.jcr.Repository</code> class is visible in the Web Application, it is assumed that the JCR and Jackrabbit API classes are contained in a shared class loader and hence the respective packages are added to the <code>bootdelegation</code> property automatically.</p>
+
+
+<h5 id="ApacheSlingSlingGuideRepositoryUse-AccessingaRepositorythroughRMI">Accessing a Repository through RMI</h5>
+
+<p><p>If the existing repository has to be accessed through RMI, no special precautions must be taken as the RMI stubs to access the repository are contained in the bundle and are thus used. To access the repository, the full RMI URL of the form <code>//host[:port]/name</code> (eg. <code>//localhost/jackrabbit.repository</code>) is just configured as the Repository Name.</p></p>
+
+
+
+<h2 id="ApacheSlingSlingGuideRepositoryUse-JackrabbitTextExtractors">Jackrabbit Text Extractors</h2>
+
+<p>Jackrabbit Text Extractors extend the Jackrabbit Repository based search indexing with support for various office document formats such as Microsoft Word, Microsoft Excel, PDF, <a class="createlink" href="/confluence/pages/createpage.action?spaceKey=JCR&amp;title=OpenOffice&amp;linkCreation=true&amp;fromPageId=115513338">OpenOffice</a> etc. To use these extractors, install the <em>jackrabbit-text-extractors</em> bundle (<code>org.apache.sling.jackrabbit-text-extractors</code>) and configure the text extractor class names as the value (comma-separated list) of the <code>textFilterClasses</code> parameter in the <code>SearchIndex</code> element of each workspace, which is to be supported by these extractors.</p>
+
+<p>For more information on the Jackrabbit Text Extractors refer to <a href="http://jackrabbit.apache.org/doc/components/index-filters.html" class="external-link" rel="nofollow">Jackrabbit Index Filters</a>.</p>
+                    </div>
+
+                    
+                                                      
+                </div>             </div> 
+            <div id="footer" role="contentinfo">
+                <section class="footer-body">
+                    <p>Document generated by Confluence on May 20, 2019 11:11</p>
+                    <div id="footer-logo"><a href="http://www.atlassian.com/">Atlassian</a></div>
+                </section>
+            </div>
+        </div>     </body>
+</html>

Propchange: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideRepositoryUse_115513338.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jackrabbit/site/live/archive/wiki/JCR/ApacheSling-SlingGuideRepositoryUse_115513338.html
------------------------------------------------------------------------------
    svn:executable = *