Bhathiya,

Think of Sling as an HTTP interface to the underlying JCR store (jackrabbit).
It is possible to manipulate nodes inside the JCR outside of the HTTP
request cycle (outside of servlets).
At that point you're just coding OSGi classes.

Sling runs in an OSGi container so you'd most likely make use of the
lifecycle hooks provided by the OSGi spec.

Here's an introduction to OSGi.
http://www.osgi.org/Technology/HowOSGi

And this presentation has some good information on manipulating nodes.
http://www.slideshare.net/jukka/introduction-to-jcr-and-apache-jackrabbi-presentation

I hope that helps.
Erik



On Sun, Jun 10, 2012 at 5:28 PM, Bhathiya Jayasekara
<[email protected]> wrote:
> Hi all,
>
> I'm new to Sling and I have a question about accessing resources. I have
> followed *Discover Sling in 15 minutes - the Sling Launchpad [1] *tutorial.
> I would like to know if there is a direct method (may be by Sling API) to
> do what is done by curl in the tutorial (e.g. creating
> nodes), programmatically without going for servlets. I mean just using a
> simple java class?
>
> I found a similar thing in *Getting Resources and Properties in Sling [2]*.
> But I don't understand how to get a ResourceResolverFactory object in
> 'Within an OSGI Service/Compoment' part. Help is greatly appreciated.
>
> Thank you.
>
> Regards,
>
>  -Bhathiya
>
> [1] http://sling.apache.org/site/discover-sling-in-15-minutes.html
> [2]
> http://sling.apache.org/site/getting-resources-and-properties-in-sling.html

Reply via email to