This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-site.git
The following commit(s) were added to refs/heads/master by this push:
new ddce654 SLING-9434 - Add documentation for content-package based
development
ddce654 is described below
commit ddce6542074006b7598b27f28357832c6553a98d
Author: Robert Munteanu <[email protected]>
AuthorDate: Fri May 8 15:49:05 2020 +0200
SLING-9434 - Add documentation for content-package based development
---
.../bundles/content-loading-jcr-contentloader.md | 2 +-
.../jbake/content/documentation/development.md | 1 +
.../documentation/development/content-packages.md | 96 ++++++++++++++++++++++
3 files changed, 98 insertions(+), 1 deletion(-)
diff --git
a/src/main/jbake/content/documentation/bundles/content-loading-jcr-contentloader.md
b/src/main/jbake/content/documentation/bundles/content-loading-jcr-contentloader.md
index dc67019..aa59a23 100644
---
a/src/main/jbake/content/documentation/bundles/content-loading-jcr-contentloader.md
+++
b/src/main/jbake/content/documentation/bundles/content-loading-jcr-contentloader.md
@@ -4,7 +4,7 @@ status=published
tags=contentloading,nodetypes
~~~~~~
-Apache Sling provides support for initial content loading into a repository
and for registering node types. The `sling-jcr-contentloader` bundle provides
loading of content from a bundle into the repository and the `sling-jcr-base`
bundle provides node type registration.
+Apache Sling provides support for initial content loading into a repository
and for registering node types. The `sling-jcr-contentloader` bundle provides
loading of content from a bundle into the repository and the `sling-jcr-base`
bundle provides node type registration. See [Content-Package based
development](/documentation/development/content-packages.html) for an
alternative for deploying content to the repository.
## Initial Content Loading
diff --git a/src/main/jbake/content/documentation/development.md
b/src/main/jbake/content/documentation/development.md
index ee0fd65..3a6ec93 100644
--- a/src/main/jbake/content/documentation/development.md
+++ b/src/main/jbake/content/documentation/development.md
@@ -16,6 +16,7 @@ Look here for more information on developer support when your
are using Sling to
* [Getting and Building
Sling](/documentation/development/getting-and-building-sling.html)
* [Defining and Launching a Sling based
Application](/documentation/development/slingstart.html)
+* [Content-Package based
development](/documentation/development/content-packages.html)
* [Embedding Sling](/documentation/development/embedding-sling.html)
* [Logging](/documentation/development/logging.html)
* [Client Request
Logging](/documentation/development/client-request-logging.html)
diff --git
a/src/main/jbake/content/documentation/development/content-packages.md
b/src/main/jbake/content/documentation/development/content-packages.md
new file mode 100644
index 0000000..212460a
--- /dev/null
+++ b/src/main/jbake/content/documentation/development/content-packages.md
@@ -0,0 +1,96 @@
+title=Content-Package based development
+type=page
+status=published
+tags=development
+~~~~~~
+
+# Content-Package based development
+
+Sling offers first-class support for [Apache Jackrabbit
FileVault](https://jackrabbit.apache.org/filevault/) content packages.
FileVault offers a way of mapping content on filesystem to the JCR repository
and the other way around. Content packages are an alternative to [the content
loader
mechanism](/documentation/bundles/content-loading-jcr-contentloader.html),
offering a richer tool set and better support for deploying additional
entities, such as users, groups, and access control entries.
+
+There are three components of the content packages support:
+
+- client-side tooling for building and installing content packages
+- server-side support for installing content packages at runtime
+- server-side support for installing content packages at build time
+
+The server-side support for Apache Sling is made of:
+
+- the [Composum Package
Manager](https://www.composum.com/home/nodes/pckgmgr.html), implementing the
HTTP API that receives and installs content packages
+- the [Apache Sling Content Package Installer
Factory](/documentation/bundles/content-package-installer-factory.html),
allowing the deployment of content packages at build time.
+
+Content packages can be included at build time using either the [provisioning
model](/documentation/development/slingstart.html) or the [feature
model](/documentation/development/feature-model.html).
+
+The client-side support depends on the toolset used to build the project.
+
+For Maven projects, this support consists of
+
+- the
[filevault-package-maven-plugin](https://jackrabbit.apache.org/filevault-package-maven-plugin/)
builds content packages from Maven projects
+- the
[wcmio-content-package-maven-plugin](https://wcm.io/tooling/maven/plugins/wcmio-content-package-maven-plugin/)
uploads content packages at runtime to a Sling instance using an HTTP API
+
+For Javascript projects, the suport consists of the [Sling
Packager](https://github.com/apache/sling-slingpackager/).
+
+## Creating a content package
+
+### Maven projects
+
+The [Sling Project
Archetype](https://github.com/apache/sling-project-archetype) creates a
multi-module project that includes content packages as part of its output. To
use it, run the following command
+
+ $ mvn archetype:generate -Dfilter=org.apache.sling:sling-project-archetype
+
+then select the latest version of the archetype and fill in the required
information.
+
+### Node projects
+
+An example project using the Sling Packager can be found at
[peregrine-cms/simple-sling-vue-example](https://github.com/peregrine-cms/simple-sling-vue-example)
on GitHub.
+
+## Deploying a content package at runtime
+
+### Maven projects
+
+Building a content package is achieved using the Maven command line
+
+ $ mvn package
+
+After starting up Sling, the resulting file can then be deployed using the
wcmio-content-package-maven-plugin
+
+ $ mvn wcmio-content-package:install
+
+### Node projects
+
+Content packages are built with
+
+ $ npx slingpackager package <folder>
+
+After starting up Sling, the resulting file can then be deployed with
+
+ $ npx slingpackager upload <content-package.zip> -i
+
+
+### Notes
+
+Inspecting the content package reveals that is is just a ZIP file with
additional metadata.
+
+After deploying the content package, ensure that you are logged in to the
Sling Starter, and then navigate to the Composum Package Manager at
[http://localhost:8080/bin/packages.html](http://localhost:8080/bin/packages.html).
You will see the content package as listed and will be able, for instance, to
uninstall it.
+
+The [Sling IDE Tooling](/documentation/development/ide-tooling.html) has
support for exporting and importing content incrementally to a Sling instance,
and can be used alongside the Maven-based tooling.
+
+## Installing a content package at build time
+
+For the content package to be installed at build time, it must be available in
a Maven repository at the time when the Sling application is built.
+
+For the provisioning model, the content package must be added to an
`artifacts` section, with the zip extension.
+
+ [feature name=my-app]
+
+ [artifacts]
+ org.apache.sling.sample/org.apache.sling.sample001/1.0-SNAPSHOT/zip
+
+For the feature model, the content package must be added to the
`content-packages` section, also with a zip extension:
+
+ {
+ "id": "...",
+ "content-packages:ARTIFACTS|true": [
+ "org.apache.sling.sample:org.apache.sling.sample001:zip:1.0-SNAPSHOT"
+ ]
+ }
\ No newline at end of file