SLING-4381 add nosql sample launchpad
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1703297 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8563298
--- /dev/null
+++ b/README.md
@@ -0,0 +1,16 @@
+Apache Sling NoSQL Sample Launchpad
+===================================
+
+Variant of the Sling Launchpad to run NoSQL Resource Providers in standalone mode.
+
+To run with NoSQL MongoDB resource provider:
+
+```
+java -Dsling.run.modes=nosql-mongodb -jar target/org.apache.sling.nosql.launchpad-1.0.0-SNAPSHOT.jar -c sling -f -
+```
+
+To run with NoSQL Couchbase resource provider:
+
+```
+java -Dsling.run.modes=nosql-couchbase -jar target/org.apache.sling.nosql.launchpad-1.0.0-SNAPSHOT.jar -c sling -f -
+```
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..87d6088
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>sling</artifactId>
+ <version>24</version>
+ <relativePath/>
+ </parent>
+
+ <artifactId>org.apache.sling.nosql.launchpad</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>slingstart</packaging>
+
+ <name>Apache Sling NoSQL Launchpad</name>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/nosql/launchpad</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/nosql/launchpad</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/contrib/nosql/launchpad</url>
+ </scm>
+
+ <properties>
+ <sling.java.version>7</sling.java.version>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.launchpad</artifactId>
+ <type>slingfeature</type>
+ <classifier>slingfeature</classifier>
+ <version>8-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.nosql.generic</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- MongoDB -->
+ <dependency>
+ <groupId>org.mongodb</groupId>
+ <artifactId>mongo-java-driver</artifactId>
+ <version>3.0.4</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.nosql.mongodb-resourceprovider</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Couchbase -->
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.nosql.couchbase-client</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.nosql.couchbase-resourceprovider</artifactId>
+ <version>0.5.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.wcm.osgi.wrapper</groupId>
+ <artifactId>io.wcm.osgi.wrapper.rxjava</artifactId>
+ <version>1.0.11-0000</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ <version>3.3.2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>slingstart-maven-plugin</artifactId>
+ <version>1.3.6</version>
+ <extensions>true</extensions>
+ <configuration>
+ <usePomDependencies>true</usePomDependencies>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>derby.log</include>
+ <include>cachedir/**</include>
+ <include>sling/**</include>
+ <include>jackrabbit/**</include>
+ <include>coverage.ec</include>
+ </includes>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+
+ <!-- do not deploy launchpad example into maven repository -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <!-- Extend RAT configuration from parent pom -->
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes combine.children="append">
+ <!-- Exclude sling instance -->
+ <exclude>sling/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
diff --git a/src/main/provisioning/boot.txt b/src/main/provisioning/boot.txt
new file mode 100644
index 0000000..fdac1d5
--- /dev/null
+++ b/src/main/provisioning/boot.txt
@@ -0,0 +1,27 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# The :boot feature contains all things to bootstrap the installation.
+#
+[feature name=:boot]
+
+[settings]
+ sling.run.mode.install.options=nosql-mongodb,nosql-couchbase
+
+[artifacts]
+ org.apache.sling/org.apache.sling.launchpad//slingfeature/slingfeature
diff --git a/src/main/provisioning/nosql-couchbase.txt b/src/main/provisioning/nosql-couchbase.txt
new file mode 100644
index 0000000..5128d75
--- /dev/null
+++ b/src/main/provisioning/nosql-couchbase.txt
@@ -0,0 +1,44 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# NoSQL Launchpad
+
+[feature name=nosql-couchbase]
+
+[artifacts runModes=nosql-couchbase]
+ org.apache.sling/org.apache.sling.nosql.couchbase-client
+ org.apache.sling/org.apache.sling.nosql.couchbase-resourceprovider
+ io.wcm.osgi.wrapper/io.wcm.osgi.wrapper.rxjava
+
+
+[configurations runModes=nosql-couchbase]
+
+ # Mount NoSQL Couchbase as root resource provider factory
+ org.apache.sling.nosql.couchbase.resourceprovider.CouchbaseNoSqlResourceProviderFactory.factory.config-default
+ provider.roots=["/"]
+
+ # Configure Couchbase Client for resource provider
+ org.apache.sling.nosql.couchbase.client.CouchbaseClient.factory.config-default
+ clientId="sling-resourceprovider-couchbase"
+ couchbaseHosts="localhost:8091"
+ bucketName="test"
+ enabled=B"true"
+
+ # Remove JCR resource provider factory as required default providers
+ org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl
+ resource.resolver.required.providers=[]
diff --git a/src/main/provisioning/nosql-generic.txt b/src/main/provisioning/nosql-generic.txt
new file mode 100644
index 0000000..3bdd917
--- /dev/null
+++ b/src/main/provisioning/nosql-generic.txt
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# NoSQL Launchpad
+
+[feature name=nosql-generic]
+
+[artifacts]
+ org.apache.sling/org.apache.sling.nosql.generic
+ org.apache.commons/commons-lang3
diff --git a/src/main/provisioning/nosql-mongodb.txt b/src/main/provisioning/nosql-mongodb.txt
new file mode 100644
index 0000000..dd800ba
--- /dev/null
+++ b/src/main/provisioning/nosql-mongodb.txt
@@ -0,0 +1,38 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# NoSQL Launchpad
+
+[feature name=nosql-mongodb]
+
+[artifacts runModes=nosql-mongodb]
+ org.mongodb/mongo-java-driver
+ org.apache.sling/org.apache.sling.nosql.mongodb-resourceprovider
+
+[configurations runModes=nosql-mongodb]
+
+ # Mount NoSQL MongoDB as root resource provider factory
+ org.apache.sling.nosql.mongodb.resourceprovider.MongoDBNoSqlResourceProviderFactory.factory.config-default
+ provider.roots=["/"]
+ connectionString="localhost:27017"
+ database="sling"
+ collection="resources"
+
+ # Remove JCR resource provider factory as required default providers
+ org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl
+ resource.resolver.required.providers=[]