This is a sample using Sling Models, Sling Query and Sling Scripting Thymeleaf.
Additional features used in this sample:
org.apache.sling.samples.fling.internal.Activator
Sling-Bundle-Resources
in pom.xml
Sling-Initial-Content
in pom.xml
maven-sling-plugin
in pom.xml
There are two profiles to install this sample with Maven Sling Plugin into a running local Sling instance for convenience:
When using Sling Launchpad listening on port 8080
with default admin credentials run:
mvn clean install -P launchpad@localhost
When using Apache Karaf with Sling Karaf Launchpad listening on port 8181
with default admin credentials run:
mvn clean install -P karaf@localhost
This will install initial content under /apps/fling
, /content/fling
and /etc/i18n/org.apache.sling.samples.fling
.
Browse to http://localhost:8080/fling.html or http://localhost:8181/fling.html.
To install the required bundles/features on Apache Karaf run the commands below:
karaf@root()> feature:repo-add mvn:org.apache.sling/org.apache.sling.launchpad.karaf-features/0.1.1-SNAPSHOT/xml/features karaf@root()> feature:install sling-launchpad-oak-tar karaf@root()> feature:install sling-extension-models karaf@root()> feature:install sling-extension-query karaf@root()> feature:install sling-scripting-thymeleaf karaf@root()> feature:install sling-auth-form²
For a more detailed user profile add some properties to an user³:
curl -u admin -FfirstName=Foo -FlastName=Bar http://localhost:8181/system/userManager/user/admin.update.json
/fling/auth
) need authentication.org.apache.sling.jcr.jackrabbit.usermanager
or feature sling-jcr-jackrabbit-security
to be installed