Author: buildbot Date: Tue Sep 1 07:27:44 2015 New Revision: 963818 Log: Staging update by buildbot for sling
Modified: websites/staging/sling/trunk/content/ (props changed) websites/staging/sling/trunk/content/documentation/getting-started/discover-sling-in-15-minutes.html Propchange: websites/staging/sling/trunk/content/ ------------------------------------------------------------------------------ --- cms:source-revision (original) +++ cms:source-revision Tue Sep 1 07:27:44 2015 @@ -1 +1 @@ -1700245 +1700406 Modified: websites/staging/sling/trunk/content/documentation/getting-started/discover-sling-in-15-minutes.html ============================================================================== --- websites/staging/sling/trunk/content/documentation/getting-started/discover-sling-in-15-minutes.html (original) +++ websites/staging/sling/trunk/content/documentation/getting-started/discover-sling-in-15-minutes.html Tue Sep 1 07:27:44 2015 @@ -39,7 +39,18 @@ </div> <div class="menu"> - <p><strong><a href="/documentation.html">Documentation</a></strong> <br /> + <style type="text/css"> +/* The following code is added by mdx_elementid.py + It was originally lifted from http://subversion.apache.org/style/site.css */ +/* + * Hide class="elementid-permalink", except when an enclosing heading + * has the :hover property. + */ +.headerlink, .elementid-permalink { + visibility: hidden; +} +h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style> +<p><strong><a href="/documentation.html">Documentation</a></strong> <br /> <a href="/documentation/getting-started.html">Getting Started</a> <br /> <a href="/documentation/the-sling-engine.html">The Sling Engine</a> <br /> <a href="/documentation/development.html">Development</a> <br /> @@ -90,7 +101,18 @@ <h1>Discover Sling in 15 minutes</h1> - <p>The Sling Launchpad is a ready-to-run Sling configuration, providing an embedded JCR content repository and web server, a selection of Sling components, documentation and examples. The Launchpad makes it easy to get started with Sling and to develop script-based applications.</p> + <style type="text/css"> +/* The following code is added by mdx_elementid.py + It was originally lifted from http://subversion.apache.org/style/site.css */ +/* + * Hide class="elementid-permalink", except when an enclosing heading + * has the :hover property. + */ +.headerlink, .elementid-permalink { + visibility: hidden; +} +h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style> +<p>The Sling Launchpad is a ready-to-run Sling configuration, providing an embedded JCR content repository and web server, a selection of Sling components, documentation and examples. The Launchpad makes it easy to get started with Sling and to develop script-based applications.</p> <p>This page will help you get started with the Launchpad. Fifteen minutes should be enough to get an overview of what Sling does.</p> <p>While simple to run and understand, the Launchpad is a full-featured instance of Sling, an example configuration that we have created with the most common modules and configurations. The full functionality of Sling is available by loading additional Sling (or custom) OSGi bundles as needed, using the Launchpad's web-based OSGi management console.</p> <div class="toc"> @@ -108,16 +130,16 @@ </li> </ul> </div> -<h2 id="see-also">See Also</h2> +<h2 id="see-also">See Also<a class="headerlink" href="#see-also" title="Permanent link">¶</a></h2> <p>More Sling samples can be found under <a href="http://svn.apache.org/repos/asf/sling/trunk/samples/">http://svn.apache.org/repos/asf/sling/trunk/samples/</a></p> <p>Once you grok the basic examples of this page, we recommend studying the <em>slingbucks</em> and <em>espblog</em> samples. Both have README files with more info.</p> -<h2 id="prerequisites">Prerequisites</h2> -<p>We'll start with the self-runnable jar from the Sling distribution, you only need a Java 5 JDK. Download the latest release from the Sling <a href="/downloads.cgi">Downloads</a> page or by clicking this link: <a href="http://www.apache.org/dyn/closer.cgi/sling/org.apache.sling.launchpad-7-standalone.jar">org.apache.sling.launchpad-7-standalone.jar</a>. Alternatively you can deploy the <a href="http://www.apache.org/dyn/closer.cgi/sling/org.apache.sling.launchpad-7.war">Sling Web application</a> into any decent Servlet Container such as Jetty or Tomcat or you can <a href="/documentation/development/getting-and-building-sling.html">build the current source yourself</a>.</p> +<h2 id="prerequisites">Prerequisites<a class="headerlink" href="#prerequisites" title="Permanent link">¶</a></h2> +<p>We'll start with the self-runnable jar from the Sling distribution, you only need a Java 5 JDK. Download the latest release from the Sling <a href="/downloads.cgi">Downloads</a> page or by clicking this link: <a href="http://www.apache.org/dyn/closer.lua/sling/org.apache.sling.launchpad-7-standalone.jar">org.apache.sling.launchpad-7-standalone.jar</a>. Alternatively you can deploy the <a href="http://www.apache.org/dyn/closer.lua/sling/org.apache.sling.launchpad-7.war">Sling Web application</a> into any decent Servlet Container such as Jetty or Tomcat or you can <a href="/documentation/development/getting-and-building-sling.html">build the current source yourself</a>.</p> <p>To show the simplicity of the REST-style approach taken by Sling the examples below will be using <a href="http://curl.haxx.se/">cURL</a>. Any HTTP client would do, but cURL is the easiest to document in a reproducible way.</p> <p>A WebDAV client makes editing server-side scripts much more convenient, but to make our examples easy to reproduce, we're using cURL below to create and update files in the JCR repository, via the Sling WebDAV server.</p> -<h2 id="start-the-launchpad">Start the Launchpad</h2> +<h2 id="start-the-launchpad">Start the Launchpad<a class="headerlink" href="#start-the-launchpad" title="Permanent link">¶</a></h2> <p>After downloading the Sling Launchpad self-runnable jar just start it as follows:</p> <div class="codehilite"><pre>$ <span class="n">java</span> <span class="o">-</span><span class="n">jar</span> <span class="n">org</span><span class="p">.</span><span class="n">apache</span><span class="p">.</span><span class="n">sling</span><span class="p">.</span><span class="n">launchpad</span><span class="o">-</span>7<span class="o">-</span><span class="n">standalone</span><span class="p">.</span><span class="n">jar</span> </pre></div> @@ -127,7 +149,7 @@ <p>Once started, look at <a href="http://localhost:8080/system/console/bundles">http://localhost:8080/system/console/bundles</a> with your browser. Use <em>admin</em> with password <em>admin</em> if Sling asks you for a login. Sling then displays the <em>Felix Web Management Console</em> page.</p> <p>On the bundles page, all bundles should be marked <em>Active</em>. They're all <a href="http://www.osgi.org/">OSGi</a> bundles powered by <a href="http://felix.apache.org">Apache Felix</a>, but that doesn't really matter to us right now.</p> <p><em>Log files: If things go wrong, have a look at the <code>sling/logs/error.log</code> log file - that's where Sling writes any error messages.</em></p> -<h2 id="create-some-content">Create some content</h2> +<h2 id="create-some-content">Create some content<a class="headerlink" href="#create-some-content" title="Permanent link">¶</a></h2> <p>Until we have ready-to-test forms, you can create content with cURL, or you can create an HTML form that posts to the specified URL.</p> <p>To create a content node (nodes are a <a href="http://jackrabbit.apache.org/">JCR</a> concept, a unit of storage) with cURL, use:</p> <div class="codehilite"><pre><span class="n">curl</span> <span class="o">-</span><span class="n">u</span> <span class="n">admin</span><span class="p">:</span><span class="n">admin</span> <span class="o">-</span><span class="n">F</span>"<span class="n">sling</span><span class="p">:</span><span class="n">resourceType</span><span class="p">=</span><span class="n">foo</span><span class="o">/</span><span class="n">bar</span>" <span class="o">-</span><span class="n">F</span>"<span class="n">title</span><span class="p">=</span><span class="n">some</span> <span class="n">title</span>" <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">localhost</span><span class="p">:</span>8080<span class="o">/</span><span class="n">content</span><span class="o">/</span><span class="n">mynode</span> @@ -146,7 +168,7 @@ <p>The additional property <code>jcr:primaryType</code> is a special JCR property added by the content repository, indicating the JCR primary node type.</p> <p><em>Monitoring requests: Sling provides a simple tool (an OSGi console plugin) to monitor HTTP requests, which helps understand how things work internally. See the <a href="/documentation/development/monitoring-requests.html">Monitoring Requests</a> page for details.</em></p> -<h2 id="render-your-content-using-server-side-javascript-esp">Render your content using server-side javascript (ESP)</h2> +<h2 id="render-your-content-using-server-side-javascript-esp">Render your content using server-side javascript (ESP)<a class="headerlink" href="#render-your-content-using-server-side-javascript-esp" title="Permanent link">¶</a></h2> <p>Sling uses scripts or servlets to render and process content.</p> <p>Several scripting languages are available as additional Sling modules (packaged as OSGi <em>bundles</em> that can be installed via the Sling management console), but the launchpad currently includes the ESP (server-side ECMAscript), JSP (Java Server Pages), and Groovy language modules by default.</p> <p>To select a script, Sling uses the node's <em>sling:resourceType</em> property, if it is set.</p> @@ -179,13 +201,13 @@ <p>The HTML rendering of your node, at <a href="http://localhost:8080/content/mynode.html">http://localhost:8080/content/mynode.html</a>, is now created by this ESP script. You should see the node's title alone as an <h1> element in that page.</p> <p>A script named <em>POST.esp</em> instead of <em>html.esp</em> would be called for a POST request, <em>DELETE.esp</em> for DELETE, <em>xml.esp</em> for a GET request with a <em>.xml</em> extension, etc. See <a href="/documentation/the-sling-engine/url-to-script-resolution.html">URL to Script Resolution</a> on the Sling wiki for more info.</p> <p>Servlets can also be easily "wired" to handle specific resource types, extensions, etc., in the simplest case by using SCR annotations in the servlet source code. Servlets and scripts are interchangeable when it comes to processing Sling requests.</p> -<h2 id="what-next">What next?</h2> +<h2 id="what-next">What next?<a class="headerlink" href="#what-next" title="Permanent link">¶</a></h2> <p>These simple examples show how Sling uses scripts to work with JCR data, based on <em>sling:resourceType</em> or node types.</p> <p>There's much more to Sling of course - you'll find some additional simple examples below, as well as above in the <em>see also</em> section.</p> -<h2 id="additional-examples">Additional examples</h2> -<h3 id="let-sling-generate-the-path-of-a-newly-created-node">Let Sling generate the path of a newly created node.</h3> +<h2 id="additional-examples">Additional examples<a class="headerlink" href="#additional-examples" title="Permanent link">¶</a></h2> +<h3 id="let-sling-generate-the-path-of-a-newly-created-node">Let Sling generate the path of a newly created node.<a class="headerlink" href="#let-sling-generate-the-path-of-a-newly-created-node" title="Permanent link">¶</a></h3> <p>To create a node with a unique path at a given location, end the URL of the POST request with <em>/</em>.</p> <p>In this case, the Sling response redirects to the URL of the created node.</p> <p>Start by creating a new <em>/blog</em> folder:</p> @@ -206,7 +228,7 @@ well as above in the <em>see also</em> s <p>The actual node name might not be <em>adventures_with_slin</em> - depending on existing content in your repository, Sling will find a unique name for this new node, based on several well-know property values like title, description, etc. which are used for this if provided.</p> <p>So, in our case, our new node can be displayed in HTML via the <a href="http://localhost:8080/blog/adventures*with*slin.html">http://localhost:8080/blog/adventures_with_slin.html</a> URL.</p> <p>Note that we didn't set a <em>sling:resourceType</em> property on our node, so if you want to render that node with a script, you'll have to store the script under <em>/apps/nt/unstructured/html.esp</em>.</p> -<h3 id="add-a-page-header-with-slinginclude">Add a page header with sling.include</h3> +<h3 id="add-a-page-header-with-slinginclude">Add a page header with sling.include<a class="headerlink" href="#add-a-page-header-with-slinginclude" title="Permanent link">¶</a></h3> <p>The <em>sling.include</em> function can be called from scripts to include the rendered result of another node.</p> <p>In this example, we create a node at <em>/content/header</em>, rendered with a logo using an <em>html.esp</em> script, then use that header at the top of the <em>html.esp</em> script that we created previously for the <em>foo/bar</em> resource type.</p> <p>Start by checking that <a href="http://localhost:8080/content/mynode.html">http://localhost:8080/content/mynode.html</a> is rendered using the <em>html.esp</em> script created above.</p> @@ -257,7 +279,7 @@ well as above in the <em>see also</em> s <p>The <a href="http://localhost:8080/content/mynode.html">http://localhost:8080/content/mynode.html</a>, once refreshed, now shows the blue headline and logo, and this layout also applies to any node created with <em>sling:resourceType=foo/bar</em>.</p> <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;"> - Rev. 1688556 by bdelacretaz on Wed, 1 Jul 2015 06:18:43 +0000 + Rev. 1700406 by bdelacretaz on Tue, 1 Sep 2015 07:26:57 +0000 </div> <div class="trademarkFooter"> Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project