Sell yourself I write code I do design/architecture I lead teams I make development teams better.
And that's a good thing because these are often things that we want to define.
I want to build a website that people can go to and enter content. Without training, intuitive
Lots of product options. Each has it's benefits Many can be stood up quickly out of the box. But what if I want to customize?
Wait you just said the C word Customizing a product can be death by 1000 cuts depending on what you're doing.
Frameworks offer a middle ground. They solve a problem but still grant you the flexibility to customize.
So lets talk about sling
Combination of open source projects to make content driven sites easier.
Kind of a chicken or egg thing here. David Neuschler of Day Software created the JSR for JCR. They build Day CQ. Then donated the Sling framework to Apache. A number of Day (now Adobe) employees still run the community for it.
Very different mind set than your typical Web App. Content not MVC runs the show.
So Sling is RESTful by design HTTP request to get data in and out GET - retrieve POST – Create/Modify
Run simple curl commands Note we're creating a multi value field Display the urls through curl
The most sophisticated part of the system. And the hardest to learn. But once you get it. Some incredibly hard problems become easy.
Resource Path – just like your typical web app. Where to retrieve information from. Selectors – Identifies specific content and acts as a parameter passer. Great for SEO. Extention – helps identify the script we're running. Suffix – a second path that is useful to identify additional content.
Note that the multi field is missing. A Bug? Maybe I should submit a jira :).
JCR is the persistence for sling. Underlying it is a file system or a Database. Can run on several Dbs. OOTB it's HSQL.
Eclipse provides a plugin to view and do some simple JCR modifications. One way to administer. Also could use WebDav to move files. Or maven or json/xml with sling.
Lets trace what a homepage request will look like in our soon to be live CMS.
Here is the structure Bot extend the JCR root Apps directory contains scripts: JSP, GSP, ESP.. could be more. Content directory contains content nodes.
Request comes into sling and resolves to a node. That node looks at it's type then tries to resolve a script
That type searches the apps directory (also could go to the libs directory) Once it gets to the folder it wants then it tries to resolve to a script using selectors and extentions. Script executes but wait theirs a sling include tag
Ok we're looking for a node content that's a child of the node we asked for. Child also then resolves it's type
Back to the script directory Selectors and extensions are once again used. If none are provided they are inherited from the parent. Page returns.
It's a polygot programmers playground
1. “Build your own CMS with Apache Sling” By Bob Paulin Paulin Solutions LLC
2. Independent Developer/Architect/Lead Focused on:Web Centric Application Development Mobile Development Support
3. Stuff Sling doesnt give youBYO...Robust Login SecurityXSS ProtectionWYSIWYG Editors
4. The Problem:I want to create a content driven website.
5. Lots of Options
6. STOP!Do one of these meet all of my needs or are they just part of the solution?
7. Why not use a framework instead! SLING
8. What is Sling?
9. Best of BreedApache Felix (OSGi)Apache Jackrabbit (JCR)REST
10. Whos already using Sling? Adobe CQ 5
11. How does Sling Work?
12. Sling Post Servlet One stop shop for Content CRUDhttp://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html
25. Installing Sling 1) Place JAR in Directory 2) java -jar -Xmx1024m -XX:MaxPermSize=256m-agentlib:jdwp=transport=dt_socket,address=30 303,server=y,suspend=n org.apache.sling.launchpad-6-standalone.jar