sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1754502 - in /sling/trunk/contrib/extensions/context-aware-config: ./ api/ api/src/ api/src/main/ api/src/main/java/ api/src/main/java/org/ api/src/main/java/org/apache/ api/src/main/java/org/apache/sling/ api/src/main/java/org/apache/slin...
Date Fri, 29 Jul 2016 12:19:19 GMT
Author: cziegeler
Date: Fri Jul 29 12:19:18 2016
New Revision: 1754502

URL: http://svn.apache.org/viewvc?rev=1754502&view=rev
Log:
SLING-5886 : Add draft api

Added:
    sling/trunk/contrib/extensions/context-aware-config/api/
    sling/trunk/contrib/extensions/context-aware-config/api/README.txt   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/pom.xml   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationBuilder.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationResolver.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/package-info.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/ConfigurationResourceResolver.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/package-info.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationMetadataProvider.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationOverrideProvider.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationPersistenceProvider.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ContextPathStrategy.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/AbstractConfigurationPart.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationMetadata.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationPart.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/PropertyMetadata.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/package-info.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/package-info.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/test/
    sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/
    sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/
    sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/
    sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/
    sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/
    sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/
    sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/
    sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/ConfigurationMetadataTest.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/PropertyMetadataTest.java   (with props)
    sling/trunk/contrib/extensions/context-aware-config/pom.xml   (with props)

Added: sling/trunk/contrib/extensions/context-aware-config/api/README.txt
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/README.txt?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/README.txt (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/README.txt Fri Jul 29 12:19:18 2016
@@ -0,0 +1,25 @@
+Apache Sling Context Aware Configuration API
+
+
+Getting Started
+===============
+
+This component uses a Maven 3 (http://maven.apache.org/) build
+environment. It requires a Java 7 JDK (or higher) and Maven (http://maven.apache.org/)
+3.3.9 or later. We recommend to use the latest Maven version.
+
+If you have Maven 3 installed, you can compile and
+package the jar using the following command:
+
+    mvn package
+
+See the Maven 3 documentation for other build features.
+
+The latest source code for this component is available in the
+Subversion (http://subversion.tigris.org/) source repository of
+the Apache Software Foundation. If you have Subversion installed,
+you can checkout the latest source using the following command:
+
+    svn checkout https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/context-aware-config/api
+
+See the Subversion documentation for other source control features.

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/README.txt
------------------------------------------------------------------------------
    svn:keywords = Id

Added: sling/trunk/contrib/extensions/context-aware-config/api/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/pom.xml?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/pom.xml (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/pom.xml Fri Jul 29 12:19:18 2016
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>27</version>
+        <relativePath />
+    </parent>
+    
+    <artifactId>org.apache.sling.config.api</artifactId>
+    <packaging>bundle</packaging>
+    <version>1.0.0-SNAPSHOT</version>
+    <name>Apache Sling Context-Aware-Config API</name>
+    <description>Apache Sling Context-Aware-Config API</description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/context-aware-config/api</connection>
+        <developerConnection> scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/context-aware-config/api</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api</url>
+    </scm>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.google.code.findbugs</groupId>
+            <artifactId>jsr305</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.4.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+    </dependencies>
+</project>

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationBuilder.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationBuilder.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationBuilder.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,54 @@
+/*
+ * 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.config;
+
+import java.util.Collection;
+
+import javax.annotation.Nonnull;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Defines how the configuration should be mapped and returned.
+ */
+@ProviderType
+public interface ConfigurationBuilder {
+    
+    /**
+     * Define configuration name. Optional when using annotation class, mandatory when getting configuration as value map.
+     * @param configName Relative path
+     * @return Configuration builder
+     */
+    @Nonnull ConfigurationBuilder name(@Nonnull String configName);
+    
+    /**
+     * Get configuration as singleton and its properties mapped to the given annotation class.
+     * @param clazz Annotation class or {@link org.apache.sling.api.resource.ValueMap}
+     * @return Configuration object
+     */
+    @Nonnull <T> T as(@Nonnull Class<T> clazz);
+
+    /**
+     * Get list of configuration instances with its properties mapped to the given annotation class.
+     * @param clazz Annotation class or {@link org.apache.sling.api.resource.ValueMap}
+     * @return List of configuration objects
+     */
+    @Nonnull <T> Collection<T> asCollection(@Nonnull Class<T> clazz);
+
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationBuilder.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationResolver.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationResolver.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationResolver.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationResolver.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,41 @@
+/*
+ * 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.config;
+
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Getting context-specific configurations for a given resource context.
+ * Context-specific configuration may be different for different parts of the resource
+ * hierarchy, and configuration parameter inheritance may take place.
+ */
+@ProviderType
+public interface ConfigurationResolver {
+
+    /**
+     * Get configuration for given resource.
+     * @param resource Context resource
+     * @return Configuration builder
+     */
+    @Nonnull ConfigurationBuilder get(@Nonnull Resource resource);
+
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/ConfigurationResolver.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/package-info.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/package-info.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/package-info.java Fri Jul 29 12:19:18 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.
+ */
+/**
+ * API for accessing context-specific configuration.
+ */
+@org.osgi.annotation.versioning.Version("1.0.0")
+package org.apache.sling.config;

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/package-info.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/ConfigurationResourceResolver.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/ConfigurationResourceResolver.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/ConfigurationResourceResolver.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/ConfigurationResourceResolver.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,68 @@
+/*
+ * 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.config.resource;
+
+import java.util.Collection;
+
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Getting context-specific configuration resources for a given resource context.
+ * This is a low-level interface for supporting advanced usecases. If you just want to fetch
+ * some configuration parameters {@link ConfigurationResolver} is the right place.
+ */
+@ProviderType
+public interface ConfigurationResourceResolver {
+
+    /**
+     * Get a context-specific singleton configuration resource defined by the given configuration name. 
+     * @param resource Context resource to fetch configuration for
+     * @param configName Configuration name or relative path.
+     * @return Configuration resource
+     */
+    @Nonnull Resource getResource(@Nonnull Resource resource, @Nonnull String configName);
+    
+    /**
+     * Get a list of context-specific configuration resources defined by the given configuration name. 
+     * @param resource Context resource to fetch configuration for
+     * @param configName Configuration name or relative path.
+     * @return List of configuration resources
+     */
+    @Nonnull Collection<Resource> getResourceList(@Nonnull Resource resource, @Nonnull String configName);
+    
+    /**
+     * Get the inner-most context path (deepest path) returned by {@link #getAllContextPaths(Resource)}.
+     * @param resource Context resource to fetch configuration for
+     * @return Context path or null
+     */
+    String getContextPath(@Nonnull Resource resource);
+
+    /**
+     * Get all context paths for which context-specific configurations could be defined.
+     * The context paths are always ancestors of the resource path, or the resource path itself.
+     * Which ancestors are allowed for context-specific configuration depends on configuration.
+     * @param resource Context resource to fetch configuration for
+     * @return List of context paths
+     */
+    @Nonnull Collection<String> getAllContextPaths(@Nonnull Resource resource);
+    
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/ConfigurationResourceResolver.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/ConfigurationResourceResolver.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/package-info.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/package-info.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/package-info.java Fri Jul 29 12:19:18 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.
+ */
+/**
+ * API for accessing context-specific configuration resources.
+ * This is a low-level API.
+ */
+@org.osgi.annotation.versioning.Version("1.0.0")
+package org.apache.sling.config.resource;

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/resource/package-info.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationMetadataProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationMetadataProvider.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationMetadataProvider.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationMetadataProvider.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,39 @@
+/*
+ * 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.config.spi;
+
+import java.util.Collection;
+
+import javax.annotation.Nonnull;
+
+import org.apache.sling.config.spi.metadata.ConfigurationMetadata;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Allows application to provide the necessary metadata for configurations.
+ */
+@ConsumerType
+public interface ConfigurationMetadataProvider {
+
+    /**
+     * @return Configuration metadata that the application defines
+     */
+    @Nonnull Collection<ConfigurationMetadata> getConfigSets();
+
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationMetadataProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationMetadataProvider.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationOverrideProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationOverrideProvider.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationOverrideProvider.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationOverrideProvider.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,68 @@
+/*
+ * 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.config.spi;
+
+import java.util.Map;
+
+import javax.annotation.Nonnull;
+
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Provides configuration override values (default or forced).
+ */
+@ConsumerType
+public interface ConfigurationOverrideProvider {
+
+    /**
+     * Returns a map with key value pairs for configuration parameter override.
+     * <p>
+     * Key:
+     * </p>
+     * <ul>
+     * <li>Syntax: <code>[{scope}[:locked]]{configName}/{propertyName}</code></li>
+     * <li><code>{scope}</code>: if "default", the system default parameter is overridden. Otherwise <code>{scope}</code>
+     * may define a context path, in this case the configuration set's property value is overwritten by force for this
+     * context path. If the [{scope}] part is missing or [locked], the parameter is overridden for all context paths.</li>
+     * <li><code>locked</code>: If the scope value is suffixed with the string &quot;:locked&quot; this configuration
+     * parameter cannot be overridden in nested configuration scopes.</li>
+     * <li><code>{configName}</code>: Configuration name</li>
+     * <li><code>{propertyName}</code>: Configuration property name</li>
+     * </ul>
+     * <p>
+     * Examples:
+     * </p>
+     * <ul>
+     * <li><code>[default]set1/param1</code> - Override default value for property "param1" from set "set1"</li>
+     * <li><code>set1/param1</code> - Override value for property "param1" from set "set1" for all context paths</li>
+     * <li><code>[/content/region1/site1]set1/param1</code> - Override value for property "param1" from set "set1" for the context path
+     * <code>/content/region1/site1</code>. This has higher precedence than the other variants.</li>
+     * </ul>
+     * <p>
+     * Value:
+     * </p>
+     * <ul>
+     *  <li>Override value</li>
+     * <li>Has to be convertible to the property's type</li>
+     * </ul>
+     * @return Map
+     */
+    @Nonnull Map<String, String> getOverrideMap();
+    
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationOverrideProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationOverrideProvider.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationPersistenceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationPersistenceProvider.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationPersistenceProvider.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationPersistenceProvider.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,60 @@
+/*
+ * 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.config.spi;
+
+import java.util.Map;
+
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.PersistenceException;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Provides configuration persistence implementations.
+ */
+@ConsumerType
+public interface ConfigurationPersistenceProvider {
+
+    /**
+     * Get all configuration values stored for a context path.
+     * @param resolver Resource resolver
+     * @param contextPath Context path
+     * @param configNames If a set of config names is given only configuration for these names is returned.
+     *      Otherwise all are returned.
+     * @return Configuration names with value map containing the configuration set properties.
+     *      Returns null if no parameters stored for this context paths, allowing other 
+     *      persistence providers to step in.
+     */
+    Map<String, Map<String, Object>> get(@Nonnull ResourceResolver resolver, @Nonnull String contextPath, String... configNames);
+
+    /**
+     * Writes configuration values for a context paths. For each configuration name contained in the values map all existing 
+     * parameter values are erased before writing the new ones.
+     * @param resolver Resource resolver
+     * @param contextPath Context path
+     * @param values Configuration names with value map containing the configuration set properties.
+     * @return true if configurations are accepted. false if this provider does not accept storing 
+     *          the configurations and the next provider should be asked to store them.
+     * @throws PersistenceException Persistence exception is thrown when storing configurations failed.
+     */
+    boolean store(@Nonnull ResourceResolver resolver, @Nonnull String contextPath, @Nonnull String configName,
+            @Nonnull Map<String, Map<String, Object>> values) throws PersistenceException;
+
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationPersistenceProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ConfigurationPersistenceProvider.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ContextPathStrategy.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ContextPathStrategy.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ContextPathStrategy.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ContextPathStrategy.java Fri Jul 29 12:19:18 2016
@@ -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.
+ */
+package org.apache.sling.config.spi;
+
+import java.util.Collection;
+
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.Resource;
+import org.osgi.annotation.versioning.ConsumerType;
+
+/**
+ * Allows application to define a strategy to find context paths for content paths.
+ * Each context path may have it's own context-specific configuration.
+ */
+@ConsumerType
+public interface ContextPathStrategy {
+
+    /**
+     * Finds context paths for the given context resource.
+     * @param resource Context resource
+     * @return Context paths that where detected in the given path
+     *      (in order of closest matching first).
+     *      If none are found an empty list is returned.
+     */
+    @Nonnull Collection<String> findContextPaths(@Nonnull Resource resource);
+
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ContextPathStrategy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/ContextPathStrategy.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/AbstractConfigurationPart.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/AbstractConfigurationPart.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/AbstractConfigurationPart.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/AbstractConfigurationPart.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,65 @@
+/*
+ * 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.config.spi.metadata;
+
+import java.util.HashMap;
+
+import javax.annotation.Nonnull;
+
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.api.wrappers.ValueMapDecorator;
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Defines a configuration set.
+ */
+@ProviderType
+abstract class AbstractConfigurationPart implements ConfigurationPart {
+
+    private final String name;
+    private final ValueMap properties = new ValueMapDecorator(new HashMap<String, Object>());
+
+    public AbstractConfigurationPart(@Nonnull String name) {
+        if (name == null || !ConfigurationPart.NAME_PATTERN.matcher(name).matches()) {
+            throw new IllegalArgumentException("Invalid name: " + name);
+        }
+        this.name = name;
+    }
+    
+    /**
+     * @return Parameter name
+     */
+    public @Nonnull String getName() {
+        return this.name;
+    }
+
+    /**
+     * @return Further properties for documentation and configuration of
+     *         behavior in configuration editor.
+     */
+    public @Nonnull ValueMap getProperties() {
+        return this.properties;
+    }
+    
+    @Override
+    public String toString() {
+        return this.name;
+    }
+
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/AbstractConfigurationPart.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/AbstractConfigurationPart.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationMetadata.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationMetadata.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationMetadata.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationMetadata.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,73 @@
+/*
+ * 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.config.spi.metadata;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.annotation.Nonnull;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Defines a configuration set.
+ */
+@ProviderType
+public final class ConfigurationMetadata extends AbstractConfigurationPart {
+
+    private boolean isList;
+    private final List<ConfigurationPart> parts = new ArrayList<>();
+
+    /**
+     * @param name Configuration name
+     */
+    public ConfigurationMetadata(@Nonnull String name) {
+        super(name);
+    }
+    
+    /**
+     * @return true if configuration is singleton
+     */
+    public boolean isSingleton() {
+        return !isList;
+    }
+    
+    /**
+     * @return true if configuration is list
+     */
+    public boolean isList() {
+        return isList;
+    }
+
+    /**
+     * @param isList true if configuration is list
+     */
+    public void setList(boolean isList) {
+        this.isList = isList;
+    }
+
+    /**
+     * @return Configuration set parts
+     */
+    public @Nonnull Collection<ConfigurationPart> getParts() {
+        return this.parts;
+    }
+
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationMetadata.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationMetadata.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationPart.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationPart.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationPart.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationPart.java Fri Jul 29 12:19:18 2016
@@ -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.
+ */
+package org.apache.sling.config.spi.metadata;
+
+import java.util.regex.Pattern;
+
+import javax.annotation.Nonnull;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Part of configuration set.
+ */
+@ProviderType
+public interface ConfigurationPart {
+
+    /**
+     * Pattern for allowed configuration part names.
+     */
+    Pattern NAME_PATTERN = Pattern.compile("^[a-zA-Z0-9\\-\\_\\.]+(/[a-zA-Z0-9\\-\\_\\.]+)*$");
+    
+    /**
+     * Configuration part name
+     * @return
+     */
+    @Nonnull String getName();
+    
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationPart.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/ConfigurationPart.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/PropertyMetadata.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/PropertyMetadata.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/PropertyMetadata.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/PropertyMetadata.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,86 @@
+/*
+ * 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.config.spi.metadata;
+
+import javax.annotation.Nonnull;
+
+import org.osgi.annotation.versioning.ProviderType;
+
+/**
+ * Defines a configuration property.
+ * @param <T> Property value type
+ */
+@ProviderType
+public final class PropertyMetadata<T> extends AbstractConfigurationPart {
+
+    private static final Class<?>[] SUPPORTED_TYPES = {
+        String.class, String[].class,
+        Integer.class, Integer[].class,
+        Long.class, Long[].class,
+        Double.class, Double[].class,
+        Boolean.class, Boolean[].class
+    };
+    
+    private final Class<T> type;
+    private T defaultValue;
+
+    public PropertyMetadata(@Nonnull String name, @Nonnull Class<T> type) {
+        super(name);
+        if (type == null || !isSupportedType(type)) {
+            throw new IllegalArgumentException("Invalid parameter type: " + type);
+        }
+        this.type = type;
+    }
+    
+    private boolean isSupportedType(Class<T> paramType) {
+        for (Class<?> type : SUPPORTED_TYPES) {
+            if (type.equals(paramType)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * @return Parameter type
+     */
+    public @Nonnull Class<T> getType() {
+        return this.type;
+    }
+
+    /**
+     * @return Default value if parameter is not set for configuration
+     */
+    public T getDefaultValue() {
+        return this.defaultValue;
+    }
+    
+    /**
+     * @param value Default value if parameter is not set for configuration
+     */
+    public void setDefaultValue(T value) {
+        this.defaultValue = value;
+    }
+
+    @Override
+    public String toString() {
+        return getName() + "[" + this.type.getSimpleName() + "]";
+    }
+
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/PropertyMetadata.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/PropertyMetadata.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/package-info.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/package-info.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/package-info.java Fri Jul 29 12:19:18 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.
+ */
+/**
+ * Defining configuration and parameter metadata for the SPI.
+ */
+@org.osgi.annotation.versioning.Version("1.0.0")
+package org.apache.sling.config.spi.metadata;

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/metadata/package-info.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/package-info.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/package-info.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/package-info.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/package-info.java Fri Jul 29 12:19:18 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.
+ */
+/**
+ * SPI for applications hooking into the configuration infrastructure for parameterizing and customizing.
+ */
+@org.osgi.annotation.versioning.Version("1.0.0")
+package org.apache.sling.config.spi;

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/main/java/org/apache/sling/config/spi/package-info.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/ConfigurationMetadataTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/ConfigurationMetadataTest.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/ConfigurationMetadataTest.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/ConfigurationMetadataTest.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,60 @@
+/*
+ * 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.config.spi.metadata;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+public class ConfigurationMetadataTest {
+
+    @Test
+    public void testSimple() {
+        ConfigurationMetadata underTest = new ConfigurationMetadata("hier1/set1");
+        assertEquals("hier1/set1", underTest.getName());
+        assertTrue(underTest.isSingleton());
+        assertFalse(underTest.isList());
+        
+        underTest.getProperties().put("p1", "v1");
+        assertEquals("v1", underTest.getProperties().get("p1", String.class));
+        
+        underTest.getParts().add(new PropertyMetadata<String>("param1", String.class));
+        underTest.getParts().add(new PropertyMetadata<Integer>("param2", Integer.class));
+        underTest.getParts().add(new ConfigurationMetadata("set1"));
+        
+        assertEquals(3, underTest.getParts().size());
+    }
+
+    @Test
+    public void testList() {
+        ConfigurationMetadata underTest = new ConfigurationMetadata("hier1/set1");
+        underTest.setList(true);
+        assertEquals("hier1/set1", underTest.getName());
+        assertFalse(underTest.isSingleton());
+        assertTrue(underTest.isList());
+    }
+    
+    @Test(expected = IllegalArgumentException.class)
+    public void testInvalidName() {
+        new ConfigurationMetadata("$illegal name");
+    }
+
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/ConfigurationMetadataTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/ConfigurationMetadataTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/PropertyMetadataTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/PropertyMetadataTest.java?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/PropertyMetadataTest.java (added)
+++ sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/PropertyMetadataTest.java Fri Jul 29 12:19:18 2016
@@ -0,0 +1,52 @@
+/*
+ * 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.config.spi.metadata;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import org.junit.Test;
+
+public class PropertyMetadataTest {
+
+    @Test
+    public void testValid() {
+        PropertyMetadata<String> underTest = new PropertyMetadata<String>("testParam", String.class);
+        assertEquals("testParam", underTest.getName());
+        assertEquals(String.class, underTest.getType());
+        assertNull(underTest.getDefaultValue());
+        
+        underTest.getProperties().put("p1", "v1");
+        assertEquals("v1", underTest.getProperties().get("p1", String.class));
+
+        underTest.setDefaultValue("defValue");
+        assertEquals("defValue", underTest.getDefaultValue());
+    }
+    
+    @Test(expected = IllegalArgumentException.class)
+    public void testInvalidName() {
+        new PropertyMetadata<String>("$illegal name", String.class);
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testInvalidType() {
+        new PropertyMetadata<Object>("testParam", Object.class);
+    }
+
+}

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/PropertyMetadataTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/api/src/test/java/org/apache/sling/config/spi/metadata/PropertyMetadataTest.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision rev url

Added: sling/trunk/contrib/extensions/context-aware-config/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/context-aware-config/pom.xml?rev=1754502&view=auto
==============================================================================
--- sling/trunk/contrib/extensions/context-aware-config/pom.xml (added)
+++ sling/trunk/contrib/extensions/context-aware-config/pom.xml Fri Jul 29 12:19:18 2016
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+  
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>27</version>
+        <relativePath/>
+    </parent>
+  
+    <artifactId>org.apache.sling.context-aware-config.reactor</artifactId>
+    <packaging>pom</packaging>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>Apache Sling Context-Aware-Configuration Reactor</name>
+    <description>Sling context-aware configuration handling</description>
+  
+    <scm>
+        <connection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/context-aware-config</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/context-aware-config</developerConnection>
+        <url>https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/context-aware-config</url>
+    </scm>
+    
+    <modules>
+        <module>api</module>
+        <!--
+        <module>impl</module>
+        <module>integration-tests</module>
+        -->
+    </modules>
+
+</project>

Propchange: sling/trunk/contrib/extensions/context-aware-config/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/contrib/extensions/context-aware-config/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message