What is the purpose behind building of Apache Sling, Felix, Jackrabbit projects

17,484

Solution 1

The combination of Apache Jackrabbit, Apache Sling, and Apache Felix allows you to build web application.

Apache Jackrabbit is the reference implementation of the JCR API. The JCR API is to manage content repositories; to manage, for example, web content. A content repository is a mix between file system and a database.

The JCR API is specially made to deal with web content. Why use the JCR API, and why not use a relational database API? URLs are hierarchical, as in a file system. Relational databases don't easily support hierarchical access. Why not use a file system API? Because the JCR supports transactions, versioning, and a lot of other features that file system APIs don't support.

Apache Sling is a web framework based on the JCR API, and taking advantage of the features provided by the JCR API (15 Minute introduction).

Apache Felix is an OSGi container. It allows to seamlessly start, stop, and replace components of a web application (jar files, in a sense), while the web server is running. That means it allows you to change the application without having to restart the server.

Solution 2

Sling in very simple terms could be described as a REST API for JCR. you can use http requests to manage content inside the repository.

Additionally, Sling provides a mechanism to render that content in different ways for web consumption. you can use scripts (JSP for example) and the java code (servlets, pojos, etc) in the Felix container to process requests and deliver a request.

When a request is made for a particular node, Sling looks up for a property called sling:resourceType, this is a lookup key for rendering scripts. Then the appropiate script is executed using the node as input.

You could write different kinds for renderers and then use it to display your content in different ways.

For example, you could write two scripts full.json.jsp and short.json.jsp and then use them to render the same node in two different ways:

/content/app/node.full.json 

OR

/content/app/node.short.json.

Sling basically matches tokens in the request URL to select an appropriate script.

They have a really nice cheat sheet that explains how request resolution and rendering works

it is a bit more complex than this, since everything is organized in resources and components. you want to check their site for more info

Solution 3

I had the same doubts. The best response I was able to find is in the official Sling page (https://sling.apache.org/)


(What is) Apache Sling, in a hundred words:

Apache Sling is a web framework that uses a Java Content Repository, such as Apache Jackrabbit, to store and manage content.

Sling applications use either scripts or Java servlets, selected based on simple name conventions, to process HTTP requests in a RESTful way.

The embedded Apache Felix OSGi framework and console provide a dynamic runtime environment, where code and content bundles can be loaded, unloaded and reconfigured at runtime.


So, resuming it:

  • Sling is a web framework --> using jackrabbit --> based/supported on JCR API.
  • You can see Apache Felix like a container with its manager.

Note that Sling started as an internal project at Day Software. It's the reason why some bundles/libraries are named like com.day, but in the ends they are two names for the same.

Also, if you want to be clear about Jackrabbit and JCR API you can visit the Jackrabbit's official page http://jackrabbit.apache.org/jcr/jackrabbit-architecture.html

Share:
17,484

Related videos on Youtube

devsda
Author by

devsda

Updated on June 15, 2021

Comments

  • devsda
    devsda about 3 years

    I am asking a very basic question here.

    Question is

    I am using Apache Sling , Apache Jackrabbit, Apache Felix in my project as said by my instructor. I am trying to understand why these software is developed by Apache. I tried a lot on the internet,, but I didn't find any blog or wordpress blog, or any useful youtube video that explain all these projects. Can you explain me about these projects.

    Why these projects developed?
    
    What they do ?
    
    and more questions like this
    

    Previously I found the same doubt with Apache Hadoop, but all the material that I found on net is sufficient for me to get a feel of this project. This time I am struggling with Sling, Felix, Jackrabbit.

    I will be very thankful for you. Waiting for your kind response.

    • Shurmajee
      Shurmajee about 10 years
      Did you manage to make these three systems together?
    • jiggy
      jiggy over 9 years
      These projects are all primarily maintained by Adobe at this point for use in their CMS product Adobe Experience Manager (AEM). Jackrabbit is the reference implementation for JCR which has some adoption outside Adobe (see Modeshape). Felix is an OSGi container which is also an open standard. Sling is web framework for JCR created explicitly for the predecessor to AEM and has near zero adoption outside of AEM. If you're not using AEM, I don't know why you'd choose this stack. There are better options.
  • devsda
    devsda about 11 years
    I got some feel about JackRabbit and Felix. But the statement that gave for Sling is totally bounced to me. Can you explain me again about Sling ?
  • Thomas Mueller
    Thomas Mueller about 11 years
    Sorry, I personally don't know too much about Sling. All I know is what you can also find on the web site.
  • Thomas Mueller
    Thomas Mueller about 11 years
    By the way, the official name is Jackrabbit (lower case r). Sorry to be picky :-)
  • devsda
    devsda about 11 years
    Thanks to make me correct :) . But yes I really want to say one thing. Atleast they should make some good tutorials so that it helps new students to learn these projects from very basic.
  • Sorin Postelnicu
    Sorin Postelnicu over 7 years
    @devsda: For Apache Sling, check out their cool "Discover Sling in 15 minutes" tutorial: sling.apache.org/documentation/getting-started/…
  • Sorin Postelnicu
    Sorin Postelnicu over 7 years
    To have a quick idea of what you can do with Sling, i liked their quick tutorial: "Discover Sling in 15 minutes" sling.apache.org/documentation/getting-started/…