http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/resource-merger.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/resource-merger.html b/documentation/bundles/resource-merger.html index d6a39b4..aca5799 100644 --- a/documentation/bundles/resource-merger.html +++ b/documentation/bundles/resource-merger.html @@ -74,7 +74,7 @@ Resource Merger (org.apache.sling.resourcemerger) </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p><!-- TODO reactivate TOC once JBake moves to flexmark-java --> </p> -<h1>Introduction</h1> +<h1><a href="#introduction" name="introduction">Introduction</a></h1> <p><strong>This documentation only applies to versions >= 1.2 (due to major changes done in <a href="https://issues.apache.org/jira/browse/SLING-3423">SLING-3423</a>)</strong></p> <p>The Resource Merger bundle provides two resource provider factories</p> <ul> @@ -91,7 +91,7 @@ </ul> <p>You may use any of the merge properties described below to influence the merging behaviour. All those special properties are not exposed below the mount point. </p> <p>The <code>CRUDMergingResourceProvider</code> not only gives read-access to the merged resources but even allows to write. This provider always writes inside the topmost resource path (being returned as last item by the resource picker). Currently both resource pickers shipped with the Sling Resource Merger bundle do not allow to write though. Further details can be found in the description of <a href="https://issues.apache.org/jira/browse/SLING-3909">SLING-3909</a>.</p> -<h1>Merge Properties</h1> +<h1><a href="#merge-properties" name="merge-properties">Merge Properties</a></h1> <table> <thead> <tr> @@ -123,7 +123,7 @@ </tr> </tbody> </table> -<h1>Child Resource Order</h1> +<h1><a href="#child-resource-order" name="child-resource-order">Child Resource Order</a></h1> <p>For a merged resource the order of its child resources is the following: First the ones from the base resource, then the ones from the overlaying resources. The children only defined by the topmost resource come last.</p> <p>In case the same child is defined in more than one resource, its position is taken from the highest overlaying resource (since version 1.3.2, see also <a href="https://issues.apache.org/jira/browse/SLING-4915">SLING-4915</a>). For example:</p> <pre><code>base/ @@ -139,8 +139,8 @@ overlay/ resulting order: child1, child4, child2, child3 </code></pre> <p>You can overwrite that behaviour by leveraging the <code>sling:orderBefore</code> property.</p> -<h1>Resource Pickers</h1> -<h2>Merging Resource Picker (Overlay approach)</h2> +<h1><a href="#resource-pickers" name="resource-pickers">Resource Pickers</a></h1> +<h2><a href="#merging-resource-picker-overlay-approach-" name="merging-resource-picker-overlay-approach-">Merging Resource Picker (Overlay approach)</a></h2> <table> <thead> <tr> @@ -162,7 +162,7 @@ resulting order: child1, child4, child2, child3 </tbody> </table> <p>This picker is thought for globally overlaying content by placing the diff-resource in "/apps" without actually touching anything in "/libs" (since this is only thought for Sling itself). This should be used whenever some deviation of content is desired which is initially shipped with Sling. The client (i.e. the code using the merged resource) does not have to know if there is an overlay in place.</p> -<h3>Example</h3> +<h3><a href="#example" name="example">Example</a></h3> <pre><code>/libs/sling/example (nt:folder) +-- sling:resourceType = "some/resource/type" +-- child1 (nt:folder) @@ -192,7 +192,7 @@ resulting order: child1, child4, child2, child3 | +-- property1 = "property from /libs/sling/example/child3" | +-- property2 = "property from /apps/sling/example/child3" </code></pre> -<h2>Overriding Resource Picker (Override approach)</h2> +<h2><a href="#overriding-resource-picker-override-approach-" name="overriding-resource-picker-override-approach-">Overriding Resource Picker (Override approach)</a></h2> <table> <thead> <tr> @@ -214,7 +214,7 @@ resulting order: child1, child4, child2, child3 </tbody> </table> <p>This picker is thought for extending content of another already existing resource (which should not be modified). The client (i.e. the code using the merged resource) must directly reference the most specific resource type (i.e. it must be aware of the sub resource type).</p> -<h3>Example</h3> +<h3><a href="#example" name="example">Example</a></h3> <pre><code>/apps/sling/base (nt:folder) +-- child1 (nt:folder) | +-- property1 = "property from /libs/sling/example/child1"
http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/scheduler-service-commons-scheduler.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/scheduler-service-commons-scheduler.html b/documentation/bundles/scheduler-service-commons-scheduler.html index f064b2f..41b4a2e 100644 --- a/documentation/bundles/scheduler-service-commons-scheduler.html +++ b/documentation/bundles/scheduler-service-commons-scheduler.html @@ -76,9 +76,9 @@ <div class="note"> The notion of Job used in this context is a different one than the one used for <a href="/documentation/bundles/apache-sling-eventing-and-job-handling.html">Sling Jobs</a>. The main difference is that a scheduler's job is not persisted. </div> -<h2>Examples of jobs that are scheduled by leveraging the whiteboard pattern</h2> +<h2><a href="#examples-of-jobs-that-are-scheduled-by-leveraging-the-whiteboard-pattern" name="examples-of-jobs-that-are-scheduled-by-leveraging-the-whiteboard-pattern">Examples of jobs that are scheduled by leveraging the whiteboard pattern</a></h2> <p>The following examples show you how to define and schedule a job by leveraging the whiteboard pattern.</p> -<h3>Scheduling with a cron expression</h3> +<h3><a href="#scheduling-with-a-cron-expression" name="scheduling-with-a-cron-expression">Scheduling with a cron expression</a></h3> <p>The following job is executed every minute by setting <em>scheduler.expression</em> to the cron expression <em>"0 * * * * ?"</em>:</p> <pre><code>package sling.docu.examples; @@ -102,7 +102,7 @@ public class ScheduledCronJob implements Runnable { // } </code></pre> -<h3>Scheduling at periodic times</h3> +<h3><a href="#scheduling-at-periodic-times" name="scheduling-at-periodic-times">Scheduling at periodic times</a></h3> <p>The following job is executed every ten seconds by setting <em>scheduler.period</em> to <em>10</em>:</p> <pre><code>package sling.docu.examples; @@ -126,11 +126,11 @@ public class ScheduledPeriodicJob implements Runnable { // } </code></pre> -<h3>Preventing concurrent execution</h3> +<h3><a href="#preventing-concurrent-execution" name="preventing-concurrent-execution">Preventing concurrent execution</a></h3> <p>By default, jobs can be concurrently executed. To prevent this, set the <em>scheduler.concurrent</em> property to <em>false</em>:</p> <pre><code>@Property(name="scheduler.concurrent", boolValue=false) </code></pre> -<h3>Scheduling the job just once in a cluster</h3> +<h3><a href="#scheduling-the-job-just-once-in-a-cluster" name="scheduling-the-job-just-once-in-a-cluster">Scheduling the job just once in a cluster</a></h3> <p>If the same code/same services is executed on multiple nodes within a cluster, the same job might be scheduled on each instance. If this is not desired, the job can either be bound to the leader of the topology or a single instance (which one this is, is not further defined):</p> <pre><code>@Property(name="scheduler.runOn", value="LEADER"); </code></pre> @@ -138,11 +138,11 @@ public class ScheduledPeriodicJob implements Runnable { <pre><code>@Property(name="scheduler.runOn", value="SINGLE"); </code></pre> <p>Since in contrast to <a href="/documentation/bundles/apache-sling-eventing-and-job-handling.html">Sling Jobs</a> the scheduler queue is only held in memory, there will be no distribution of jobs. So if job '1' was scheduled on instance 'a' with the option to run on the leader only, but the leader is instance 'b', which hasn't the job in the queue, the job will never be executed by any instance!</p> -<h2>The Scheduler API</h2> +<h2><a href="#the-scheduler-api" name="the-scheduler-api">The Scheduler API</a></h2> <p>The scheduler has methods to execute jobs periodically, based on a cron expression or at a given time. For more details please refer to the <a href="http://sling.apache.org/apidocs/sling6/org/apache/sling/commons/scheduler/Scheduler.html">javadocs</a>.</p> -<h2>Examples of scheduled jobs registered through the scheduler API</h2> +<h2><a href="#examples-of-scheduled-jobs-registered-through-the-scheduler-api" name="examples-of-scheduled-jobs-registered-through-the-scheduler-api">Examples of scheduled jobs registered through the scheduler API</a></h2> <p>The following examples show you how to define and schedule a job that is registered through the scheduler api.</p> -<h3>Defining the job</h3> +<h3><a href="#defining-the-job" name="defining-the-job">Defining the job</a></h3> <p>The following code sample defines a <em>job</em> object that writes a message in the logs:</p> <pre><code>final Runnable job = new Runnable() { public void run() { @@ -150,25 +150,25 @@ public class ScheduledPeriodicJob implements Runnable { } }; </code></pre> -<h3>Scheduling with a cron expression</h3> +<h3><a href="#scheduling-with-a-cron-expression" name="scheduling-with-a-cron-expression">Scheduling with a cron expression</a></h3> <p>To execute the job as defined above at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday, you can use the <em>addJob()</em> method with the following parameters:</p> <pre><code>String schedulingExpression = "0 15 10 ? * MON-FRI"; this.scheduler.addJob("myJob", job, null, schedulingExpression, true); </code></pre> <p>Refer to http://www.docjar.com/docs/api/org/quartz/CronTrigger.html to define more scheduling expressions.</p> -<h3>Scheduling at periodic times</h3> +<h3><a href="#scheduling-at-periodic-times" name="scheduling-at-periodic-times">Scheduling at periodic times</a></h3> <p>To execute the job as defined above every 3 minutes (180 seconds), you can use the <em>addPeriodicJob()</em> method with the following parameters:</p> <pre><code>long period = 3*60; //the period is expressed in seconds this.scheduler.addPeriodicJob("myJob", job, null, period, true); </code></pre> -<h3>Scheduling at a given time</h3> +<h3><a href="#scheduling-at-a-given-time" name="scheduling-at-a-given-time">Scheduling at a given time</a></h3> <p>To execute the job as defined above at a specific date (on January 10th 2020), you can use the <em>fireJobAt()</em> method with the following parameters:</p> <pre><code>SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd"); String date = "2020/01/10"; java.util.Date fireDate = formatter.parse(date); this.scheduler.fireJobAt("myJob", job, null, fireDate); </code></pre> -<h3>A service scheduling the job based on 3 different kinds of scheduling</h3> +<h3><a href="#a-service-scheduling-the-job-based-on-3-different-kinds-of-scheduling" name="a-service-scheduling-the-job-based-on-3-different-kinds-of-scheduling">A service scheduling the job based on 3 different kinds of scheduling</a></h3> <p>The code implementing a service that simultaneously executes the job based on 3 different kinds of scheduling can look as follows:</p> <pre><code>package sling.docu.examples; http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/scripting.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/scripting.html b/documentation/bundles/scripting.html index 8eb16a3..a3a0b11 100644 --- a/documentation/bundles/scripting.html +++ b/documentation/bundles/scripting.html @@ -75,7 +75,7 @@ </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p><!-- TODO reactivate TOC once JBake moves to flexmark-java --> </p> <p>Sling Scripting allows the easy development and usage of different scripting (aka templating) engines.</p> -<h1>Sling Scripting Engines</h1> +<h1><a href="#sling-scripting-engines" name="sling-scripting-engines">Sling Scripting Engines</a></h1> <ul> <li>Freemarker *</li> <li>Groovy *</li> http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/scripting/scripting-htl.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/scripting/scripting-htl.html b/documentation/bundles/scripting/scripting-htl.html index 380f972..c454a5f 100644 --- a/documentation/bundles/scripting/scripting-htl.html +++ b/documentation/bundles/scripting/scripting-htl.html @@ -75,7 +75,7 @@ </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p>The Apache Sling HTL Scripting Engine, <a href="https://issues.apache.org/jira/browse/SLING-6028">formerly known as Sightly</a>, is the reference implementation of the <a href="https://github.com/Adobe-Marketing-Cloud/htl-spec">HTML Template Language</a>.</p> <p><!-- TODO reactivate TOC once JBake moves to flexmark-java --> </p> -<h1>Modules</h1> +<h1><a href="#modules" name="modules">Modules</a></h1> <p>The Sling implementation is comprised of the following modules:</p> <ol> <li><a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/sightly/compiler"><code>org.apache.sling.scripting.sightly.compiler</code></a> - provides support for compiling HTML Template Language scripts into an Abstract Syntax Tree</li> @@ -86,7 +86,7 @@ <li><a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/sightly/repl"><code>org.apache.sling.scripting.sightly.repl</code></a> - HTL Read-Eval-Print Loop Environment (REPL), useful for quickly prototyping scripts</li> <li><a href="https://github.com/apache/sling/tree/trunk/tooling/maven/htl-maven-plugin"><code>htl-maven-plugin</code></a> - M2Eclipse compatible HTL Maven Plugin that provides support for validating HTML Template Language scripts from projects during build time</li> </ol> -<h1>The Use-API</h1> +<h1><a href="#the-use-api" name="the-use-api">The Use-API</a></h1> <p>The <a href="https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#4-use-api">HTML Template Language Specification</a> explicitly defines two ways of implementing support for business logic objects:</p> <ol> <li> @@ -123,7 +123,7 @@ use(['dep1.js', 'dep2.js'], function (Dep1, Dep2) { </ol> <p>The HTL implementation from Sling provides the basic POJO support through the <a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/Use.java"><code>org.apache.sling.scripting.sightly.pojo.Use</code></a> interface and the <a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/JavaUseProvider.java"><code>JavaUseProvider</code></a>, whereas the <code>use</code> function is implemented by the <code>org.apache.sling.scripting.sightly.js.provider</code> bundle.</p> <p>However, the Sling implementation provides a few extensions to the Use-API.</p> -<h2>Sling-specific Use-API Extensions</h2> +<h2><a href="#sling-specific-use-api-extensions" name="sling-specific-use-api-extensions">Sling-specific Use-API Extensions</a></h2> <p>A full HTL installation provides the following Use Providers, in the order of their priority (the higher the service ranking value, the higher the priority):</p> <table> <thead> @@ -171,7 +171,7 @@ use(['dep1.js', 'dep2.js'], function (Dep1, Dep2) { </tbody> </table> <p>The <code>service.ranking</code> value of each Use Provider is configurable, allowing for fine tuning of the order in which the providers are queried when <code>data-sly-use</code> is called. However, in order to not affect core functionality the <code>RenderUnitProvider</code> should always have the highest ranking. If you need to configure the providers' service ranking head over to the configuration console at <a href="http://localhost:8080/system/console/configMgr">http://localhost:8080/system/console/configMgr</a>.</p> -<h3>Global Objects</h3> +<h3><a href="#global-objects" name="global-objects">Global Objects</a></h3> <p>The following global objects are available to all Use objects, either as a request attribute or as a property made available in the <code>javax.script.Bindings</code> map or attached to the <code>this</code> context of the <code>use</code> function:</p> <pre><code> currentNode // javax.jcr.Node currentSession // javax.jcr.Session @@ -185,7 +185,7 @@ use(['dep1.js', 'dep2.js'], function (Dep1, Dep2) { response // org.apache.sling.api.SlingHttpServletResponse sling // org.apache.sling.api.scripting.SlingScriptHelper </code></pre> -<h3>Sling Models Use Provider</h3> +<h3><a href="#sling-models-use-provider" name="sling-models-use-provider">Sling Models Use Provider</a></h3> <p>Loading a Sling Model can be done with the following code:</p> <pre><code> <div data-sly-use.model3="org.example.models.Model3"> ${model3.shine} @@ -193,7 +193,7 @@ use(['dep1.js', 'dep2.js'], function (Dep1, Dep2) { </code></pre> <p>Depending on the implementation the above code would either load the implementation with the highest service ranking of <code>Model3</code> if <code>org.example.models.Model3</code> is an interface, or would load the model <code>org.example.models.Model3</code> if this is a concrete implementation.</p> <p>It's important to note that this use provider will only load models that are adaptable from <code>SlingHttpServletRequest</code> or <code>Resource</code>.</p> -<h4>Passing parameters</h4> +<h4><a href="#passing-parameters" name="passing-parameters">Passing parameters</a></h4> <p>Passed parameters will be made available to the Sling Model as request attributes. Assuming the following markup:</p> <pre><code> <div data-sly-use.model3="${'org.example.models.Model3' @ colour='red', path=resource.path}"> ${model3.shine} @@ -210,9 +210,9 @@ use(['dep1.js', 'dep2.js'], function (Dep1, Dep2) { private String path; } </code></pre> -<h3>Java Use Provider</h3> +<h3><a href="#java-use-provider" name="java-use-provider">Java Use Provider</a></h3> <p>The Java Use Provider can be used to load OSGi services, objects exported by bundles or backed by a <code>Resource</code>.</p> -<h4>Resource-backed Java classes</h4> +<h4><a href="#resource-backed-java-classes" name="resource-backed-java-classes">Resource-backed Java classes</a></h4> <p>When objects are backed by <code>Resources</code> the Java Use Provider will automatically handle the compilation of these classes. The classes' package names should correspond to the path of the backing resource, making sure to replace illegal Java characters with underscores - <code>_</code>.</p> <p><strong>Example:</strong> Assuming the following content structure:</p> <pre><code> âââ apps @@ -235,7 +235,7 @@ use(['dep1.js', 'dep2.js'], function (Dep1, Dep2) { </html> </code></pre> <p>The advantage of loading a bean using just the simple class name (e.g. <code>data-sly-use.page="PageBean"</code>) is that an inheriting component can overlay the <code>PageBean.java</code> file and provide a different logic. In this case the package name of the <code>PageBean</code> class will automatically be derived from the calling script's parent path (e.g. <code>apps.my_project.components.page</code>) - the bean doesn't even have to specify it. However, keep in mind that loading a bean this way is slower than providing the fully qualified class name, since the provider has to check if there is a backing resource. At the same time, loading an object using its fully qualified class name will not allow overriding it by inheriting components.</p> -<h4>Passing parameters</h4> +<h4><a href="#passing-parameters" name="passing-parameters">Passing parameters</a></h4> <p>Passed parameters will be made available to the Use object as request attributes and, if the object implements the <a href="https://github.com/apache/sling/blob/trunk/bundles/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/pojo/Use.java"><code>org.apache.sling.scripting.sightly.pojo.Use</code></a> interface, through the <code>javax.script.Bindings</code> passed to the <code>init</code> method. Assuming the following markup:</p> <pre><code> <div data-sly-use.useObject="${'org.example.use.MyUseObject' @ colour='red', year=2016}"> ${useObject.shine} @@ -303,7 +303,7 @@ public class RequestAdapterFactory implements AdapterFactory { } } </code></pre> -<h3>JavaScript Use Provider</h3> +<h3><a href="#javascript-use-provider" name="javascript-use-provider">JavaScript Use Provider</a></h3> <p>The JavaScript Use Provider allows loading objects created through the <code>use</code> function, by evaluating scripts passed to <code>data-sly-use</code>. The JavaScript files are evaluated server-side by the <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino">Rhino</a> scripting engine, through the <code>org.apache.sling.scripting.javascript</code> implementation bundle. This allows you to mix JavaScript API with the Java API exported by the platform. For more details about how you can access Java APIs from within JavaScript please check the <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Rhino/Scripting_Java#Accessing_Java_Packages_and_Classes">Rhino Java Scripting guide</a>.</p> <p><strong>Example:</strong> Assuming the following content structure:</p> <pre><code> âââ apps @@ -326,7 +326,7 @@ public class RequestAdapterFactory implements AdapterFactory { </html> </code></pre> <p>Similar to the Java Use Provider, loading the script using a relative path allows inheriting components to overlay just the Use script, without having to also overlay the calling HTL script.</p> -<h4>Global Objects</h4> +<h4><a href="#global-objects" name="global-objects">Global Objects</a></h4> <p>Besides the global objects available to all Use Providers, the JavaScript Use Provider also provides the following global objects available in the context of the <code>use</code> function:</p> <pre><code>console // basic wrapper on top of log, but without formatting / throwable support exports // basic Java implementation of CommonJS - http://requirejs.org/docs/commonjs.html @@ -338,7 +338,7 @@ sightly // the namespace object under which the asynchronous Resource-AP use // the use function </code></pre> <p>With the exception of the <code>console</code> and <code>use</code> objects, all the other global objects implemented by the JavaScript Use Provider are present in order to support the asynchronous Resource-API implemented by <code>org.apache.sling.scripting.sightly.js.provider</code>. However, this was deprecated starting with version 1.0.8 - see <a href="https://issues.apache.org/jira/browse/SLING-4964">SLING-4964</a>.</p> -<h4>Passing parameters</h4> +<h4><a href="#passing-parameters" name="passing-parameters">Passing parameters</a></h4> <p>Passed parameters will be made available to the Use object as properties of <code>this</code>. Assuming the following markup:</p> <pre><code> <div data-sly-use.logic="${'logic.js' @ colour='red', year=2017}"> My colour is ${logic.colour ? logic.colour : 'not important'} and I'm from ${logic.year} @@ -357,7 +357,7 @@ use // the use function } }); </code></pre> -<h4>Caveats</h4> +<h4><a href="#caveats" name="caveats">Caveats</a></h4> <p>Since these scripts are evaluated server-side, by compiling JavaScript to Java, you need to pay attention when comparing primitive objects using the strict equal operator (<code>===</code>) since comparisons between JavaScript and Java objects with the same apparent value will return <code>false</code> (this also applies to the strict not-equal operator - <code>!==</code>).</p> <p>Assuming the following HTL script:</p> <pre><code> <ol data-sly-use.obj="logic.js" data-sly-list="${obj}"> @@ -448,9 +448,9 @@ use // the use function //should be replaced by myObject != null ? 'this' : 'that' </code></pre> -<h3>Script Use Provider</h3> +<h3><a href="#script-use-provider" name="script-use-provider">Script Use Provider</a></h3> <p>The Script Use Provider allows loading objects evaluated by other script engines available on the platform. The same loading considerations as for the Java and JavaScript Use Providers apply.</p> -<h3>Picking the best Use Provider for a project</h3> +<h3><a href="#picking-the-best-use-provider-for-a-project" name="picking-the-best-use-provider-for-a-project">Picking the best Use Provider for a project</a></h3> <p>The following table summarises the pros and cons for each Use Provider, with the obvious exception of the Render Unit Use Provider.</p> <table> <tr> http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/scripting/scripting-jsp.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/scripting/scripting-jsp.html b/documentation/bundles/scripting/scripting-jsp.html index 7a7352a..61c1299 100644 --- a/documentation/bundles/scripting/scripting-jsp.html +++ b/documentation/bundles/scripting/scripting-jsp.html @@ -75,13 +75,13 @@ </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p>The Apache Sling JSP Scripting Engine is implemented by the <a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/jsp"><code>org.apache.sling.scripting.jsp</code></a> bundle, based on the Jasper 2 JSP engine.</p> <p>On top of that Apache Sling also provides its own JSP Taglib, implemented by the <a href="https://github.com/apache/sling/tree/trunk/bundles/scripting/jsp-taglib"><code>org.apache.sling.scripting.jsp.taglib</code></a> bundle.</p> <p>The Sling Scripting JSP Taglib supports the use of Sling as an application in JSP pages. The Sling Taglib provides the ability to invoke JSP scripts, include Resources and interact with the Sling Repository, all with JSP tags and <a href="http://docs.oracle.com/javaee/6/tutorial/doc/gjddd.html">Expression Language (EL)</a> functions.</p> -<h2>Use</h2> +<h2><a href="#use" name="use">Use</a></h2> <p>Using the Sling Taglib in a JSP page is as simple as including the Taglib include in your JSP, with the correct URI for the version of the Sling Taglib installed.</p> <pre><code><%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling" %> </code></pre> <p>Generally, the prefix to use is <code>sling</code>. Often applications include a global JSP file which includes the Sling Taglib and sets up all of the application variables and methods.</p> <p>The Sling Taglib does not attempt to reproduce the functionality of other Tag Libraries, such as <a href="http://www.oracle.com/technetwork/java/index-jsp-135995.html">JSTL</a>; additional Tag Libraries may be required to fully leverage the Sling Taglib.</p> -<h2>Taglib Versions</h2> +<h2><a href="#taglib-versions" name="taglib-versions">Taglib Versions</a></h2> <p>There have been a number of releases of the Sling Taglibs, including versions with different URIs.</p> <table> <thead> @@ -115,9 +115,9 @@ </tbody> </table> <p>All releases from 1.3 onward are expected to use the URI <code>http://sling.apache.org/taglibs/sling</code> to ensure ease of upgrading to newer versions of the Taglib.</p> -<h2>Expression Language Functions</h2> +<h2><a href="#expression-language-functions" name="expression-language-functions">Expression Language Functions</a></h2> <p>The Sling Taglib includes a number of Expression Language Functions which can be used to access the repository.</p> -<h3>adaptTo</h3> +<h3><a href="#adaptto" name="adaptto">adaptTo</a></h3> <p>Adapts an Adaptable to another class.</p> <ul> <li>Returns: <code>java.lang.Object</code></li> @@ -132,7 +132,7 @@ <p><em>Example Usage</em></p> <pre><code><c:set var="myProperties" value="${sling:adaptTo(resource,'org.apache.sling.api.resource.ValueMap')}" /> </code></pre> -<h3>encode</h3> +<h3><a href="#encode" name="encode">encode</a></h3> <p>Writes properly Cross Site Scripting (XSS) encoded text to the response using the OWASP ESAPI. Supports a number of encoding modes.</p> <ul> <li>Returns: <code>java.util.String</code> - An encoded text</li> @@ -147,7 +147,7 @@ <p><em>Example Usage</em></p> <pre><code>${sling:encode('<script>alert("Bad Stuff!");</script>','HTML')} </code></pre> -<h3>findResources</h3> +<h3><a href="#findresources" name="findresources">findResources</a></h3> <p>Searches for resources using the given query formulated in the given language.</p> <ul> <li>Returns: <code>java.util.Iterator</code> - An Iterator of Resource objects matching the query.</li> @@ -165,7 +165,7 @@ <li>${found.path}</li> </c:forEach> </code></pre> -<h3>getRelativeResource</h3> +<h3><a href="#getrelativeresource" name="getrelativeresource">getRelativeResource</a></h3> <p>Gets the resource at the relative path to the provided resource.</p> <ul> <li>Returns: <code>org.apache.sling.api.resource.Resource</code> - The resource at the relative path.</li> @@ -180,7 +180,7 @@ <p><em>Example Usage</em></p> <pre><code><c:set var="content" value="${sling:getRelativeResource(resource,'jcr:content')}" /> </code></pre> -<h3>getResource</h3> +<h3><a href="#getresource" name="getresource">getResource</a></h3> <p>Method allow for the retrieval of resources.</p> <ul> <li>Returns: <code>org.apache.sling.api.resource.Resource</code> - The resource at the path.</li> @@ -195,7 +195,7 @@ <p><em>Example Usage</em></p> <pre><code><c:set var="content" value="${sling:getResource(resourceResolver,'/content')}" /> </code></pre> -<h3>getValue</h3> +<h3><a href="#getvalue" name="getvalue">getValue</a></h3> <p>Gets the value of the specified key from the ValueMap and either coerses the value into the specified type or uses the specified type as a default depending on the parameter passed in.</p> <p>If the third parameter is a class, the resulting value will be coersed into the class, otherwise, the third parameter is used as the default when retrieving the value from the <code>ValueMap</code>.</p> <ul> @@ -212,7 +212,7 @@ <p><em>Example Usage</em></p> <pre><code><c:set var="content" value="${sling:getValue(properties,'jcr:title',resource.name)}" /> </code></pre> -<h3>listChildren</h3> +<h3><a href="#listchildren" name="listchildren">listChildren</a></h3> <p>Method for allowing the invocation of the Sling Resource listChildren method.</p> <ul> <li>Returns: <code>java.util.Iterator</code> - The children of the resource.</li> @@ -228,9 +228,9 @@ <li>${child.path}</li> </c:forEach> </code></pre> -<h2>Tags</h2> +<h2><a href="#tags" name="tags">Tags</a></h2> <p>The Sling Taglib includes a number of Tags which can be used to access the repository, handle the inclusion of scripts and manage requests.</p> -<h3>adaptTo</h3> +<h3><a href="#adaptto" name="adaptto">adaptTo</a></h3> <p>Adapts adaptables to objects of other types.</p> <ul> <li>Attributes @@ -245,7 +245,7 @@ <p><em>Example Usage</em></p> <pre><code><sling:adaptTo adaptable="${resource}" adaptTo="org.apache.sling.api.resource.ValueMap" var="myProps" /> </code></pre> -<h3>call</h3> +<h3><a href="#call" name="call">call</a></h3> <p>Execute a script.</p> <ul> <li>Attributes @@ -260,7 +260,7 @@ <p><em>Example Usage</em></p> <pre><code><sling:call script="myscript.jsp" /> </code></pre> -<h3>defineObjects</h3> +<h3><a href="#defineobjects" name="defineobjects">defineObjects</a></h3> <p>Defines regularly used scripting variables. By default the following scripting variables are defined through this tag:</p> <ul> <li><strong>slingRequest</strong>, SlingHttpServletRequest object, providing access to the HTTP request header information - extends the standard HttpServletRequest - and provides access to Sling-specific things like resource, path info, selector, etc.</li> @@ -290,7 +290,7 @@ <p><em>Example Usage</em></p> <pre><code><sling:defineObjects /> </code></pre> -<h3>encode</h3> +<h3><a href="#encode" name="encode">encode</a></h3> <p>Writes properly Cross Site Scripting (XSS) encoded text to the response using the OWASP ESAPI. Supports a number of encoding modes.</p> <ul> <li>Attributes: @@ -305,7 +305,7 @@ <p><em>Example Usage</em></p> <pre><code><sling:encode value="<script>alert('Bad Stuff!');</script>" mode="HTML" /> </code></pre> -<h3>eval</h3> +<h3><a href="#eval" name="eval">eval</a></h3> <p>Evaluates a script invocation and includes the result in the current page.</p> <ul> <li>Attributes @@ -322,7 +322,7 @@ <p><em>Example Usage</em></p> <pre><code><sling:eval script="myscript.jsp" /> </code></pre> -<h3>findResources</h3> +<h3><a href="#findresources" name="findresources">findResources</a></h3> <p>Tag for searching for resources using the given query formulated in the given language.</p> <ul> <li>Attributes @@ -337,7 +337,7 @@ <p><em>Example Usage</em></p> <pre><code><sling:findResources query="/jcr:root//*[jcr:contains(., 'Sling')] order by @jcr:score" language="xpath" var="resources" /> </code></pre> -<h3>forward</h3> +<h3><a href="#forward" name="forward">forward</a></h3> <p>Forwards a request to a resource rendering the current page</p> <ul> <li>Attributes @@ -355,7 +355,7 @@ <p><em>Example Usage</em></p> <pre><code><sling:forward path="/content/aresource" resourceType="myapp/components/display" /> </code></pre> -<h3>getProperty</h3> +<h3><a href="#getproperty" name="getproperty">getProperty</a></h3> <p>Retrieves the value from the ValueMap, allowing for a default value or coercing the return value.</p> <ul> <li>Attributes @@ -372,7 +372,7 @@ <p><em>Example Usage</em></p> <pre><code><sling:getProperties properties="${properties}" key="jcr:title" defaultValue="${resource.name}" var="title" /> </code></pre> -<h3>getResource</h3> +<h3><a href="#getresource" name="getresource">getResource</a></h3> <p>Retrieves resources based on either an absolute path or a relative path and a base resource.</p> <ul> <li>Attributes @@ -389,7 +389,7 @@ <p><em>Example Usage</em></p> <pre><code><sling:getResource base="${resource}" path="jcr:content" var="content" /> </code></pre> -<h3>include</h3> +<h3><a href="#include" name="include">include</a></h3> <p>Includes a resource rendering into the current page.</p> <ul> <li>Attributes @@ -410,7 +410,7 @@ <p><em>Example Usage</em></p> <pre><code><sling:include path="/content/aresource" resourceType="myapp/components/display" /> </code></pre> -<h3>listChildren</h3> +<h3><a href="#listchildren" name="listchildren">listChildren</a></h3> <p>Lists the children of a Sling Resource.</p> <ul> <li>Attributes http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/scripting/scripting-thymeleaf.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/scripting/scripting-thymeleaf.html b/documentation/bundles/scripting/scripting-thymeleaf.html index e7e2695..4b2ac74 100644 --- a/documentation/bundles/scripting/scripting-thymeleaf.html +++ b/documentation/bundles/scripting/scripting-thymeleaf.html @@ -75,7 +75,7 @@ </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p>Sling Scripting Thymeleaf is the scripting engine for <a href="http://www.thymeleaf.org"><em>Thymeleaf</em></a> (3.0) templates.</p> <p><!-- TODO reactivate TOC once JBake moves to flexmark-java --> </p> -<h1>Features</h1> +<h1><a href="#features" name="features">Features</a></h1> <ul> <li>Supporting all of Thymeleaf's extension points: <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/templateresolver/ITemplateResolver.html"><em>TemplateResolver</em></a>s, <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/messageresolver/IMessageResolver.html"><em>MessageResolver</em></a>s, <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/dialect/IDialect.html"><em>Dialect</em></a>s, <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/linkbuilder/ILinkBuilder.html"><em>LinkBuilder</em></a>s, <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/templateparser/markup/decoupled/IDecoupledTemplateLogicResolver.html"><em>DecoupledTemplateLogicResolver</em></a>, <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/cache/ICacheManager.html"><em>CacheManager</em></a> and <a href="http://www.thymeleaf.org /apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/context/IEngineContext.html"><em>EngineContextFactory</em></a></li> <li><code>SlingResourceTemplateResolver</code> customizable through <code>TemplateModeProvider</code></li> @@ -84,7 +84,7 @@ <li><code>SlingDialect</code></li> <li>Thymeleaf's <a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/ITemplateEngine.html"><code>TemplateEngine</code></a> registered as OSGi Service (<a href="http://www.thymeleaf.org/apidocs/thymeleaf/3.0.0.RELEASE/org/thymeleaf/ITemplateEngine.html"><code>ITemplateEngine</code></a>) for direct use</li> </ul> -<h1>Installation</h1> +<h1><a href="#installation" name="installation">Installation</a></h1> <p>For running Sling Scripting Thymeleaf with Sling's Launchpad some dependencies need to be resolved. This can be achieved by installing the following bundles:</p> <pre><code>mvn:org.attoparser/attoparser/2.0.2.RELEASE mvn:org.unbescape/unbescape/1.1.4.RELEASE @@ -95,22 +95,22 @@ mvn:org.javassist/javassist/3.20.0-GA <pre><code>karaf@root()> feature:install sling-scripting-thymeleaf </code></pre> <p><strong>Note:</strong> Sling Scripting Thymeleaf requires an implementation of OSGi Declarative Services 1.3 (e.g. <a href="http://felix.apache.org/documentation/subprojects/apache-felix-service-component-runtime.html">Apache Felix Service Component Runtime</a> 2.0.0 or greater)</p> -<h1>Configuration</h1> -<h2>Apache Sling Scripting Thymeleaf âScriptEngineFactoryâ</h2> +<h1><a href="#configuration" name="configuration">Configuration</a></h1> +<h2><a href="#apache-sling-scripting-thymeleaf-scriptenginefactory-" name="apache-sling-scripting-thymeleaf-scriptenginefactory-">Apache Sling Scripting Thymeleaf âScriptEngineFactoryâ</a></h2> <p>By default Sling Scripting Thymeleaf's <em>ScriptEngineFactory</em> is configured for templates with extension <code>html</code> and mime type <code>text/html</code> and uses all of Thymeleaf's standard extensions either <em>also</em> or <em>exclusively</em>.</p> <p><img src="Scripting-Thymeleaf-ScriptEngineFactory.png" alt="Apache Sling Scripting Thymeleaf âScriptEngineFactoryâ" /></p> -<h2>Apache Sling Scripting Thymeleaf âSling Resource TemplateResolverâ</h2> +<h2><a href="#apache-sling-scripting-thymeleaf-sling-resource-templateresolver-" name="apache-sling-scripting-thymeleaf-sling-resource-templateresolver-">Apache Sling Scripting Thymeleaf âSling Resource TemplateResolverâ</a></h2> <p>The <em>Sling Resource TemplateResolver</em> is configured to resolve templates with <em>use decoupled logic</em> enabled.</p> <p><img src="Scripting-Thymeleaf-Sling-Resource-TemplateResolver.png" alt="Apache Sling Scripting Thymeleaf âSling Resource TemplateResolverâ" /></p> -<h2>Apache Sling Scripting Thymeleaf âPattern TemplateModeProviderâ</h2> +<h2><a href="#apache-sling-scripting-thymeleaf-pattern-templatemodeprovider-" name="apache-sling-scripting-thymeleaf-pattern-templatemodeprovider-">Apache Sling Scripting Thymeleaf âPattern TemplateModeProviderâ</a></h2> <p>The <em>Pattern TemplateModeProvider</em> is configured to match template paths against default extensions for providing template modes (of course except no-op mode <code>RAW</code>).</p> <p><img src="Scripting-Thymeleaf-Pattern-TemplateModeProvider.png" alt="Apache Sling Scripting Thymeleaf âPattern TemplateModeProvider" /></p> -<h2>Apache Sling Scripting Thymeleaf âResourceBundle MessageResolverâ</h2> +<h2><a href="#apache-sling-scripting-thymeleaf-resourcebundle-messageresolver-" name="apache-sling-scripting-thymeleaf-resourcebundle-messageresolver-">Apache Sling Scripting Thymeleaf âResourceBundle MessageResolverâ</a></h2> <p>The <em>ResourceBundle MessageResolver</em> is configured to use the message's key as absent message representation.</p> <p><img src="Scripting-Thymeleaf-ResourceBundle-MessageResolver.png" alt="Apache Sling Scripting Thymeleaf âResourceBundle MessageResolverâ" /></p> -<h1>Sling Dialect</h1> +<h1><a href="#sling-dialect" name="sling-dialect">Sling Dialect</a></h1> <p>Sling Scripting Thymeleaf comes with its own dialect using the <code>sling</code> prefix/namespace currently supporting the <em>include</em> feature known from <a href="/documentation/bundles/scripting/scripting-jsp.html">Sling Scripting JSP Taglib</a>.</p> -<h2>include</h2> +<h2><a href="#include" name="include">include</a></h2> <p><code><header data-sling-include="${resource}" data-sling-resourceType="'example/page/header'" data-sling-unwrap="true"/></code></p> <p><code>include</code> - The resource object (<a href="http://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/Resource.html"><code>Resource</code></a>) or the path (<code>String</code>) of the resource object to include in the current request processing. If this path is relative it is appended to the path of the current resource whose script is including the given resource.</p> <h3>supported options (* = <a href="http://sling.apache.org/apidocs/sling7/org/apache/sling/api/request/RequestDispatcherOptions.html">RequestDispatcher option</a>)</h3> @@ -125,9 +125,9 @@ mvn:org.javassist/javassist/3.20.0-GA </li> <li><code>unwrap</code> (<code>Boolean</code>): removes the host element</li> </ul> -<h1>Class Diagram</h1> +<h1><a href="#class-diagram" name="class-diagram">Class Diagram</a></h1> <p><a href="Scripting-Thymeleaf-Class-Diagram.png"><img src="Scripting-Thymeleaf-Class-Diagram.png" alt="Class Diagram" /></a></p> -<h1>Sample</h1> +<h1><a href="#sample" name="sample">Sample</a></h1> <p>The <a href="http://svn.apache.org/repos/asf/sling/trunk/samples/fling/">Sling Fling Sample</a> is a sample using Sling Scripting Thymeleaf with <a href="/documentation/bundles/models.html">Sling Models</a> and <a href="/documentation/bundles/sling-query.html">Sling Query</a>.</p> <p><img src="sling-fling-sample.png" alt="Sling Fling Sample" /></p></section></div></div> <div class="footer"> http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/servlet-helpers.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/servlet-helpers.html b/documentation/bundles/servlet-helpers.html index 8fdd286..eb01aeb 100644 --- a/documentation/bundles/servlet-helpers.html +++ b/documentation/bundles/servlet-helpers.html @@ -75,11 +75,10 @@ </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p>The Sling Servlet Helpers bundle provides mock implementations of the <code>SlingHttpServletRequest</code>, <code>SlingHttpServletResponse</code> and related classes.</p> <p>Those mock implementations are meant to be used in tests and also with services like the <code>SlingRequestProcessor</code> when making requests to that service outside of an HTTP request processing context.</p> <p>See the <a href="https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/servlet-helpers">automated tests</a> of the <code>servlet-helpers</code> module for more info.</p> -<h2>Usage</h2> -<h3>SlingHttpServletRequest</h3> +<h2><a href="#usage" name="usage">Usage</a></h2> +<h3><a href="#slinghttpservletrequest" name="slinghttpservletrequest">SlingHttpServletRequest</a></h3> <p>Example for preparing a sling request with custom request data:</p> -<pre><code>#!java -// prepare sling request +<pre><code><!-- TODO syntax marker (#!java) disabled -->// prepare sling request MockSlingHttpServletRequest request = new MockSlingHttpServletRequest(resourceResolver); // simulate query string @@ -111,10 +110,9 @@ request.addHeader("header1", "value1"); // set cookies request.addCookie(new Cookie("cookie1", "value1")); </code></pre> -<h3>SlingHttpServletResponse</h3> +<h3><a href="#slinghttpservletresponse" name="slinghttpservletresponse">SlingHttpServletResponse</a></h3> <p>Example for preparing a sling response which can collect the data that was written to it:</p> -<pre><code>#!java -// prepare sling response +<pre><code><!-- TODO syntax marker (#!java) disabled -->// prepare sling response MockSlingHttpServletResponse response = new MockSlingHttpServletResponse(); // execute the code that writes to the response... http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/sling-health-check-tool.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/sling-health-check-tool.html b/documentation/bundles/sling-health-check-tool.html index f549081..2d0e519 100644 --- a/documentation/bundles/sling-health-check-tool.html +++ b/documentation/bundles/sling-health-check-tool.html @@ -80,7 +80,7 @@ <li>Source code at <a href="http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/healthcheck">http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/healthcheck</a></li> <li>adaptTo slides about Health Checks: <a href="http://www.slideshare.net/bdelacretaz/slinghc-bdelacretazadaptto2013">Introduction</a> and <a href="https://adapt.to/content/dam/adaptto/production/presentations/2014/adaptTo2014-Sling-Health-Checks-New-And-Noteworthy-Georg-Henzler.pdf/_jcr_content/renditions/original.media_file.download_attachment.file/adaptTo2014-Sling-Health-Checks-New-And-Noteworthy-Georg-Henzler.pdf">Health Check Executor</a></li> </ul> -<h2>Use cases</h2> +<h2><a href="#use-cases" name="use-cases">Use cases</a></h2> <p>Generally health checks have two high level use cases:</p> <ul> <li>Operations teams checking sling instances for their internal state manually</li> @@ -127,7 +127,7 @@ ... details omitted } </code></pre> -<h3>SlingHealthCheck annotation</h3> +<h3><a href="#slinghealthcheck-annotation" name="slinghealthcheck-annotation">SlingHealthCheck annotation</a></h3> <p>The <code>SlingHealthCheck</code> annotation makes it easier to specify the required <code>HealthCheck</code> service properties.</p> <p>Here's an example from the <code>samples</code> module - see the <code>annotations</code> module for more details.</p> <pre><code>@SlingHealthCheck( @@ -144,11 +144,11 @@ public class AnnotatedHealthCheckSample implements HealthCheck { } } </code></pre> -<h2>Executing Health Checks</h2> +<h2><a href="#executing-health-checks" name="executing-health-checks">Executing Health Checks</a></h2> <p>Health Checks can be executed via a <a href="#webconsole-plugin">webconsole plugin</a>, the <a href="#health-check-servlet">health check servlet</a> or via <a href="#jmx-access-to-health-checks">JMX</a>. <code>HealthCheck</code> services can be selected for execution based on their <code>hc.tags</code> multi-value service property. </p> <p>The <code>HealthCheckFilter</code> utility accepts positive and negative tag parameters, so that <code>-security,sling</code> selects all <code>HealthCheck</code> having the <code>sling</code> tag but not the <code>security</code> tag, for example.</p> <p>For advanced use cases it is also possible to use the API directly by using the interface <code>org.apache.sling.hc.api.execution.HealthCheckExecutor</code>.</p> -<h2>Health Check bundles</h2> +<h2><a href="#health-check-bundles" name="health-check-bundles">Health Check bundles</a></h2> <p>The Health Check subsystem consists of the following bundles:</p> <ul> <li>The only required bundles are <code>org.apache.sling.hc.api</code> which provides the API and <code>org.apache.sling.hc.core</code> which provides some utility classes and some generally useful <code>HealthCheck</code> services (e.g. the health check executor)</li> @@ -174,7 +174,7 @@ public class AnnotatedHealthCheckSample implements HealthCheck { </ul> <p>A bridge to server-side OSGi-aware JUnit tests is provided by the <code>JUnitHealthCheck</code>, from the <code>org.apache.sling.junit.healthcheck</code> bundle.</p> <p>The <code>org.apache.sling.hc.samples</code> bundle provides an example <code>OsgiScriptBindingsProvider</code> for the default <code>ScriptableHealthCheck</code>, which provides OSGi-related information to health check script expressions.</p> -<h2>Configuring Health Checks</h2> +<h2><a href="#configuring-health-checks" name="configuring-health-checks">Configuring Health Checks</a></h2> <p><code>HealthCheck</code> services are created via OSGi configurations. Generic health check service properties are interpreted by the health check executor service. Custom health check service properties can be used by the health check implementation itself to configure its behaviour.</p> <p>The following generic Health Check properties may be used for all checks:</p> <table> @@ -223,7 +223,7 @@ public class AnnotatedHealthCheckSample implements HealthCheck { "language.extension" : "ecma" </code></pre> <p>The service properties starting with the <code>hc.</code> prefix in this example should be provided by all <code>HealthCheck</code> services. </p> -<h2>Configuring the Health Check Executor</h2> +<h2><a href="#configuring-the-health-check-executor" name="configuring-the-health-check-executor">Configuring the Health Check Executor</a></h2> <p>The health check executor can <strong>optionally</strong> be configured via service PID <code>org.apache.sling.hc.core.impl.executor.HealthCheckExecutorImpl</code>:</p> <table> <thead> @@ -255,17 +255,17 @@ public class AnnotatedHealthCheckSample implements HealthCheck { </tr> </tbody> </table> -<h2>Webconsole plugin</h2> +<h2><a href="#webconsole-plugin" name="webconsole-plugin">Webconsole plugin</a></h2> <p>If the <code>org.apache.sling.hc.webconsole</code> bundle is active, a webconsole plugin at <code>/system/console/healthcheck</code> allows for executing health checks, optionally selected based on their tags (positive and negative selection, see the <code>HealthCheckFilter</code> mention above).</p> <p>The DEBUG logs of health checks can optionally be displayed, and an option allows for showing only health checks that have a non-OK status.</p> <p>The screenshot below shows an example, as of svn revision 1513462.</p> <p><img src="sling-hc-plugin.jpg" alt="Health Check Webconsole Plugin" /></p> -<h2>JMX access to health checks</h2> +<h2><a href="#jmx-access-to-health-checks" name="jmx-access-to-health-checks">JMX access to health checks</a></h2> <p>If the <code>org.apache.sling.hc.jmx</code> bundle is active, a JMX MBean is created for each <code>HealthCheck</code> which has the service property <code>hc.mbean.name</code> service property set. All health check MBeans are registered in the domain <code>org.apache.sling.healthcheck</code> with a type of <code>HealthCheck</code>.</p> <p>The MBean gives access to the <code>Result</code> and the log, as shown on the screenshot below. </p> <p>See the example configurations of the <code>org.apache.sling.hc.samples</code> for more details.</p> <p><img src="jconsole-hc.jpg" alt="JConsole showing Sling Health Check MBeans" /></p> -<h2>Health Check Servlet</h2> +<h2><a href="#health-check-servlet" name="health-check-servlet">Health Check Servlet</a></h2> <p>Starting with version 1.2.4 of the <code>org.apache.sling.hc.core</code> bundle, a flexible Health Checks execution servlet is available. It provides similar features to the Web Console plugin described above, with output in HTML, JSON (plain or jsonp) and TXT (concise or verbose) formats (see HTML format rendering page for more documentation).</p> <p>The Health Checks Servlet is disabled by default, to enable it create an OSGi configuration like</p> <pre><code>PID = org.apache.sling.hc.core.impl.servlet.HealthCheckExecutorServlet @@ -273,7 +273,7 @@ servletPath = /system/health </code></pre> <p>which specifies the servlet's base path. That URL then returns an HTML page, by default with the results of all active health checks and with instructions at the end of the page about URL parameters which can be used to select specific Health Checks and control their execution and output format.</p> <p>Note that by design <strong>the Health Checks Servlet doesn't do any access control by itself</strong> to ensure it can detect unhealthy states of the authentication itself. Make sure the configured path is only accessible to relevant infrastructure and operations people. Usually all <code>/system/*</code> paths are only accessible from a local network and not routed to the Internet.</p> -<h2>Health Checks as server-side JUnit tests</h2> +<h2><a href="#health-checks-as-server-side-junit-tests" name="health-checks-as-server-side-junit-tests">Health Checks as server-side JUnit tests</a></h2> <p>The <code>org.apache.sling.hc.junit.bridge</code> bundle makes selected Health Checks available as server-side JUnit tests. </p> <p>It requires the <code>org.apache.sling.junit.core bundle</code> which provides the server-side JUnit tests infrastructure.</p> <p>The idea is to implement the smoke tests of your system, for example, as health checks. You can then run them as part of integration testing, using the <a href="/documentation/development/sling-testing-tools.html">Sling Testing Tools</a><br/>remote testing utilities, and also as plain Health Checks for monitoring or troubleshooting Sling instances.</p> http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/sling-oak-restrictions.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/sling-oak-restrictions.html b/documentation/bundles/sling-oak-restrictions.html index b491d59..fe8342e 100644 --- a/documentation/bundles/sling-oak-restrictions.html +++ b/documentation/bundles/sling-oak-restrictions.html @@ -74,10 +74,10 @@ Sling Oak Restrictions </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p><!-- TODO reactivate TOC once JBake moves to flexmark-java --> </p> -<h2>Introduction</h2> +<h2><a href="#introduction" name="introduction">Introduction</a></h2> <p>Oak introduced plugability of restrictions as described in <a href="https://jackrabbit.apache.org/oak/docs/security/authorization/restriction.html#Pluggability">Oak Restriction Management</a>. The bundle sling-oak-restrictions provides additional restrictions that generally make sense for sling applications. Currently sling restrictions for exact resource type match and resource type match including all descendants are supplied.</p> <p><strong>Important:</strong> Using the sling restrictions (as well as standard oak restrictions) is not as performant as simple path based ACE entries without any restrictions. Permission setups should always mostly work with path based ACEs and only use ACEs with restrictions for special cases. </p> -<h2>Restriction sling:resourceTypes</h2> +<h2><a href="#restriction-sling-resourcetypes" name="restriction-sling-resourcetypes">Restriction sling:resourceTypes</a></h2> <p>This restriction allows to match against a sling resource type of a node and works much like the oak standard restriction <code>rep:ntNames</code>. Only resources that have one of the supplied resource types are matched, child and parent resources with other resource types are not matched. </p> <p>The following example allows <code>myAuthorizable</code> to write to all nodes that have either resource type <code>myproj/comp1</code> or <code>myproj/comp2</code>:</p> <pre><code>- /content/myprj/mynode @@ -98,7 +98,7 @@ </code></pre> <p>the rule from above will match <code>/content/myprj/mynode</code> and not <code>/content/myprj</code> (parent) nor <code>/content/myprj/mynode/mysubnode</code> (child).</p> <p>Naturally (as with any oak restrictions), the rule is limited to its base path. In case the node <code>/content/myprj/othernode</code> is of resource type <code>myproj/comp1</code>, it will still not match.</p> -<h2>Restriction sling:resourceTypesWithDescendants</h2> +<h2><a href="#restriction-sling-resourcetypeswithdescendants" name="restriction-sling-resourcetypeswithdescendants">Restriction sling:resourceTypesWithDescendants</a></h2> <p>This restriction matches against resource types in the same way as <a href="#restriction-slingresourcetypes">sling:resourceTypes</a>, except that it will also match all descendants of a matched node.</p> <p>The following example allows <code>myAuthorizable</code> to write to all nodes that have either resource type <code>myproj/comp1</code> or <code>myproj/comp2</code> <strong>or are a child of a node, that has one of these resource types</strong>:</p> <pre><code>- /content/myprj/mynode @@ -110,7 +110,7 @@ + sling:resourceTypesWithDescendants (String[]) = [myproj/comp1,myproj/comp2] </code></pre> <p>Assuming the structure example as mentioned in <a href="#restriction-slingresourcetypes">sling:resourceTypes</a>, the rule from above will match <code>/content/myprj/mynode</code> and <code>/content/myprj/mynode/mysubnode</code> (and any other subnodes of <code>/content/myprj/mynode</code> with arbitrary resource types), but not <code>/content/myprj</code>.</p> -<h2>Advanced Path Matching</h2> +<h2><a href="#advanced-path-matching" name="advanced-path-matching">Advanced Path Matching</a></h2> <p>Both <a href="#restriction-slingresourcetypes">sling:resourceTypes</a> and <a href="#restriction-slingresourcetypeswithdescendants">sling:resourceTypesWithDescendants</a> support advanced path matching by using <code>resourcetype@path</code>. That way instead of checking the resource type of the current node, the resource type of node at the relative path is checked. For instance this is useful for the case where page content is stored in a <code>jcr:content</code> subnode of a hierarchy, the permission however is required to become effective on the parent node of <code>jcr:content</code>. </p> <p>The following example allows <code>myAuthorizable</code> to write to all nodes that have a subnode <code>jcr:content</code> with resource type <code>myproj/comp1</code> or <code>myproj/comp2</code> including their descendants:</p> <pre><code>- /content/myprj/mynode http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/sling-pipes.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/sling-pipes.html b/documentation/bundles/sling-pipes.html index 53fd8e4..b574f2d 100644 --- a/documentation/bundles/sling-pipes.html +++ b/documentation/bundles/sling-pipes.html @@ -74,7 +74,7 @@ Sling Pipes </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p>tool for doing extract - transform - load operations through a resource tree configuration.</p> <p>often one-shot data transformations need sample code to be written & executed. This tiny tool set intends to provide ability to do such transformations with proven & reusable blocks called pipes, streaming resources from one to the other.</p> -<h2>What is a pipe</h2> +<h2><a href="#what-is-a-pipe" name="what-is-a-pipe">What is a pipe</a></h2> <pre><code> getOutputBinding ^ | @@ -97,7 +97,7 @@ <li>"container" pipes, that contains pipes, and whose job is to chain their execution : input is the input of their first pipe, output is the output of the last pipe it contains.</li> </ul> <p>A <code>Plumber</code> osgi service is provided to help getting & executing pipes.</p> -<h2>Registered Pipes</h2> +<h2><a href="#registered-pipes" name="registered-pipes">Registered Pipes</a></h2> <p>a pipe configuration is a jcr node, with:</p> <ul> <li><code>sling:resourceType</code> property, which must be a pipe type registered by the plumber</li> @@ -108,43 +108,43 @@ <li><code>additionalScripts</code> is a multi value property to declare scripts that can be reused in expressions</li> <li><code>conf</code> optional child node that contains addition configuration of the pipe (depending on the type)</li> </ul> -<h3>readers</h3> -<h4>Base pipe</h4> +<h3><a href="#readers" name="readers">readers</a></h3> +<h4><a href="#base-pipe" name="base-pipe">Base pipe</a></h4> <p>rather dummy pipe, outputs what is in input (so what is configured in path). Handy for doing some test mostly, and giving basic functionalities to others that inherit from it</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/base</code></li> </ul> -<h4>SlingQuery Pipe</h4> +<h4><a href="#slingquery-pipe" name="slingquery-pipe">SlingQuery Pipe</a></h4> <p>executes $(getInput()).children(expression)</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/slingQuery</code></li> <li><code>expr</code> mandatory property, contains slingQuery expression through which getInput()'s children will be computed to getOutput()</li> </ul> -<h4>JsonPipe</h4> +<h4><a href="#jsonpipe" name="jsonpipe">JsonPipe</a></h4> <p>feeds bindings with remote json</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/json</code></li> <li><code>expr</code> mandatory property contains url that will be called, the json be sent to the output bindings, getOutput = getInput. An empty url or a failing url will block the pipe at that given place.</li> </ul> -<h4>MultiPropertyPipe</h4> +<h4><a href="#multipropertypipe" name="multipropertypipe">MultiPropertyPipe</a></h4> <p>iterates through values of input multi value property and write them to bindings</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/multiProperty</code></li> <li><code>path</code> should be the path of a mv property</li> </ul> -<h4>XPathPipe</h4> +<h4><a href="#xpathpipe" name="xpathpipe">XPathPipe</a></h4> <p>retrieve resources resulting of an xpath query</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/xpath</code></li> <li><code>expr</code> should be a valid xpath query</li> </ul> -<h3>JsonPipe</h3> +<h3><a href="#jsonpipe" name="jsonpipe">JsonPipe</a></h3> <p>feeds bindings with remote json</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/json</code></li> <li><code>expr</code> mandatory property contains url that will be called, the json be sent to the output bindings, getOutput = getInput. An empty url or a failing url will block the pipe at that given place.</li> </ul> -<h4>AuthorizablePipe</h4> +<h4><a href="#authorizablepipe" name="authorizablepipe">AuthorizablePipe</a></h4> <p>retrieve authorizable resource corresponding to the id passed in expression, or if not found (or void expression), from the input path, output the found authorizable's resource</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/authorizable</code></li> @@ -154,55 +154,55 @@ <li><code>addToGroup</code> (expression) add found authorizable to instanciated group (in that case, considered as a write pipe)</li> <li><code>bindMembers</code> (boolean) if found authorizable is a group, bind the members (in that case, considered as a write pipe)</li> </ul> -<h4>ParentPipe</h4> +<h4><a href="#parentpipe" name="parentpipe">ParentPipe</a></h4> <p>outputs the parent resource of input resource - <code>sling:resourceType</code> is <code>slingPipes/parent</code></p> -<h4>FilterPipe</h4> +<h4><a href="#filterpipe" name="filterpipe">FilterPipe</a></h4> <p>outputs the input resource if its matches its configuration</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/filter</code></li> <li><code>conf</code> node tree that will be tested against the current input of the pipe, each <code>/conf/sub@prop=value</code> will triggers a test on <code>./sub@prop</code> property of the current input, testing if its value matches <code>value</code> regex. If the special <code>slingPipesFilter_noChildren=${true}</code> property is there with the value instantiated as a true boolean, then filter will pass if corresponding node has no children.</li> <li><code>slingPipesFilter_not='true'</code> inverts the expected result of the filter</li> </ul> -<h3>containers</h3> -<h4>Container Pipe</h4> +<h3><a href="#containers" name="containers">containers</a></h3> +<h4><a href="#container-pipe" name="container-pipe">Container Pipe</a></h4> <p>assemble a sequence of pipes</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/container</code></li> <li><code>conf</code> node contains child pipes' configurations, that will be configured in the order they are found (note you should use sling:OrderedFolder)</li> </ul> -<h4>ReferencePipe</h4> +<h4><a href="#referencepipe" name="referencepipe">ReferencePipe</a></h4> <p>execute the pipe referenced in path property</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/reference</code></li> <li><code>path</code> path of the referenced pipe</li> </ul> -<h3>writers</h3> -<h4>Write Pipe</h4> +<h3><a href="#writers" name="writers">writers</a></h3> +<h4><a href="#write-pipe" name="write-pipe">Write Pipe</a></h4> <p>writes given nodes & properties to current input</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/write</code></li> <li><code>conf</code> node tree that will be copied to the current input of the pipe, each property's names and value will be written to the input resource. Input resource will be outputed. Note that properties that will be evaluated (in an expression) as <code>null</code> for a given input resource will be removed from it. E.g. <code>./conf/some/node@prop=${null}</code> will add <code>./conf/some/node</code> structure if not in current input resource, but remove its <code>prop</code> property if any).</li> </ul> -<h3>MovePipe</h3> +<h3><a href="#movepipe" name="movepipe">MovePipe</a></h3> <p>JCR move of current input to target path (can be a node or a property)</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/mv</code></li> <li><code>expr</code> target path, note that parent path must exists</li> </ul> -<h4>RemovePipe</h4> +<h4><a href="#removepipe" name="removepipe">RemovePipe</a></h4> <p>removes the input resource, returns the parent, regardless of the resource being a node, or a property</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/rm</code></li> <li><code>conf</code> node tree that will be used to filter relative properties & subtrees to the current resource to remove. A subnode is considered to be removed if it has no property configured, nore any child.</li> </ul> -<h4>PathPipe</h4> +<h4><a href="#pathpipe" name="pathpipe">PathPipe</a></h4> <p>get or create path given in expression</p> <ul> <li><code>sling:resourceType</code> is <code>slingPipes/path</code></li> <li><code>nodeType</code> node type of the intermediate nodes to create</li> <li><code>autosave</code> should save at each creation (will make things slow, but sometimes you don't have choice)</li> </ul> -<h2>Making configuration dynamic with pipe bindings</h2> +<h2><a href="#making-configuration-dynamic-with-pipe-bindings" name="making-configuration-dynamic-with-pipe-bindings">Making configuration dynamic with pipe bindings</a></h2> <p>in order to make things interesting, most of the configurations are javascript template strings, hence valid js expressions reusing bindings (from configuration, or other pipes).</p> <p>Following configurations are evaluated:</p> <ul> @@ -212,9 +212,9 @@ </ul> <p>you can use name of previous pipes in the pipe container, or the special binding <code>path</code>, where <code>path.previousPipe</code> is the path of the current resource of previous pipe named <code>previousPipe</code></p> <p>global bindings can be set at pipe execution, external scripts can be added to the execution as well (see pipe configurations)</p> -<h2>How to execute a pipe</h2> +<h2><a href="#how-to-execute-a-pipe" name="how-to-execute-a-pipe">How to execute a pipe</a></h2> <p>for now it's possible to execute Pipes through GET (read) or POST (read/write) commands:</p> -<h3>Request Path</h3> +<h3><a href="#request-path" name="request-path">Request Path</a></h3> <ul> <li> <p>either you'll need to create a slingPipes/plumber resource, say <code>etc/pipes</code> and then to execute</p> @@ -245,7 +245,7 @@ <p>if parameter dryRun is set to true, and the executed pipe is supposed to modify content, it will log (at best it can) the change it <em>would</em> have done, without doing anything</p> <h3>Request Parameter <code>size</code></h3> <p>default response is truncated to 10 items, if you need more (or less), you can modify that settings with the size parameter</p> -<h2>sample configurations</h2> +<h2><a href="#sample-configurations" name="sample-configurations">sample configurations</a></h2> <h3>slingQuery | write</h3> <p>this pipe parse all profile nodes, and</p> <pre><code>{ @@ -374,7 +374,7 @@ } </code></pre> <p>some other samples are in https://github.com/npeltier/sling-pipes/tree/master/src/test/</p> -<h1>Compatibility</h1> +<h1><a href="#compatibility" name="compatibility">Compatibility</a></h1> <p>For running this tool on a sling instance you need:</p> <ul> <li>java 8 (Nashorn is used for expression)</li> http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/sling-query.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/sling-query.html b/documentation/bundles/sling-query.html index d1245cc..8f03873 100644 --- a/documentation/bundles/sling-query.html +++ b/documentation/bundles/sling-query.html @@ -73,7 +73,7 @@ <div class="breadcrumbs"><a href="/ng/">Home</a> » <a href="/ng/documentation.html">Documentation</a> » <a href="/ng/documentation/bundles.html">Bundles</a> » </div> <h1> Sling Query </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p>SlingQuery is a Sling resource tree traversal tool inspired by the <a href="http://api.jquery.com/category/traversing/tree-traversal/">jQuery</a> JavaScript API.</p> -<h2>Introduction</h2> +<h2><a href="#introduction" name="introduction">Introduction</a></h2> <p>The recommended way to find resources in the Sling repository is using tree-traversal methods, like <code>listChildren()</code> and <code>getParent()</code> rather than JCR queries. The latter are great for listing resources with given properties, but we can't leverage the repository tree structure with such queries. On the other hand, using tree-traversal method is quite verbose. Consider following code that takes an resource and returns its first ancestor, being <code>cq:Page</code>, with given <code>jcr:content/cq:template</code> attribute:</p> <pre><code>Resource resource = ...; while ((resource = resource.getParent()) != null) { @@ -96,7 +96,7 @@ $(resource).closest("cq:Page[jcr:content/cq:template=my/template]") </code></pre> <p>Dollar sign is a static method that takes the resource array and creates SlingQuery object. The <code>closest()</code> method returns the first ancestor matching the selector string passed as the argument.</p> <p>SlingQuery is inspired by the jQuery framework. jQuery is the source of method names, selector string syntax and the dollar sign method used as a collection constructor.</p> -<h2>Features</h2> +<h2><a href="#features" name="features">Features</a></h2> <ul> <li>useful <a href="https://github.com/Cognifide/Sling-Query/wiki/Method-list">operations</a> to traverse the resource tree,</li> <li>flexible <a href="https://github.com/Cognifide/Sling-Query/wiki/Selector-syntax">filtering syntax</a>,</li> @@ -104,7 +104,7 @@ $(resource).closest("cq:Page[jcr:content/cq:template=my/template]") <li><code>SlingQuery</code> object is immutable (thread-safe),</li> <li>fluent, friendly, jQuery-like API.</li> </ul> -<h2>Installation</h2> +<h2><a href="#installation" name="installation">Installation</a></h2> <p>Add following Maven dependency to your <code>pom.xml</code>:</p> <pre><code><dependency> <groupId>org.apache.sling</groupId> @@ -112,7 +112,7 @@ $(resource).closest("cq:Page[jcr:content/cq:template=my/template]") <version>3.0.0</version> </dependency> </code></pre> -<h2>Documentation</h2> +<h2><a href="#documentation" name="documentation">Documentation</a></h2> <ul> <li><a href="http://cognifide.github.io/Sling-Query/circuit2014/">CIRCUIT 2014 presentation</a></li> <li><a href="https://github.com/Cognifide/Sling-Query/wiki/Basic-ideas">Basic ideas</a></li> @@ -126,7 +126,7 @@ $(resource).closest("cq:Page[jcr:content/cq:template=my/template]") </li> <li><a href="https://github.com/Cognifide/Sling-Query/wiki/Examples">Examples</a></li> </ul> -<h2>External resources</h2> +<h2><a href="#external-resources" name="external-resources">External resources</a></h2> <ul> <li>See the <a href="http://sling.apache.org/">Apache Sling website</a> for the Sling reference documentation. Apache Sling, Apache and Sling are trademarks of the <a href="http://apache.org">Apache Software Foundation</a>.</li> <li>Method names, selector syntax and some parts of documentation are inspired by the <a href="http://jquery.com/">jQuery</a> library.</li> http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/sling-settings-org-apache-sling-settings.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/sling-settings-org-apache-sling-settings.html b/documentation/bundles/sling-settings-org-apache-sling-settings.html index ca8cb2f..91b84ad 100644 --- a/documentation/bundles/sling-settings-org-apache-sling-settings.html +++ b/documentation/bundles/sling-settings-org-apache-sling-settings.html @@ -72,7 +72,7 @@ </div> <div class="main"> <div class="breadcrumbs"><a href="/ng/">Home</a> » <a href="/ng/documentation.html">Documentation</a> » <a href="/ng/documentation/bundles.html">Bundles</a> » </div> <h1> Sling Settings and Run Modes (org.apache.sling.settings) - </h1><div class="row"><div class="small-12 columns"><section class="wrap"><h1>Overview</h1> + </h1><div class="row"><div class="small-12 columns"><section class="wrap"><h1><a href="#overview" name="overview">Overview</a></h1> <p>The Sling Settings Bundle exposes the <code>SlingSettingsService</code> which allows access to the following information pertinent to a Sling instance:</p> <table> <thead> @@ -106,11 +106,11 @@ </tbody> </table> <p>The new Sling Settings Bundle replaces the former <code>org.apache.sling.runmode</code> bundle and the <code>SlingSettingsService</code> previously provided by the Sling Engine bundle, as it also implements the run modes logic.</p> -<h2>Selecting the active run modes</h2> +<h2><a href="#selecting-the-active-run-modes" name="selecting-the-active-run-modes">Selecting the active run modes</a></h2> <p>The run modes are selected based on the <code>sling.run.modes</code> property (the "selection property"), specified in the Sling settings file or as a command-line parameter (which takes precedence), out of the valid run modes defined by the properties described below. The value is a String which contains a list of comma-separated run modes. If a run mode is given here which is not contained in any group of valid run modes (given in <code>sling.run.mode.install.options</code> or <code>sling.run.mode.options</code>) it is always active, on the other hand run modes which are contained in any of the predefined groups may be modified/removed (see below for the details).</p> <p>Using <code>-Dsling.run.modes=foo,bar</code> on the JVM command-line, for example, activates the <em>foo</em> and <em>bar</em> run modes if that combination is valid.</p> <p>The absolute truth about run modes definition and selection is found in the <a href="https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/settings/src/test/java/org/apache/sling/settings/impl/RunModeImplTest.java">RunModeImplTest</a> which should be self-explaining.</p> -<h2>Defining valid run modes</h2> +<h2><a href="#defining-valid-run-modes" name="defining-valid-run-modes">Defining valid run modes</a></h2> <p>Since <a href="https://issues.apache.org/jira/browse/SLING-2662">SLING-2662</a> the valid run modes are defined by the <code>sling.run.mode.options</code> and <code>sling.run.mode.install.options</code> configuration properties, usually defined in the <code>sling.properties</code> file or in the provisioning model of a Sling Launchpad instance.</p> <p>The <code>sling.run.mode.install.options</code> property is only used on the first startup on the Sling instance and the run modes that it defines cannot be changed later.</p> <p>The <code>sling.run.mode.options</code> property on the other hand is used at each startup, so the run modes that it defines can be changed between executions of a given Sling instance.</p> @@ -169,10 +169,9 @@ </tbody> </table> <p>Remember to look at the <code>RunModeImplTest</code> mentioned above for details, and feel free to enhance it with useful examples.</p> -<h3>Getting the Run Modes of the Sling instance</h3> +<h3><a href="#getting-the-run-modes-of-the-sling-instance" name="getting-the-run-modes-of-the-sling-instance">Getting the Run Modes of the Sling instance</a></h3> <p>The <code>SlingSettings</code> service provides the Run Modes of the running Sling instance as in this example:</p> -<pre><code>:::java -SlingSettings settings = ...get from BundleContext... +<pre><code>:<!-- TODO syntax marker (::java) disabled -->SlingSettings settings = ...get from BundleContext... Set<String> currentRunModes = settings.getRunModes(); Set<String> expectedRunModes = new HashSet<String>(){{ add("foo");add("wii"); }}; http://git-wip-us.apache.org/repos/asf/sling-site/blob/f542b22e/documentation/bundles/subsystem-installer-factory.html ---------------------------------------------------------------------- diff --git a/documentation/bundles/subsystem-installer-factory.html b/documentation/bundles/subsystem-installer-factory.html index cc79f13..64a3dc4 100644 --- a/documentation/bundles/subsystem-installer-factory.html +++ b/documentation/bundles/subsystem-installer-factory.html @@ -73,9 +73,9 @@ <div class="breadcrumbs"><a href="/ng/">Home</a> » <a href="/ng/documentation.html">Documentation</a> » <a href="/ng/documentation/bundles.html">Bundles</a> » </div> <h1> Subsystems Installer Factory </h1><div class="row"><div class="small-12 columns"><section class="wrap"><p>The subsystems installer factory provides support for subsystems 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>Subsystems</h2> +<h2><a href="#subsystems" name="subsystems">Subsystems</a></h2> <p>The subsystem file must end with ".esa" and the manifest must at least contain the subsystem symbolic name "Subsystem-SymbolicName" header.</p> -<h1>Project Info</h1> +<h1><a href="#project-info" name="project-info">Project Info</a></h1> <ul> <li>Subsystems installer factory (<a href="http://svn.apache.org/repos/asf/sling/trunk/installer/factories/subsystems">org.apache.sling.installer.factory.subsystems</a>)</li> </ul></section></div></div>
