incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [CONF] Apache Sling > Using Scala with Sling
Date Tue, 02 Feb 2010 13:55:00 GMT
    <base href="">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=SLING&amp;forWysiwyg=true"
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="">Using
Scala with Sling</a></h2>
    <h4>Page  <b>added</b> by             <a href="">Michael
    <div class="notificationGreySide">
         <h1><a name="UsingScalawithSling-UsingScalawithSling"></a>Using
Scala with Sling</h1>

<p>Sling supports the <a href="" rel="nofollow">Scala</a>
programming language version 2.7.7 through optional modules located in <tt>/contrib/scripting/scala</tt>.</p>

<h2><a name="UsingScalawithSling-Installation"></a>Installation</h2>

<p>The following bundles are required for Scala support: scala-library, scala-compiler,
Scala Script Engine, Apache Sling Scala Scripting Configuration.</p>

	<li>Start Sling</li>

	<li>Download the <a href=""
rel="nofollow">scala-library bundle</a> and the <a href=""
rel="nofollow">scala-compiler bundle</a> and install them using for example the <a
href="http://localhost:8080/system/console/bundles" rel="nofollow">Apache Felix Web Management

	<li>Install the Scala Script Engine bundle. Goto <tt>/contrib/scripting/scala/script</tt>
and type <tt>mvn</tt>.</li>

	<li>Install the Apache Sling Scala Scripting Configuration bundle. Goto <tt>/contrib/scripting/scala/config</tt>
and type <tt>mvn</tt>.</li>

<h2><a name="UsingScalawithSling-ExamplesApplications"></a>Examples Applications</h2>

<p>There are two example applications available in <tt>/contrib/scripting/scala/samples</tt>:
A simple Hello World programm and a more advanced Forum application. The examples require
the Apache Sling Sample Path Based Resource Type Provider bundle. So lets install this bundle

	<li>Goto <tt>/samples/path-based-rtp</tt> and type <tt>mvn</tt>.</li>

<p>Now the examples themselves:</p>

	<li>Install the Scala for Sling Demo Application - Hello World bundle. Goto <tt>/contrib/scripting/scala/samples/hello-world</tt>
and type <tt>mvn</tt>. The hello world
application is then available at <a href="http://localhost:8080/content/helloworld.html"

	<li>Install the Scala for Sling Demo Application - Forum bundle. Goto <tt>/contrib/scripting/scala/samples/forum</tt>
and type <tt>mvn</tt>. The form application
is the available at <a href="http://localhost:8080/content/forum.html?sling:authRequestLogin=true"
When prompted for credentials use admin/admin.</li>

<h2><a name="UsingScalawithSling-Configuration"></a>Configuration</h2>

<p>The Scala scripting bundle is configurable through the <a href="http://localhost:8080/system/console/configMgr"
rel="nofollow">Apache Felix Web Management Console</a> (PID:</p>

	<li>Scala compiler options. Scala compiler settings as documented by <a href=""
rel="nofollow"><tt>scalac &#45;help</tt></a>. Default is blank.</li>

	<li>Compiler output directory. Output directory for files generated by the Scala compiler.
Default is <tt>/var/classes</tt>.</li>

<h2><a name="UsingScalawithSling-FurtherInformation"></a>Further Information</h2>

<p>See these <a href=""
rel="nofollow">session slides</a> for some further information.</p>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href=""
class="grey">Change Notification Preferences</a>
       <a href="">View
       <a href=";showCommentArea=true#addcomment">Add

View raw message