You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2016/05/19 15:14:49 UTC
svn commit: r1744594 - in /sling/trunk/bundles/extensions/repoinit: ./ it/
it/src/main/provisioning/ it/src/test/java/org/apache/sling/repoinit/it/
oak-jcr/ oak-jcr/src/main/java/org/apache/sling/repoinit/jcr/
Author: bdelacretaz
Date: Thu May 19 15:14:49 2016
New Revision: 1744594
URL: http://svn.apache.org/viewvc?rev=1744594&view=rev
Log:
SLING-5355 - RepositoryInitializer created, reads from provisioning model, WIP:ProvisioningModelIT fails for now
Added:
sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/boot.txt
sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/launchpad.txt
sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/oak.txt
sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/repoinit.txt
sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/sling.txt
sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/standalone.txt
sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java
sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/U.java
sling/trunk/bundles/extensions/repoinit/oak-jcr/src/main/java/org/apache/sling/repoinit/jcr/RepositoryInitializer.java
Modified:
sling/trunk/bundles/extensions/repoinit/it/pom.xml
sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/model.txt
sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java
sling/trunk/bundles/extensions/repoinit/oak-jcr/pom.xml
sling/trunk/bundles/extensions/repoinit/pom.xml
Modified: sling/trunk/bundles/extensions/repoinit/it/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/pom.xml?rev=1744594&r1=1744593&r2=1744594&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/pom.xml (original)
+++ sling/trunk/bundles/extensions/repoinit/it/pom.xml Thu May 19 15:14:49 2016
@@ -112,7 +112,7 @@
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>slingstart-maven-plugin</artifactId>
- <version>1.3.6</version>
+ <version>1.4.2</version>
<extensions>true</extensions>
<executions>
<execution>
Added: sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/boot.txt
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/boot.txt?rev=1744594&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/boot.txt (added)
+++ sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/boot.txt Thu May 19 15:14:49 2016
@@ -0,0 +1,55 @@
+#
+# 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]
+
+# additional entries for sling.properties
+# ---------------------------------------
+# oak_tar and oak_mongo run modes are mutually exclusive,
+# and cannot be changed after the first startup
+[settings]
+ sling.run.mode.install.options=oak_tar,oak_mongo
+
+[artifacts]
+ org.slf4j/slf4j-api/1.7.6
+ org.apache.sling/org.apache.sling.commons.log/4.0.6
+ org.apache.sling/org.apache.sling.commons.logservice/1.0.6
+ org.slf4j/jcl-over-slf4j/1.7.6
+ org.slf4j/log4j-over-slf4j/1.7.6
+ org.apache.sling/org.apache.sling.settings/1.3.8
+ org.apache.sling/org.apache.sling.fragment.xml/1.0.2
+ org.apache.sling/org.apache.sling.fragment.transaction/1.0.0
+ org.apache.sling/org.apache.sling.javax.activation/0.1.0
+ org.apache.sling/org.apache.sling.fragment.ws/1.0.2
+ org.apache.sling/org.apache.sling.launchpad.installer/1.2.2
+ org.apache.sling/org.apache.sling.installer.core/3.6.8
+ org.apache.sling/org.apache.sling.installer.provider.file/1.1.0
+ org.apache.sling/org.apache.sling.installer.factory.configuration/1.1.2
+ org.apache.sling/org.apache.sling.installer.factory.subsystems/1.0.0
+ org.apache.sling/org.apache.sling.installer.factory.subsystems-base/1.0.0-SNAPSHOT
+ org.apache.felix/org.apache.felix.configadmin/1.8.8
+ org.apache.felix/org.apache.felix.eventadmin/1.4.4
+ org.apache.aries/org.apache.aries.util/1.1.1
+ org.apache.felix/org.apache.felix.coordinator/1.0.2
+ org.eclipse.equinox/org.eclipse.equinox.region/1.2.101.v20150831-1342
+ org.apache.aries.subsystem/org.apache.aries.subsystem.api/2.0.6
+ org.apache.aries.subsystem/org.apache.aries.subsystem.core/2.0.6
+ # dependency with javax.inject - required for Sling Models (SLING-4710)
+ org.apache.geronimo.specs/geronimo-atinject_1.0_spec/1.0
Added: sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/launchpad.txt
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/launchpad.txt?rev=1744594&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/launchpad.txt (added)
+++ sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/launchpad.txt Thu May 19 15:14:49 2016
@@ -0,0 +1,23 @@
+#
+# 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 :launchpad feature defines Sling's launchpad version
+# Only a single artifact is allowed within this feature.
+#
+[feature name=:launchpad]
+ org.apache.sling/org.apache.sling.launchpad.base/5.4.0-2.6.11-SNAPSHOT
Modified: sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/model.txt
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/model.txt?rev=1744594&r1=1744593&r2=1744594&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/model.txt (original)
+++ sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/model.txt Thu May 19 15:14:49 2016
@@ -16,15 +16,28 @@
# specific language governing permissions and limitations
# under the License.
#
-[feature name=sling]
+[feature name=repoinit-tests]
+
+[artifacts startLevel=2]
+ org.apache.sling/org.apache.sling.repoinit.oak-jcr/0.0.1-SNAPSHOT
+ org.apache.sling/org.apache.sling.repoinit.parser/0.0.1-SNAPSHOT
+ org.apache.sling/org.apache.sling.provisioning.model/1.4.2
[artifacts]
- org.apache.sling/org.apache.sling.launchpad/8/slingstart
org.apache.sling/org.apache.sling.junit.core/1.0.14
org.apache.sling/org.apache.sling.testing.tools/1.0.10
+ org.apache.sling/org.apache.sling.jcr.api/2.3.1-SNAPSHOT
- org.apache.sling/org.apache.sling.repoinit.oak-jcr/0.0.1-SNAPSHOT
- org.apache.sling/org.apache.sling.repoinit.parser/0.0.1-SNAPSHOT
-
[settings]
- org.apache.sling.commons.log.julenabled=true
\ No newline at end of file
+ org.apache.sling.commons.log.julenabled=true
+
+[:repoinit]
+# Test the RepositoryInitializer which reads such sections
+create path /repoinit/fromProvisioningModel
+
+create service user userFromProvisioningModel
+
+set ACL for userFromProvisioningModel
+ allow jcr:read on /repoinit/fromProvisioningModel
+ deny jcr:write on /repoinit/fromProvisioningModel
+end
\ No newline at end of file
Added: sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/oak.txt
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/oak.txt?rev=1744594&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/oak.txt (added)
+++ sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/oak.txt Thu May 19 15:14:49 2016
@@ -0,0 +1,90 @@
+#
+# 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.
+#
+# This is the OAK feature.
+[feature name=oak]
+
+[variables]
+ oak.version=1.4.0
+
+# The segment node store is used via a configuration
+[artifacts startLevel=10]
+ org.apache.felix/org.apache.felix.jaas/0.0.4
+
+[artifacts startLevel=15]
+ org.apache.jackrabbit/oak-core/${oak.version}
+ org.apache.jackrabbit/oak-commons/${oak.version}
+ org.apache.jackrabbit/oak-lucene/${oak.version}
+ org.apache.jackrabbit/oak-blob/${oak.version}
+
+[artifacts startLevel=15 runModes=oak_tar]
+ org.apache.jackrabbit/oak-segment/${oak.version}
+
+[artifacts startLevel=15 runModes=oak_mongo]
+ org.mongodb/mongo-java-driver/2.14.0
+
+# start the Oak server instance after all components have been configured
+# and started to avoid restarting that component ( see SLING-4556 )
+[artifacts startLevel=16]
+ org.apache.sling/org.apache.sling.jcr.oak.server/1.0.1-SNAPSHOT
+
+[configurations]
+ org.apache.felix.jaas.Configuration.factory-GuestLoginModule
+ jaas.controlFlag="optional"
+ jaas.classname="org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule"
+ jaas.ranking=I"300"
+
+ org.apache.felix.jaas.Configuration.factory-LoginModuleImpl
+ jaas.controlFlag="required"
+ jaas.classname="org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImpl"
+
+ org.apache.felix.jaas.Configuration.factory-TokenLoginModule
+ jaas.controlFlag="sufficient"
+ jaas.classname="org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule"
+ jaas.ranking=I"200"
+
+ org.apache.felix.jaas.ConfigurationSpi
+ jaas.defaultRealmName="jackrabbit.oak"
+ jaas.configProviderName="FelixJaasProvider"
+
+ org.apache.jackrabbit.oak.security.authentication.AuthenticationConfigurationImpl
+ org.apache.jackrabbit.oak.authentication.configSpiName="FelixJaasProvider"
+
+ org.apache.jackrabbit.oak.security.user.UserConfigurationImpl
+ groupsPath="/home/groups"
+ usersPath="/home/users"
+ defaultDepth="1"
+ importBehavior="besteffort"
+
+ org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider
+ enabledActions=["org.apache.jackrabbit.oak.spi.security.user.action.AccessControlAction"]
+ userPrivilegeNames=["jcr:all"]
+ groupPrivilegeNames=["jcr:read"]
+
+ org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexProviderService
+ localIndexDir="sling/repository/index"
+
+[configurations runModes=oak_tar]
+ org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
+ name="Default\ NodeStore"
+ repository.home="sling/repository"
+
+[configurations runModes=oak_mongo]
+ org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService
+ mongouri="mongodb://localhost:27017"
+ db="sling"
Added: sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/repoinit.txt
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/repoinit.txt?rev=1744594&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/repoinit.txt (added)
+++ sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/repoinit.txt Thu May 19 15:14:49 2016
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+[feature name=repoinit]
+
+[artifacts]
+ org.apache.sling/org.apache.sling.repoinit.parser/0.0.1-SNAPSHOT
+ org.apache.sling/org.apache.sling.repoinit.oak-jcr/0.0.1-SNAPSHOT
+
\ No newline at end of file
Added: sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/sling.txt
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/sling.txt?rev=1744594&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/sling.txt (added)
+++ sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/sling.txt Thu May 19 15:14:49 2016
@@ -0,0 +1,176 @@
+#
+# 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 feature for Apache Sling
+[feature name=sling]
+
+[variables]
+ jackrabbit.version=2.12.1
+
+[artifacts]
+ commons-collections/commons-collections/3.2.2
+ org.apache.commons/commons-collections4/4.1
+ commons-codec/commons-codec/1.9
+ commons-lang/commons-lang/2.6
+ org.apache.commons/commons-lang3/3.4
+ org.apache.commons/commons-math/2.2
+ org.apache.geronimo.bundles/commons-httpclient/3.1_1
+ org.apache.httpcomponents/httpcore-osgi/4.4.1
+ org.apache.httpcomponents/httpclient-osgi/4.4.1
+ com.google.guava/guava/15.0
+ org.apache.sling/org.apache.sling.adapter/2.1.6
+ org.apache.sling/org.apache.sling.api/2.11.1-SNAPSHOT
+ org.apache.sling/org.apache.sling.auth.core/1.3.14
+ org.apache.sling/org.apache.sling.auth.form/1.0.8
+ org.apache.sling/org.apache.sling.bundleresource.impl/2.2.0
+ org.apache.sling/org.apache.sling.commons.classloader/1.3.2
+ org.apache.sling/org.apache.sling.commons.compiler/2.3.0
+ org.apache.sling/org.apache.sling.commons.fsclassloader/1.0.3-SNAPSHOT
+ org.apache.sling/org.apache.sling.commons.mime/2.1.9-SNAPSHOT
+ org.apache.sling/org.apache.sling.commons.osgi/2.4.0
+ org.apache.sling/org.apache.sling.commons.scheduler/2.4.14
+ org.apache.sling/org.apache.sling.commons.threads/3.2.5-SNAPSHOT
+ org.apache.sling/org.apache.sling.discovery.api/1.0.2
+ org.apache.sling/org.apache.sling.discovery.support/1.0.0
+ org.apache.sling/org.apache.sling.discovery.commons/1.0.10
+ org.apache.sling/org.apache.sling.discovery.base/1.1.2
+ org.apache.sling/org.apache.sling.discovery.oak/1.2.6
+ org.apache.sling/org.apache.sling.engine/2.4.7-SNAPSHOT
+ org.apache.sling/org.apache.sling.event/4.0.0
+ org.apache.sling/org.apache.sling.event.dea/1.0.4
+ org.apache.sling/org.apache.sling.fsresource/1.1.5-SNAPSHOT
+ org.apache.sling/org.apache.sling.hc.core/1.2.2
+ org.apache.sling/org.apache.sling.hc.webconsole/1.1.2
+ org.apache.sling/org.apache.sling.i18n/2.4.6
+ org.apache.sling/org.apache.sling.installer.console/1.0.1-SNAPSHOT
+ org.apache.sling/org.apache.sling.installer.provider.jcr/3.1.17-SNAPSHOT
+ org.apache.sling/org.apache.sling.jcr.contentloader/2.1.11-SNAPSHOT
+ org.apache.sling/org.apache.sling.jcr.resource/2.7.4
+ org.apache.sling/org.apache.sling.launchpad.content/2.0.8
+ org.apache.sling/org.apache.sling.models.api/1.2.2
+ org.apache.sling/org.apache.sling.models.impl/1.2.6
+ org.apache.sling/org.apache.sling.resourceresolver/1.4.12
+ org.apache.sling/org.apache.sling.scripting.api/2.1.8
+ org.apache.sling/org.apache.sling.scripting.core/2.0.37-SNAPSHOT
+ org.apache.sling/org.apache.sling.scripting.javascript/2.0.28
+ org.apache.sling/org.apache.sling.scripting.jsp/2.1.8
+ org.apache.sling/org.apache.sling.scripting.jsp.taglib/2.2.5-SNAPSHOT
+ org.apache.sling/org.apache.sling.scripting.sightly/1.0.16
+ org.apache.sling/org.apache.sling.scripting.sightly.js.provider/1.0.10
+ org.apache.sling/org.apache.sling.scripting.sightly.models.provider/1.0.0
+ org.apache.sling/org.apache.sling.scripting.sightly.repl/1.0.2
+ org.apache.sling/org.apache.sling.serviceusermapper/1.2.2
+ org.apache.sling/org.apache.sling.servlets.get/2.1.14
+ org.apache.sling/org.apache.sling.servlets.post/2.3.10
+ org.apache.sling/org.apache.sling.servlets.resolver/2.4.3-SNAPSHOT
+ org.apache.sling/org.apache.sling.xss/1.0.8
+ javax.mail/mail/1.4.7
+ org.apache.geronimo.bundles/jstl/1.2_1
+ org.apache.felix/org.apache.felix.http.whiteboard/3.0.0
+
+[artifacts startLevel=5]
+ org.apache.sling/org.apache.sling.extensions.webconsolebranding/1.0.0
+ org.apache.sling/org.apache.sling.extensions.webconsolesecurityprovider/1.0.0
+ org.apache.felix/org.apache.felix.inventory/1.0.4
+ org.apache.felix/org.apache.felix.prefs/1.0.6
+ org.apache.felix/org.apache.felix.webconsole/4.2.14
+ org.apache.geronimo.bundles/json/20090211_1
+ org.apache.felix/org.apache.felix.webconsole.plugins.ds/2.0.2
+ org.apache.felix/org.apache.felix.webconsole.plugins.obr/1.0.2
+ org.apache.felix/org.apache.felix.webconsole.plugins.packageadmin/1.0.2
+ org.apache.felix/org.apache.felix.webconsole.plugins.event/1.1.4
+ org.apache.felix/org.apache.felix.webconsole.plugins.memoryusage/1.0.6
+ org.apache.sling/org.apache.sling.commons.json/2.0.16
+ org.apache.felix/org.apache.felix.bundlerepository/1.6.4
+ org.apache.sling/org.apache.sling.extensions.threaddump/0.2.2
+ org.apache.aries.jmx/org.apache.aries.jmx.api/1.1.0
+ org.apache.aries.jmx/org.apache.aries.jmx.core/1.1.1
+ org.apache.aries.jmx/org.apache.aries.jmx.whiteboard/1.0.0
+ commons-io/commons-io/2.4
+ commons-fileupload/commons-fileupload/1.3.1
+
+[artifacts startLevel=10]
+ org.apache.felix/org.apache.felix.http.sslfilter/1.0.4
+ org.apache.felix/org.apache.felix.scr/2.0.2
+ org.apache.felix/org.apache.felix.metatype/1.1.2
+ org.apache.tika/tika-core/1.11
+ org.apache.tika/tika-bundle/1.11
+
+[artifacts startLevel=15]
+ org.apache.sling/org.apache.sling.jcr.jcr-wrapper/2.0.0
+ org.apache.sling/org.apache.sling.jcr.api/2.3.1-SNAPSHOT
+ org.apache.sling/org.apache.sling.jcr.base/2.3.3-SNAPSHOT
+ org.apache.sling/org.apache.sling.jcr.registration/1.0.2
+ org.apache.jackrabbit/jackrabbit-api/${jackrabbit.version}
+ org.apache.jackrabbit/jackrabbit-jcr-commons/${jackrabbit.version}
+ org.apache.jackrabbit/jackrabbit-spi/${jackrabbit.version}
+ org.apache.jackrabbit/jackrabbit-spi-commons/${jackrabbit.version}
+ org.apache.jackrabbit/jackrabbit-webdav/${jackrabbit.version}
+ org.apache.jackrabbit/jackrabbit-jcr-rmi/${jackrabbit.version}
+ org.apache.jackrabbit/jackrabbit-data/${jackrabbit.version}
+ org.apache.sling/org.apache.sling.jcr.webdav/2.3.5-SNAPSHOT
+ org.apache.sling/org.apache.sling.jcr.davex/1.3.3-SNAPSHOT
+ org.apache.sling/org.apache.sling.jcr.jackrabbit.usermanager/2.2.4
+ org.apache.sling/org.apache.sling.jcr.jackrabbit.accessmanager/2.1.2
+ org.apache.sling/org.apache.sling.jcr.webconsole/1.0.2
+ org.apache.sling/org.apache.sling.extensions.explorer/1.0.4
+ io.dropwizard.metrics/metrics-core/3.1.0
+ org.apache.sling/org.apache.sling.commons.metrics/1.0.1-SNAPSHOT
+
+[configurations]
+ org.apache.sling.engine.impl.log.RequestLogger
+ access.log.enabled=B"true"
+ request.log.outputtype=I"0"
+ access.log.output="log.access"
+ request.log.output="log.request"
+ request.log.enabled=B"true"
+ access.log.outputtype=I"0"
+
+ org.apache.sling.commons.log.LogManager
+ org.apache.sling.commons.log.pattern="%d{dd.MM.yyyy HH:mm:ss.SSS}\ *%level*\ [%thread]\ %logger\ %msg%n"
+ org.apache.sling.commons.log.file="logs/error.log"
+ org.apache.sling.commons.log.level="info"
+ org.apache.sling.commons.log.file.size="'.'yyyy-MM-dd"
+ org.apache.sling.commons.log.file.number=I"7"
+
+ org.apache.sling.commons.log.LogManager.factory.config-access.log
+ org.apache.sling.commons.log.pattern="%msg%n"
+ org.apache.sling.commons.log.names=["log.access"]
+ org.apache.sling.commons.log.file="logs/access.log"
+ org.apache.sling.commons.log.level="info"
+
+ org.apache.sling.commons.log.LogManager.factory.config-request.log
+ org.apache.sling.commons.log.pattern="%msg%n"
+ org.apache.sling.commons.log.names=["log.request"]
+ org.apache.sling.commons.log.file="logs/request.log"
+ org.apache.sling.commons.log.level="info"
+
+ # configure the ScriptCache for scripts used by org.apache.sling.scripting.sightly.js.provider
+ org.apache.sling.scripting.core.impl.ScriptCacheImpl
+ org.apache.sling.scripting.cache.additional_extensions=["js"]
+
+ # WebDAV servlet requires config now
+ org.apache.sling.jcr.webdav.impl.servlets.SimpleWebDavServlet
+ dav.root="/dav"
+
+ # DavEx servlet requires config now
+ org.apache.sling.jcr.davex.impl.servlets.SlingDavExServlet
+ alias="/server"
+
+ org.apache.sling.resourceresolver.impl.observation.OsgiObservationBridge
+ enabled=B"true"
Added: sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/standalone.txt
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/standalone.txt?rev=1744594&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/standalone.txt (added)
+++ sling/trunk/bundles/extensions/repoinit/it/src/main/provisioning/standalone.txt Thu May 19 15:14:49 2016
@@ -0,0 +1,26 @@
+#
+# 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 :standalone feature contains artifacts for the standalone jar
+#
+[feature name=standalone]
+
+# Add a servlet implementation for the standalone case
+[artifacts startLevel=5 runModes=:standalone]
+ org.apache.felix/org.apache.felix.http.servlet-api/1.1.2
+ org.apache.felix/org.apache.felix.http.jetty/3.1.4
Added: sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java?rev=1744594&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java (added)
+++ sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/ProvisioningModelIT.java Thu May 19 15:14:49 2016
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+package org.apache.sling.repoinit.it;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import javax.jcr.Session;
+
+import org.apache.sling.jcr.api.SlingRepository;
+import org.apache.sling.junit.rules.TeleporterRule;
+import org.apache.sling.repoinit.parser.RepoInitParser;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+@Ignore("Fails for now - initializer not executed?")
+/** Test repoinit statements supplied by our provisioning model */
+public class ProvisioningModelIT {
+
+ private Session session;
+ private static final String TEST_PATH = "/repoinit/fromProvisioningModel";
+ private static final String TEST_USER = "fromProvisioningModel";
+
+ @Rule
+ public TeleporterRule teleporter = TeleporterRule.forClass(getClass(), "IT");
+
+ @Before
+ public void setup() throws Exception {
+ WaitFor.services(teleporter, SlingRepository.class, RepoInitParser.class);
+ session = teleporter.getService(SlingRepository.class).loginAdministrative(null);
+ }
+
+ @After
+ public void cleanup() {
+ if(session != null) {
+ session.logout();
+ }
+ }
+
+ @Test
+ public void provisioningModelUserExists() throws Exception {
+ assertTrue("Expecting user " + TEST_USER, U.userExists(session, TEST_USER));
+ }
+
+ @Test
+ public void provisioningModelUserAcl() throws Exception {
+ assertTrue("Expecting read access", U.canRead(session, TEST_USER, TEST_PATH));
+ assertFalse("Expecting no write access", U.canWrite(session, TEST_USER, TEST_PATH));
+ }
+}
Modified: sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java?rev=1744594&r1=1744593&r2=1744594&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java (original)
+++ sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/RepoInitIT.java Thu May 19 15:14:49 2016
@@ -22,18 +22,9 @@ import static org.junit.Assert.assertTru
import java.io.InputStream;
import java.io.InputStreamReader;
-import java.util.UUID;
-import javax.jcr.AccessDeniedException;
-import javax.jcr.LoginException;
-import javax.jcr.Node;
-import javax.jcr.PathNotFoundException;
-import javax.jcr.RepositoryException;
import javax.jcr.Session;
-import javax.jcr.SimpleCredentials;
-import org.apache.jackrabbit.api.JackrabbitSession;
-import org.apache.jackrabbit.api.security.user.Authorizable;
import org.apache.sling.jcr.api.SlingRepository;
import org.apache.sling.junit.rules.TeleporterRule;
import org.apache.sling.repoinit.jcr.JcrRepoInitOpVisitor;
@@ -89,41 +80,12 @@ public class RepoInitIT {
}
}
- private boolean userExists(String id) throws LoginException, RepositoryException, InterruptedException {
- final Authorizable a = ((JackrabbitSession)session).getUserManager().getAuthorizable(id);
- return a != null;
- }
-
- private Session getServiceSession(String serviceId) throws LoginException, RepositoryException {
- return session.impersonate(new SimpleCredentials(serviceId, new char[0]));
- }
-
- /** True if user can write to specified path.
- * @throws PathNotFoundException if the path doesn't exist */
- private boolean canWrite(String userId, String path) throws PathNotFoundException,RepositoryException {
- if(!session.itemExists(path)) {
- throw new PathNotFoundException(path);
- }
-
- final Session serviceSession = getServiceSession(userId);
- final String testNodeName = "test_" + UUID.randomUUID().toString();
- try {
- ((Node)serviceSession.getItem(path)).addNode(testNodeName);
- serviceSession.save();
- } catch(AccessDeniedException ade) {
- return false;
- } finally {
- serviceSession.logout();
- }
- return true;
- }
-
@Test
public void serviceUserCreated() throws Exception {
new Retry() {
@Override
public Void call() throws Exception {
- assertTrue("Expecting user " + FRED_WILMA, userExists(FRED_WILMA));
+ assertTrue("Expecting user " + FRED_WILMA, U.userExists(session, FRED_WILMA));
return null;
}
};
@@ -134,8 +96,8 @@ public class RepoInitIT {
new Retry() {
@Override
public Void call() throws Exception {
- assertFalse("Expecting no write access to A", canWrite(FRED_WILMA, "/acltest/A"));
- assertTrue("Expecting write access to A/B", canWrite(FRED_WILMA, "/acltest/A/B"));
+ assertFalse("Expecting no write access to A", U.canWrite(session, FRED_WILMA, "/acltest/A"));
+ assertTrue("Expecting write access to A/B", U.canWrite(session, FRED_WILMA, "/acltest/A/B"));
return null;
}
};
@@ -146,8 +108,8 @@ public class RepoInitIT {
new Retry() {
@Override
public Void call() throws Exception {
- assertTrue("Expecting write access to A", canWrite(ANOTHER, "/acltest/A"));
- assertFalse("Expecting no write access to B", canWrite(ANOTHER, "/acltest/A/B"));
+ assertTrue("Expecting write access to A", U.canWrite(session, ANOTHER, "/acltest/A"));
+ assertFalse("Expecting no write access to B", U.canWrite(session, ANOTHER, "/acltest/A/B"));
return null;
}
};
Added: sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/U.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/U.java?rev=1744594&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/U.java (added)
+++ sling/trunk/bundles/extensions/repoinit/it/src/test/java/org/apache/sling/repoinit/it/U.java Thu May 19 15:14:49 2016
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+package org.apache.sling.repoinit.it;
+
+import java.util.UUID;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.LoginException;
+import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+
+import org.apache.jackrabbit.api.JackrabbitSession;
+import org.apache.jackrabbit.api.security.user.Authorizable;
+
+/** Test utilities */
+public class U {
+ public static boolean userExists(Session session, String id) throws LoginException, RepositoryException, InterruptedException {
+ final Authorizable a = ((JackrabbitSession)session).getUserManager().getAuthorizable(id);
+ return a != null;
+ }
+
+ public static Session getServiceSession(Session session, String serviceId) throws LoginException, RepositoryException {
+ return session.impersonate(new SimpleCredentials(serviceId, new char[0]));
+ }
+
+ /** True if user can write to specified path.
+ * @throws PathNotFoundException if the path doesn't exist */
+ public static boolean canWrite(Session session, String userId, String path) throws PathNotFoundException,RepositoryException {
+ if(!session.itemExists(path)) {
+ throw new PathNotFoundException(path);
+ }
+
+ final Session serviceSession = getServiceSession(session, userId);
+ final String testNodeName = "test_" + UUID.randomUUID().toString();
+ try {
+ ((Node)serviceSession.getItem(path)).addNode(testNodeName);
+ serviceSession.save();
+ } catch(AccessDeniedException ade) {
+ return false;
+ } finally {
+ serviceSession.logout();
+ }
+ return true;
+ }
+
+ /** True if user can read specified path.
+ * @throws PathNotFoundException if the path doesn't exist */
+ public static boolean canRead(Session session, String userId, String path) throws PathNotFoundException,RepositoryException {
+ if(!session.itemExists(path)) {
+ throw new PathNotFoundException(path);
+ }
+
+ final Session serviceSession = getServiceSession(session, userId);
+ try {
+ serviceSession.getItem(path);
+ } catch(AccessDeniedException ade) {
+ return false;
+ } finally {
+ serviceSession.logout();
+ }
+ return true;
+ }
+}
\ No newline at end of file
Modified: sling/trunk/bundles/extensions/repoinit/oak-jcr/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/oak-jcr/pom.xml?rev=1744594&r1=1744593&r2=1744594&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/oak-jcr/pom.xml (original)
+++ sling/trunk/bundles/extensions/repoinit/oak-jcr/pom.xml Thu May 19 15:14:49 2016
@@ -62,6 +62,14 @@
<dependencies>
<dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.compendium</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
@@ -99,6 +107,23 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.jcr.api</artifactId>
+ <version>2.3.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.provisioning.model</artifactId>
+ <version>1.4.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.commons.osgi</artifactId>
+ <version>2.2.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
@@ -106,7 +131,6 @@
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
- <scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
Added: sling/trunk/bundles/extensions/repoinit/oak-jcr/src/main/java/org/apache/sling/repoinit/jcr/RepositoryInitializer.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/oak-jcr/src/main/java/org/apache/sling/repoinit/jcr/RepositoryInitializer.java?rev=1744594&view=auto
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/oak-jcr/src/main/java/org/apache/sling/repoinit/jcr/RepositoryInitializer.java (added)
+++ sling/trunk/bundles/extensions/repoinit/oak-jcr/src/main/java/org/apache/sling/repoinit/jcr/RepositoryInitializer.java Thu May 19 15:14:49 2016
@@ -0,0 +1,161 @@
+/*
+ * 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.
+ */
+package org.apache.sling.repoinit.jcr;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Map;
+
+import javax.jcr.Session;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.jcr.api.SlingRepository;
+import org.apache.sling.jcr.api.SlingRepositoryInitializer;
+import org.apache.sling.provisioning.model.Feature;
+import org.apache.sling.provisioning.model.Model;
+import org.apache.sling.provisioning.model.Section;
+import org.apache.sling.provisioning.model.io.ModelReader;
+import org.apache.sling.repoinit.parser.RepoInitParser;
+import org.apache.sling.repoinit.parser.operations.Operation;
+import org.osgi.framework.Constants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/** SlingRepositoryInitializer that executes repoinit statements read
+ * from a configurable URL.
+ */
+@Component
+@Service(SlingRepositoryInitializer.class)
+@Properties({
+ // SlingRepositoryInitializers are executed in ascending
+ // order of their service ranking
+ @Property(name=Constants.SERVICE_RANKING, intValue=100)
+})
+public class RepositoryInitializer implements SlingRepositoryInitializer {
+ private final Logger log = LoggerFactory.getLogger(getClass());
+
+ public static final String DEFAULT_TEXT_URL = "context:/resources/provisioning/model.txt";
+
+ @Property(
+ label="Text URL",
+ description="URL of the source text that provides repoinit statements."
+ + " That text is processed according to the model section name parameter.",
+ value=DEFAULT_TEXT_URL)
+ public static final String PROP_TEXT_URL = "text.url";
+ private String textURL;
+
+ public static final String DEFAULT_MODEL_SECTION_NAME = ":repoinit";
+
+ @Property(
+ label="Model section name",
+ description=
+ "Optional provisioning model section name to used to extract repoinit statements"
+ + " from the raw text provided by our text URL. Leave empty to consider the content"
+ + " provided by that URL to already be in repoinit format",
+ value=DEFAULT_MODEL_SECTION_NAME)
+ public static final String PROP_MODEL_SECTION_NAME = "model.section.name";
+ private String modelSectionName;
+
+ @Reference
+ private RepoInitParser parser;
+
+ @Activate
+ public void activate(Map<String, Object> config) {
+ textURL = PropertiesUtil.toString(config.get(PROP_TEXT_URL), DEFAULT_TEXT_URL);
+ modelSectionName = PropertiesUtil.toString(config.get(PROP_MODEL_SECTION_NAME), DEFAULT_MODEL_SECTION_NAME);
+ }
+
+ @Override
+ public void processRepository(SlingRepository repo) throws Exception {
+ final String repoinit = getRepoInitText();
+ int count=0;
+
+ // loginAdministrative is ok here, definitely an admin operation
+ final Session s = repo.loginAdministrative(null);
+ final JcrRepoInitOpVisitor v = new JcrRepoInitOpVisitor(s);
+ try {
+ for(Operation op : parser.parse(new StringReader(repoinit))) {
+ count++;
+ log.info("Executing {}", op);
+ op.accept(v);
+ }
+ log.info("{} repoinit operations executed", count);
+ } finally {
+ s.logout();
+ }
+ }
+
+ /** Get the repoinit statements to execute */
+ private String getRawRepoInitText() {
+ String result = "";
+ try {
+ final URL url = new URL(textURL);
+ final URLConnection c = url.openConnection();
+ final InputStream is = c.getInputStream();
+ if(is == null) {
+ log.warn("Cannot get InputStream for {}", url);
+ } else {
+ final StringWriter w = new StringWriter();
+ IOUtils.copy(is, w, "UTF-8");
+ }
+ } catch(Exception e) {
+ log.warn("Error reading repoinit statements from " + textURL, e);
+ }
+ return result;
+ }
+
+ private String getRepoInitText() {
+ final boolean parseRawText = modelSectionName.trim().length() > 0;
+ if(parseRawText) {
+ log.info("Reading repoinit statements from {}", textURL);
+ } else {
+ log.info("Extracting repoinit statements from section {} of provisioning model {}", modelSectionName, textURL);
+ }
+ String result = getRawRepoInitText();
+ log.debug("Raw text from {}: \n{}", textURL, result);
+ if(parseRawText) {
+ final StringReader r = new StringReader(result);
+ try {
+ final Model m = ModelReader.read(r, textURL);
+ final StringBuilder b = new StringBuilder();
+ for(Feature f : m.getFeatures()) {
+ for(Section s : f.getAdditionalSections(modelSectionName)) {
+ b.append("# ").append(modelSectionName).append(" from ").append(f.getName()).append("\n");
+ b.append("# ").append(s.getComment()).append("\n");
+ b.append(s.getContents()).append("\n");
+ }
+ }
+ result = b.toString();
+ } catch (IOException e) {
+ result = "";
+ log.warn("Error parsing provisioning model from " + textURL, e);
+ }
+ }
+ return result;
+ }
+}
\ No newline at end of file
Modified: sling/trunk/bundles/extensions/repoinit/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/repoinit/pom.xml?rev=1744594&r1=1744593&r2=1744594&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/repoinit/pom.xml (original)
+++ sling/trunk/bundles/extensions/repoinit/pom.xml Thu May 19 15:14:49 2016
@@ -43,6 +43,5 @@
<module>parser</module>
<module>oak-jcr</module>
<module>it</module>
- <module>startup</module>
</modules>
</project>