Jackrabbit, Sling, JCR, Servlets learning path

8 messages Options
Embed this post
Permalink
kbar

Jackrabbit, Sling, JCR, Servlets learning path

Reply Threaded More More options
Print post
Permalink
I am new to the world of Java based web development. I am finding myself constantly hitting road blocks while trying to learn Jackrabbit and Sling because the documentation assumes that you already know alot of previous things. So I was wondering if someone could give me a good learning path that I could follow to get myself up to speed.

As an example all I am currently trying to do is just list the contents of a folder using Sling and I am unable to figure out how to do it. I am messing with Jackrabbit, Sling, esp, groovy, servlets and all sorts of technology and am just digging myself a bigger hole with more technology flying at me. I have been crawling the sling and jackrabbit sites but can't find anything for a newbie like myself.

Can someone recommend a list of things to learn and in what order. Also perhaps any good books from amazon or websites that I could look at?

Cheers,
kbar
Ian Boston

Re: Jackrabbit, Sling, JCR, Servlets learning path

Reply Threaded More More options
Print post
Permalink
Probably the best thing to do, if you cant find the answer in  
documentation is to subscribe to [hidden email] and ask the  
question there.

But here are some quick pointers:

There are several answers to your question.

1. query the REST URL for the purpose from a client (e AJAX)

eg if your folder is a /testfolder then GET http://host/testfolder.2.json 
   will list the contents and properties of all child nodes. The 2  
says go down 2 levels.


2. Sling is based on resources, requests are bound to resources so  
that a request.getResource() will give you a Resource. *If* the  
Resource happens to be a JCR Node then the resource can be adapted to  
a node with Node myNode = resource.adaptTo(Node.class); From there on  
you can use the javax.jcr.* API (JSR-170, JSR-283) to get information  
about the nodes. I would recommend you skim read at first  the JSR-170  
spec and possibly the JSR-283 spec to understand about how javax.jcr.*  
works.

3. In ESP and the other scripting languages there is a variable  
already there "currentNode" that is the current node the script is  
bound to.


currentNode.getNodes() will give you a NodeIterator to all child nodes  
of a parent node

HTH
Ian


On 27 Sep 2009, at 08:17, kbar wrote:

>
> I am new to the world of Java based web development. I am finding  
> myself
> constantly hitting road blocks while trying to learn Jackrabbit and  
> Sling
> because the documentation assumes that you already know alot of  
> previous
> things. So I was wondering if someone could give me a good learning  
> path
> that I could follow to get myself up to speed.
>
> As an example all I am currently trying to do is just list the  
> contents of a
> folder using Sling and I am unable to figure out how to do it. I am  
> messing
> with Jackrabbit, Sling, esp, groovy, servlets and all sorts of  
> technology
> and am just digging myself a bigger hole with more technology flying  
> at me.
> I have been crawling the sling and jackrabbit sites but can't find  
> anything
> for a newbie like myself.
>
> Can someone recommend a list of things to learn and in what order.  
> Also
> perhaps any good books from amazon or websites that I could look at?
>
> Cheers,
> kbar
> --
> View this message in context: http://www.nabble.com/Jackrabbit%2C-Sling%2C-JCR%2C-Servlets-learning-path-tp25631394p25631394.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>

kbar

Re: Jackrabbit, Sling, JCR, Servlets learning path

Reply Threaded More More options
Print post
Permalink
Fantastic! After 5 hours of scratching my head writting esp scripts and trying to get a sling:resourceType onto a folder... all I had to do was put the number 2 in between my folder name and the .json. I knew there must be a simpler way than what I was doing!

I will read through the specs again and again until I have it all indexed into my brain and will also start experimenting with NodeIterator you suggested.

A big thanks!
kbar


Ian Boston wrote:
Probably the best thing to do, if you cant find the answer in  
documentation is to subscribe to dev@sling.apache.org and ask the  
question there.

But here are some quick pointers:

There are several answers to your question.

1. query the REST URL for the purpose from a client (e AJAX)

eg if your folder is a /testfolder then GET http://host/testfolder.2.json 
   will list the contents and properties of all child nodes. The 2  
says go down 2 levels.


2. Sling is based on resources, requests are bound to resources so  
that a request.getResource() will give you a Resource. *If* the  
Resource happens to be a JCR Node then the resource can be adapted to  
a node with Node myNode = resource.adaptTo(Node.class); From there on  
you can use the javax.jcr.* API (JSR-170, JSR-283) to get information  
about the nodes. I would recommend you skim read at first  the JSR-170  
spec and possibly the JSR-283 spec to understand about how javax.jcr.*  
works.

3. In ESP and the other scripting languages there is a variable  
already there "currentNode" that is the current node the script is  
bound to.


currentNode.getNodes() will give you a NodeIterator to all child nodes  
of a parent node

HTH
Ian


On 27 Sep 2009, at 08:17, kbar wrote:

>
> I am new to the world of Java based web development. I am finding  
> myself
> constantly hitting road blocks while trying to learn Jackrabbit and  
> Sling
> because the documentation assumes that you already know alot of  
> previous
> things. So I was wondering if someone could give me a good learning  
> path
> that I could follow to get myself up to speed.
>
> As an example all I am currently trying to do is just list the  
> contents of a
> folder using Sling and I am unable to figure out how to do it. I am  
> messing
> with Jackrabbit, Sling, esp, groovy, servlets and all sorts of  
> technology
> and am just digging myself a bigger hole with more technology flying  
> at me.
> I have been crawling the sling and jackrabbit sites but can't find  
> anything
> for a newbie like myself.
>
> Can someone recommend a list of things to learn and in what order.  
> Also
> perhaps any good books from amazon or websites that I could look at?
>
> Cheers,
> kbar
> --
> View this message in context: http://www.nabble.com/Jackrabbit%2C-Sling%2C-JCR%2C-Servlets-learning-path-tp25631394p25631394.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>
Guo Du

Re: Jackrabbit, Sling, JCR, Servlets learning path

Reply Threaded More More options
Print post
Permalink
In reply to this post by Ian Boston
On Sun, Sep 27, 2009 at 9:02 AM, Ian Boston <[hidden email]> wrote:
> Probably the best thing to do, if you cant find the answer in documentation
> is to subscribe to [hidden email] and ask the question there.
>
I would assume dev maillist is designed for people interested with
sling development. For using questions, [hidden email] could
be better.

As sling aggregated a few open source projects, the sling project user
doesn't need know all underling things. A more user focused
documentation may help this kind of users. An good example of
documentation for different users based on roles such as developing,
administrating, using:
http://publib.boulder.ibm.com/infocenter/ltscnnct/v2r0/index.jsp?topic=/com.ibm.connections.25.help/welcome.html

--Guo
Bertrand Delacretaz-2

Re: Jackrabbit, Sling, JCR, Servlets learning path

Reply Threaded More More options
Print post
Permalink
Hi,

On Sun, Sep 27, 2009 at 4:45 PM, Guo Du <[hidden email]> wrote:
> ...I would assume dev maillist is designed for people interested with
> sling development. For using questions, [hidden email] could
> be better....

There's no such list, see
http://sling.apache.org/site/project-information.html#ProjectInformation-lists

Users questions are welcome on the dev at sling.apache.org list.
-Bertrand
Guo Du

Re: Jackrabbit, Sling, JCR, Servlets learning path

Reply Threaded More More options
Print post
Permalink
On Sun, Sep 27, 2009 at 9:03 PM, Bertrand Delacretaz
<[hidden email]> wrote:
> There's no such list, see
> http://sling.apache.org/site/project-information.html#ProjectInformation-lists
>
> Users questions are welcome on the dev at sling.apache.org list.
> -Bertrand
>
Thanks for the correction. I was assume it's part of standard project
maillist :)

--Guo
Phukan, Anit

RE: Jackrabbit, Sling, JCR, Servlets learning path

Reply Threaded More More options
Print post
Permalink
Hi All,

Is clustering option available with Jackrabbit 1.6 reference
implementation? Or is it only usable with the commercial version?

Thanks
Anit

-----Original Message-----
From: Guo Du [mailto:[hidden email]]
Sent: Sunday, September 27, 2009 3:58 PM
To: [hidden email]
Subject: Re: Jackrabbit, Sling, JCR, Servlets learning path

On Sun, Sep 27, 2009 at 9:03 PM, Bertrand Delacretaz
<[hidden email]> wrote:
> There's no such list, see
>
http://sling.apache.org/site/project-information.html#ProjectInformation
-lists
>
> Users questions are welcome on the dev at sling.apache.org list.
> -Bertrand
>
Thanks for the correction. I was assume it's part of standard project
maillist :)

--Guo
Alexander Klimetschek

Re: Jackrabbit, Sling, JCR, Servlets learning path

Reply Threaded More More options
Print post
Permalink
On Tue, Nov 3, 2009 at 00:25, Phukan, Anit <[hidden email]> wrote:
> Is clustering option available with Jackrabbit 1.6 reference
> implementation? Or is it only usable with the commercial version?

Jackrabbit supports clustering. See http://wiki.apache.org/jackrabbit/Clustering

Regards,
Alex

--
Alexander Klimetschek
[hidden email]