incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Sling > GSoC 2010 mini-CMS project
Date Thu, 05 Aug 2010 15:36:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=SLING&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/SLING/GSoC+2010+mini-CMS+project">GSoC
2010 mini-CMS project</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~fpaparoni">Federico
Paparoni</a>
    </h4>
        <br/>
                         <h4>Changes (10)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-unchanged" >h1. Overview (from SLING-1438) <br>
<br></td></tr>
            <tr><td class="diff-changed-lines" >This is a Google Summer of Code
2010, Federico Paparoni has been accepted as a student to work on it, mentored by Bertrand
Delacretaz <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">(hopefully
with the help of the Sling community!)</span> <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-unchanged" >The goal is to create a mini-CMS with
Sling, that demonstrates Sling best practices. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The
emphasis is on the quality and readability of the demo code, and we expect to have to go through
several iterations to refine it and the corresponding JCR content model so that they demonstrate
Sling best practices. We will not necessarily create a full-fledged CMS, the goal is for the
result to be educational and help Sling newcomers understand how to create web applications
with it.  <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">See
[http://tinyurl.com/asfgsoc] for the full list of GSoC 2010 projects at the ASF, and [http://community.apache.org/gsoc]
for general GSoC information. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Suggested
technologies: jQuery for the front-end, ESP and/or JSP for server-side scripting, and Java
code in OSGi bundles for back-end functionality.  <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">We
should find a better name than &quot;mini-CMS&quot; for this project. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1.
{color:#003366}{*}Introduction{*}{color} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">See
http://tinyurl.com/asfgsoc for the full list of GSoC 2010 projects at the ASF, and http://community.apache.org/gsoc
for general GSoC information. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Apache
Sling is an opensource project with a lot of technologies and features. The goal of this project
is to create a mini-CMS, that developers can use to understand how to develop a simple application
with Sling.&amp;nbsp; <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">h1.
Requirements <br>* Create an educational application that people can study to find out
how to use Sling. <br>* At the same time, the mini-CMS should be usable, not just a
toy. <br>* Ideally, the mini-CMS should allow for editing the Sling website. Detailed
requirements TBD, but storing the content and generated website in subversion is probably
required. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">So
it is necessary to know a little about two main topics: OSGi and JCR. The following links
are useful resources to read something about these technologies. <br> <br>*{_}OSGi{_}*
<br>* [http://en.wikipedia.org/wiki/OSGi|http://en.wikipedia.org/wiki/OSGi] <br>*
[http://felix.apache.org/] <br>* [http://www.osgi.org/Links/BasicEducation|http://www.osgi.org/Links/BasicEducation]
<br> <br>*{_}JCR{_}* <br>* [http://jackrabbit.apache.org/|http://jackrabbit.apache.org/]
<br>* [http://www.ibm.com/developerworks/java/library/j-jcr/|http://www.ibm.com/developerworks/java/library/j-jcr/]
<br>* [http://wiki.apache.org/jackrabbit/DavidsModel|http://wiki.apache.org/jackrabbit/DavidsModel]
<br> <br>The repository for this project can be found at&amp;nbsp;[http://code.google.com/p/davidgsoc2010/|http://code.google.com/p/davidgsoc2010/].
<br> <br>h1. {color:#003366}{*}First steps into Sling{*}{color} <br> <br>Firstly
you must setup the environment for Sling, so you can follow the guide at&amp;nbsp;[http://sling.apache.org/site/getting-and-building-sling.html|http://sling.apache.org/site/getting-and-building-sling.html].
<br> <br>Now that you created your environment, you can setup some other tools
that can be useful during the development: <br>* [cURL|http://curl.haxx.se/] : Command
line tool to send HTTP request <br>* [JCR Explorer|http://svn.apache.org/repos/asf/sling/trunk/contrib/explorers/jquery/]
: Extension that create a useful explorer for the JCR repository you are working in <br>*
[BitKinex|http://www.bitkinex.com/] :&amp;nbsp;FTP/SFTP/HTTP/WebDAV Client that can be
used to manage the files you uploaded in Sling <br> <br>It&#39;s time to make
our &quot;Hello world&quot; in Apache Sling.&amp;nbsp; <br>Open a console
and simply launch the next command: <br> <br>curl \-F&quot;sling:resourceType=foo/bar&quot;
\-F&quot;title=Hello world&quot; http://admin:admin@localhost:8080/content/myfirstnode
<br> <br>{code} <br>curl -F&quot;sling:resourceType=foo/bar&quot;
-F&quot;title=Hello world&quot; http://admin:admin@localhost:8080/content/myfirstnode
<br>{code} <br> <br>This is a simple HTTP request, where you pass some parameters
and values. Using it you have created a first resource under Sling.&amp;nbsp; <br>The
resource is a JCR node, as every resource in Sling, put under folder /content. This node has
two parameters, title and sling:resourceType.&amp;nbsp; <br> <br>Node creation
is a simple task, but you must understand how you can render the information stored in the
nodes using Sling. <br>The first document you can read is the next one:&amp;nbsp;[http://dev.day.com/content/ddc/blog/2008/07/cheatsheet/_jcr_content/par/download/file.res/cheatsheet.pdf|http://dev.day.com/content/ddc/blog/2008/07/cheatsheet/_jcr_content/par/download/file.res/cheatsheet.pdf]
<br>It simply describes how content resolution works in Sling.&amp;nbsp; <br>
<br>Another important information to better understand Sling, is that a resource is
rendered by a script. <br>Script files are stored under the folders /apps or /libs and
there is a wide choice of possible scripting engine:&amp;nbsp; <br>* ESP <br>*
JSP <br>* Java Servlet <br>* Scala <br>* Python <br>* Groovy <br>*
Ruby <br> <br>To select a script, Sling uses the node&#39;s sling:resourceType
property. So if we say that&amp;nbsp;sling:resourceType is foo/bar, Sling will search
under the /apps/foo/bar/ folder. <br>The following links describes how the scripts work
and what type of variables we have during the script execution: <br>* [https://cwiki.apache.org/SLING/scripting-variables.html|https://cwiki.apache.org/SLING/scripting-variables.html]
<br>* [https://cwiki.apache.org/SLING/url-to-script-resolution.html|https://cwiki.apache.org/SLING/url-to-script-resolution.html]
<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h1><a name="GSoC2010mini-CMSproject-Overview%28fromSLING1438%29"></a>Overview
(from SLING-1438)</h1>

<p>This is a Google Summer of Code 2010, Federico Paparoni has been accepted as a student
to work on it, mentored by Bertrand Delacretaz</p>

<p>The goal is to create a mini-CMS with Sling, that demonstrates Sling best practices.</p>

<p>See <a href="http://tinyurl.com/asfgsoc" class="external-link" rel="nofollow">http://tinyurl.com/asfgsoc</a>
for the full list of GSoC 2010 projects at the ASF, and <a href="http://community.apache.org/gsoc"
class="external-link" rel="nofollow">http://community.apache.org/gsoc</a> for general
GSoC information.</p>


<h1><a name="GSoC2010mini-CMSproject-"></a><font color="#003366"><b>Introduction</b></font></h1>

<p>Apache Sling is an opensource project with a lot of technologies and features. The
goal of this project is to create a mini-CMS, that developers can use to understand how to
develop a simple application with Sling.&nbsp;</p>

<p>So it is necessary to know a little about two main topics: OSGi and JCR. The following
links are useful resources to read something about these technologies.</p>

<p><b><em>OSGi</em></b></p>
<ul>
	<li><a href="http://en.wikipedia.org/wiki/OSGi" class="external-link" rel="nofollow">http://en.wikipedia.org/wiki/OSGi</a></li>
	<li><a href="http://felix.apache.org/" class="external-link" rel="nofollow">http://felix.apache.org/</a></li>
	<li><a href="http://www.osgi.org/Links/BasicEducation" class="external-link" rel="nofollow">http://www.osgi.org/Links/BasicEducation</a></li>
</ul>


<p><b><em>JCR</em></b></p>
<ul>
	<li><a href="http://jackrabbit.apache.org/" class="external-link" rel="nofollow">http://jackrabbit.apache.org/</a></li>
	<li><a href="http://www.ibm.com/developerworks/java/library/j-jcr/" class="external-link"
rel="nofollow">http://www.ibm.com/developerworks/java/library/j-jcr/</a></li>
	<li><a href="http://wiki.apache.org/jackrabbit/DavidsModel" class="external-link"
rel="nofollow">http://wiki.apache.org/jackrabbit/DavidsModel</a></li>
</ul>


<p>The repository for this project can be found at&nbsp;<a href="http://code.google.com/p/davidgsoc2010/"
class="external-link" rel="nofollow">http://code.google.com/p/davidgsoc2010/</a>.</p>

<h1><a name="GSoC2010mini-CMSproject-"></a><font color="#003366"><b>First
steps into Sling</b></font></h1>

<p>Firstly you must setup the environment for Sling, so you can follow the guide at&nbsp;<a
href="http://sling.apache.org/site/getting-and-building-sling.html" class="external-link"
rel="nofollow">http://sling.apache.org/site/getting-and-building-sling.html</a>.</p>

<p>Now that you created your environment, you can setup some other tools that can be
useful during the development:</p>
<ul>
	<li><a href="http://curl.haxx.se/" class="external-link" rel="nofollow">cURL</a>
: Command line tool to send HTTP request</li>
	<li><a href="http://svn.apache.org/repos/asf/sling/trunk/contrib/explorers/jquery/"
class="external-link" rel="nofollow">JCR Explorer</a> : Extension that create a useful
explorer for the JCR repository you are working in</li>
	<li><a href="http://www.bitkinex.com/" class="external-link" rel="nofollow">BitKinex</a>
:&nbsp;FTP/SFTP/HTTP/WebDAV Client that can be used to manage the files you uploaded in
Sling</li>
</ul>


<p>It's time to make our "Hello world" in Apache Sling.&nbsp;<br/>
Open a console and simply launch the next command:</p>

<p>curl &#45;F"sling:resourceType=foo/bar" &#45;F"title=Hello world" <a href="http://admin:admin@localhost:8080/content/myfirstnode"
class="external-link" rel="nofollow">http://admin:admin@localhost:8080/content/myfirstnode</a></p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">curl -F<span class="code-quote">"sling:resourceType=foo/bar"</span>
-F<span class="code-quote">"title=Hello world"</span> http:<span class="code-comment">//admin:admin@localhost:8080/content/myfirstnode</span>
</pre>
</div></div>

<p>This is a simple HTTP request, where you pass some parameters and values. Using it
you have created a first resource under Sling.&nbsp;<br/>
The resource is a JCR node, as every resource in Sling, put under folder /content. This node
has two parameters, title and sling:resourceType.&nbsp;</p>

<p>Node creation is a simple task, but you must understand how you can render the information
stored in the nodes using Sling.<br/>
The first document you can read is the next one:&nbsp;<a href="http://dev.day.com/content/ddc/blog/2008/07/cheatsheet/_jcr_content/par/download/file.res/cheatsheet.pdf"
class="external-link" rel="nofollow">http://dev.day.com/content/ddc/blog/2008/07/cheatsheet/_jcr_content/par/download/file.res/cheatsheet.pdf</a><br/>
It simply describes how content resolution works in Sling.&nbsp;</p>

<p>Another important information to better understand Sling, is that a resource is rendered
by a script.<br/>
Script files are stored under the folders /apps or /libs and there is a wide choice of possible
scripting engine:&nbsp;</p>
<ul>
	<li>ESP</li>
	<li>JSP</li>
	<li>Java Servlet</li>
	<li>Scala</li>
	<li>Python</li>
	<li>Groovy</li>
	<li>Ruby</li>
</ul>


<p>To select a script, Sling uses the node's sling:resourceType property. So if we say
that&nbsp;sling:resourceType is foo/bar, Sling will search under the /apps/foo/bar/ folder.<br/>
The following links describes how the scripts work and what type of variables we have during
the script execution:</p>
<ul>
	<li><a href="https://cwiki.apache.org/SLING/scripting-variables.html" class="external-link"
rel="nofollow">https://cwiki.apache.org/SLING/scripting-variables.html</a></li>
	<li><a href="https://cwiki.apache.org/SLING/url-to-script-resolution.html" class="external-link"
rel="nofollow">https://cwiki.apache.org/SLING/url-to-script-resolution.html</a></li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/SLING/GSoC+2010+mini-CMS+project">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=20316370&revisedVersion=2&originalVersion=1">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/SLING/GSoC+2010+mini-CMS+project?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message