Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Apr 19, 2023
2 parents 52fe5a3 + b7c4354 commit 545cb21
Show file tree
Hide file tree
Showing 20 changed files with 80 additions and 73 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [8, 11, 17]
java: [11, 17]
os: [ubuntu-latest]
distribution: [temurin]

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Deploy snapshots to Sonatpe OSS repository and deploy site to GitHub Pages
# Deploy snapshots to Sonatype OSS repository and deploy site to GitHub Pages

name: Deploy

Expand All @@ -15,19 +15,19 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Configure GIT
run: |
git config --global user.email "${{ secrets.GH_SITE_DEPLOY_EMAIL }}"
git config --global user.name "${{ secrets.GH_SITE_DEPLOY_NAME }}"
- name: Setup JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
cache: 'maven'
java-version: 11
cache: maven

- name: Build, verify, deploy, generate site
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-from-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
with:
body: 'Changes: https://wcm.io/caconfig/extensions/changes-report.html'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<img src="https://wcm.io/images/favicon-16@2x.png"/> Context-Aware Configuration Extensions for AEM
======
[![Build](https://github.com/wcm-io/io.wcm.caconfig.extensions/workflows/Build/badge.svg?branch=develop)](https://github.com/wcm-io/io.wcm.caconfig.extensions/actions?query=workflow%3ABuild+branch%3Adevelop)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.wcm/io.wcm.caconfig.extensions/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.wcm/io.wcm.caconfig.extensions)
[![Maven Central](https://img.shields.io/maven-central/v/io.wcm/io.wcm.caconfig.extensions)](https://repo1.maven.org/maven2/io/wcm/io.wcm.caconfig.extensions/)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=wcm-io_io.wcm.caconfig.extensions&metric=coverage)](https://sonarcloud.io/summary/new_code?id=wcm-io_io.wcm.caconfig.extensions)

AEM-specific extensions for Apache Sling Context-Aware Configuration.

Documentation: https://wcm.io/caconfig/extensions/<br/>
Issues: https://wcm-io.atlassian.net/browse/WCON<br/>
Issues: https://github.com/wcm-io/io.wcm.caconfig.extensions/issues<br/>
Wiki: https://wcm-io.atlassian.net/wiki/<br/>
Continuous Integration: https://github.com/wcm-io/io.wcm.caconfig.extensions/actions<br/>
Commercial support: https://wcm.io/commercial-support.html
Expand Down
12 changes: 12 additions & 0 deletions changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
<body>

<release version="1.9.2" date="2023-04-19">
<action type="update" dev="sseifert">
Switch to Java 11 as minimum version.
</action>
<action type="update" dev="sseifert">
Switch to AEM 6.5.7 as minimum version.
</action>
<action type="update" dev="sseifert">
Eliminate dependency to Guava.
</action>
</release>

<release version="1.9.0" date="2022-01-27">
<action type="add" dev="sseifert" issue="WCON-75"><![CDATA[
Add AEM implementation ConfigurationInjectResourceDetectionStrategy to support correct injection of configurations in HTL and Sling Models in editable template structure components.<br/>
Expand Down
9 changes: 4 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<parent>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.parent_toplevel</artifactId>
<version>2.0.0</version>
<version>2.2.0</version>
<relativePath/>
</parent>

<groupId>io.wcm</groupId>
<artifactId>io.wcm.caconfig.extensions</artifactId>
<version>1.9.0</version>
<version>1.9.2</version>
<packaging>jar</packaging>

<name>Context-Aware Configuration Extensions for AEM</name>
Expand All @@ -49,7 +49,7 @@
<site.url.module.prefix>caconfig/extensions</site.url.module.prefix>

<!-- Enable reproducible builds -->
<project.build.outputTimestamp>2022-01-27T10:34:40Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2023-04-19T11:03:09Z</project.build.outputTimestamp>
</properties>

<dependencies>
Expand Down Expand Up @@ -160,7 +160,7 @@
<dependency>
<groupId>io.wcm</groupId>
<artifactId>io.wcm.testing.aem-mock.junit5</artifactId>
<version>4.1.8</version>
<version>5.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -179,7 +179,6 @@
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<classifier>apis</classifier>
<scope>provided</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class AbsoluteParentContextPathStrategy implements ContextPathStrategy {

@ObjectClassDefinition(name = "wcm.io Context-Aware Configuration Context Path Strategy: Absolute Parents",
description = "Detects context paths by absolute parent levels of a context resource.")
static @interface Config {
@interface Config {

@AttributeDefinition(name = "Absolute Levels",
description = "List of absolute parent levels. Example: Absolute parent level 1 of '/foo/bar/test' is '/foo/bar'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import com.day.cq.wcm.api.Page;
import com.day.cq.wcm.api.PageManager;
import com.day.cq.wcm.api.PageManagerFactory;
import com.google.common.collect.ImmutableSet;

import io.wcm.wcm.commons.util.Path;

Expand All @@ -62,7 +61,7 @@ public class RootTemplateContextPathStrategy implements ContextPathStrategy {
@ObjectClassDefinition(name = "wcm.io Context-Aware Configuration Context Path Strategy: Root Templates",
description = "Detects context paths by matching parent pages against a list of allowed templates for context root. "
+ "All page between min and max level up to a page with a page matching the templates are defined as context paths.")
static @interface Config {
@interface Config {

@AttributeDefinition(name = "Templates",
description = "List of template paths allowed for context root pages.",
Expand Down Expand Up @@ -117,7 +116,7 @@ public class RootTemplateContextPathStrategy implements ContextPathStrategy {

@Activate
void activate(Config config) {
templatePaths = config.templatePaths() != null ? ImmutableSet.copyOf(config.templatePaths()) : Collections.<String>emptySet();
templatePaths = config.templatePaths() != null ? Set.of(config.templatePaths()) : Collections.<String>emptySet();
templatMatchAllLevels = config.templateMatchAllLevels();
minLevel = config.minLevel();
maxLevel = config.maxLevel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;

Expand All @@ -36,8 +37,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.ImmutableList;

import io.wcm.sling.commons.request.RequestContext;

/**
Expand All @@ -49,7 +48,7 @@ public final class RequestHeaderConfigurationOverrideProvider implements Configu

@ObjectClassDefinition(name = "wcm.io Context-Aware Configuration Override Provider: Request Header",
description = "Allows to define configuration property default values or overrides from inconming request headers.")
static @interface Config {
@interface Config {

@AttributeDefinition(name = "Enabled",
description = "Enable this override provider.")
Expand Down Expand Up @@ -85,7 +84,7 @@ public final class RequestHeaderConfigurationOverrideProvider implements Configu
log.warn("RequestContext service not running - unable to inspect current request.");
}
}
return ImmutableList.<String>of();
return Collections.emptyList();
}

private Collection<String> buildMapFromHeaders(SlingHttpServletRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class PagePersistenceStrategy implements ConfigurationPersistenceStrategy

@ObjectClassDefinition(name = "wcm.io Context-Aware Configuration Persistence Strategy: AEM Page",
description = "Stores Context-Aware Configuration in AEM pages instead of simple resources.")
static @interface Config {
@interface Config {

@AttributeDefinition(name = "Enabled",
description = "Enable this persistence strategy.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public class ToolsConfigPagePersistenceStrategy implements ConfigurationPersiste

@ObjectClassDefinition(name = "wcm.io Context-Aware Configuration Persistence Strategy: Tools Config Page",
description = "Stores Context-Aware Configuration in a single AEM content page at /tools/config.")
static @interface Config {
@interface Config {

@AttributeDefinition(name = "Enabled",
description = "Enable this persistence strategy.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public class ConfigurationReferenceProvider implements ReferenceProvider {

@ObjectClassDefinition(name = "wcm.io Context-Aware Configuration Reference Provider",
description = "Allows to resolve references from resources to their Context-Aware configurations, for example during page activation.")
static @interface Config {
@interface Config {

@AttributeDefinition(name = "Enabled",
description = "Enable this reference provider.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class CoreCompReferenceProviderDisabler implements EventHandler {
@ObjectClassDefinition(name = "wcm.io Context-Aware Configuration Reference Provider Core Component Disabler",
description = "Disables the context-aware configuration reference provider from Adobe Core Components, which "
+ "does not reliably detect the last modification date of configuration stored in AEM pages.")
static @interface Config {
@interface Config {

@AttributeDefinition(name = "Enabled",
description = "Enable to automatic disable the reference provider from Core Components.")
Expand Down
5 changes: 3 additions & 2 deletions src/site/markdown/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

AEM-specific extensions for Apache Sling Context-Aware Configuration.

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.wcm/io.wcm.caconfig.extensions/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.wcm/io.wcm.caconfig.extensions)
[![Maven Central](https://img.shields.io/maven-central/v/io.wcm/io.wcm.caconfig.extensions)](https://repo1.maven.org/maven2/io/wcm/io.wcm.caconfig.extensions/)


### Documentation
Expand Down Expand Up @@ -34,7 +34,8 @@ See [Deploy and configure Context-Aware Configuration in AEM][deploy-configure-c

|Context-Aware Configuration Extensions for AEM version |AEM version supported
|-------------------------------------------------------|----------------------
|1.9.x or higher |AEM 6.5+, AEMaaCS
|1.9.2 or higher |AEM 6.5.7+, AEMaaCS
|1.9.0 |AEM 6.5+, AEMaaCS
|1.8.x |AEM 6.4+, AEMaaCS
|1.7.x |AEM 6.3+
|1.6.x |AEM 6.2+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@
import java.util.Iterator;
import java.util.List;

import org.apache.commons.collections4.IteratorUtils;
import org.apache.sling.caconfig.resource.spi.ContextResource;

import com.google.common.collect.ImmutableList;

import io.wcm.testing.mock.aem.junit5.AemContext;
import io.wcm.wcm.commons.util.Path;

Expand All @@ -45,7 +44,7 @@ public static void assertResult(AemContext context, Iterator<ContextResource> re
if (paths.length % 2 != 0) {
throw new IllegalArgumentException("Expected path pairs.");
}
List<ContextResource> resultList = ImmutableList.copyOf(result);
List<ContextResource> resultList = IteratorUtils.toList(result);
int expectedSize = paths.length / 2;
assertEquals(expectedSize, resultList.size(), "Number of paths");
for (int i = 0; i < expectedSize / 2; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

import io.wcm.sling.commons.request.RequestContext;
import io.wcm.sling.models.injectors.impl.AemObjectInjector;
import io.wcm.sling.models.injectors.impl.ModelsImplConfiguration;
Expand All @@ -50,7 +50,7 @@ class RequestHeaderConfigurationOverrideProviderTest {

// register sling models extensions
aemContext.registerInjectActivateService(new ModelsImplConfiguration(),
ImmutableMap.<String, Object>of("requestThreadLocal", true));
Map.<String, Object>of("requestThreadLocal", true));

aemContext.registerInjectActivateService(new AemObjectInjector());
aemContext.registerInjectActivateService(new SlingObjectOverlayInjector());
Expand All @@ -73,7 +73,7 @@ void testEnabled() {
"enabled", true,
"headerName", HEADER_NAME);

assertEquals(ImmutableList.of(
assertEquals(List.of(
"param1=value1",
"[/content/path1]param2=value2"),
provider.getOverrideStrings());
Expand Down
Loading

0 comments on commit 545cb21

Please sign in to comment.