This is a simple application built on Apache Sling using a sling model and a servlet.
The application consists of two separate modules:
sling-blog
: This is the "core" of the application, consisting of a sling model and a servlet, returning the blog contents as JSON.sling-blog-content
: This consists of some initial content for the repository, as well as the HTL template that uses the sling model.
With your launchpad running and both packages installed, you should be able to examine the following:
- Some content nodes were created:
- /content/blog: a capgemini/blog node
- /content/blog/post1: a capgemini/blogpost node
- When browsing to
localhost:8080/content/blog.json
, you will get an overview of all blogposts that are available under this path. Using following selectors you can specify a selection:- all: shows all blogposts. not to be used together with
3mostrecent
selector - 3mostrecent: shows the three most recent created blogposts. not to be used together with
all
selector - showdetails: shows additional details for all blogposts.
- all: shows all blogposts. not to be used together with
- When browsing to
localhost:8080/content/blog/post1.html
you will be able to see an article.
This is the "core" of the application, consisting of a sling model and a servlet, returning the blog contents as JSON.
This is a maven based project, based on the sling-bundle-archetype. Some extra dependencies were added, as well as the location of the sling models.
Please make sure that JDK 8 has been installed! You can then deploy the application by performing a mvn clean install
with the autoInstallBundle
profile selected.
This consists of some initial content for the repository, as well as the HTL template that uses the sling model.
This is a maven based project, based on the sling-initial-content-archetype. It was configured in such a way, that the initial content will not be overwritten if the bundle is uninstalled. This can be changed in the POM.
You can deploy the application by performing a mvn clean install
with the autoInstallBundle
profile selected. The HTL Maven Plugin
was installed and will block a successful build if there are any warnings or errors.