From 9a41e7bac17602ee96de43b7ebe17979f10a7728 Mon Sep 17 00:00:00 2001 From: Stefan Seifert Date: Wed, 4 Dec 2024 13:52:10 +0100 Subject: [PATCH] cosmetic: update code formatting to latest checkstyle ruleset --- .../persistence/impl/PagePersistenceStrategy.java | 2 ++ .../references/impl/ConfigurationReferenceProvider.java | 7 ++++--- .../references/impl/CoreCompReferenceProviderDisabler.java | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PagePersistenceStrategy.java b/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PagePersistenceStrategy.java index 90551cf..0fe8320 100644 --- a/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PagePersistenceStrategy.java +++ b/src/main/java/io/wcm/caconfig/extensions/persistence/impl/PagePersistenceStrategy.java @@ -28,6 +28,7 @@ import static io.wcm.caconfig.extensions.persistence.impl.PersistenceUtils.ensureContainingPage; import static io.wcm.caconfig.extensions.persistence.impl.PersistenceUtils.ensurePageIfNotContainingPage; import static io.wcm.caconfig.extensions.persistence.impl.PersistenceUtils.getOrCreateResource; +import static io.wcm.caconfig.extensions.persistence.impl.PersistenceUtils.isItemModifiedOrNewlyAdded; import static io.wcm.caconfig.extensions.persistence.impl.PersistenceUtils.replaceProperties; import static io.wcm.caconfig.extensions.persistence.impl.PersistenceUtils.updatePageLastMod; @@ -56,6 +57,7 @@ /** * AEM-specific persistence strategy that has higher precedence than the default strategy from Sling, * but lower precedence that the persistence strategy that is part of AEM since version 6.3. + * *

* It supports reading configurations from cq:Page nodes in /conf, the configuration is read from the jcr:content child * node. Unlike the persistence strategy in AEM 6.3 this also supports writing configuration to /conf. diff --git a/src/main/java/io/wcm/caconfig/extensions/references/impl/ConfigurationReferenceProvider.java b/src/main/java/io/wcm/caconfig/extensions/references/impl/ConfigurationReferenceProvider.java index c2d0b7e..53a1466 100644 --- a/src/main/java/io/wcm/caconfig/extensions/references/impl/ConfigurationReferenceProvider.java +++ b/src/main/java/io/wcm/caconfig/extensions/references/impl/ConfigurationReferenceProvider.java @@ -55,15 +55,15 @@ import com.day.cq.wcm.api.reference.ReferenceProvider; /** - *

* This implementation of {@link ReferenceProvider} allows to resolve references of a given {@link Resource} to * context-aware configurations. - *

+ * *

* This is for example used by ActivationReferenceSearchServlet to resolve referenced content of pages during activation * of a page using AEM sites. Returning the configurations allows the editor to activate them along with the page * referring to them. *

+ * *

* This component can be disabled by configuration, but its enabled by default. *

@@ -130,7 +130,8 @@ public List findReferences(Resource reso Set configurationBuckets = new LinkedHashSet<>(configurationResourceResolverConfig.configBucketNames()); for (String configurationName : configurationMetadatas.keySet()) { - Iterator configurationInheritanceChain = configurationResourceResolvingStrategy.getResourceInheritanceChain(resource, configurationBuckets, configurationName); + Iterator configurationInheritanceChain = configurationResourceResolvingStrategy.getResourceInheritanceChain(resource, configurationBuckets, + configurationName); Map referencePages = new LinkedHashMap<>(); while (configurationInheritanceChain != null && configurationInheritanceChain.hasNext()) { diff --git a/src/main/java/io/wcm/caconfig/extensions/references/impl/CoreCompReferenceProviderDisabler.java b/src/main/java/io/wcm/caconfig/extensions/references/impl/CoreCompReferenceProviderDisabler.java index 82188f4..2557ca6 100644 --- a/src/main/java/io/wcm/caconfig/extensions/references/impl/CoreCompReferenceProviderDisabler.java +++ b/src/main/java/io/wcm/caconfig/extensions/references/impl/CoreCompReferenceProviderDisabler.java @@ -38,15 +38,18 @@ * to the core components. It implements a much simplified logic compared to {@link ConfigurationReferenceProvider} * and does not properly detect the last modification date if one of the wcm.io persistence strategies * is used which stores the configuration in AEM pages that can be properly activated. + * *

* To avoid conflicts with the two implementations trying to achieve the same, this services checks if * the Core Component reference provider is present, and deactivates it. *

+ * *

* Unfortunately there is no better way, as the Core Component reference provider does not support to be disabled via * OSGi configuration, and the AEM WCM Core implementation does not sort the reference providers by service ranking. * If both reference providers are active at the same time it's a matter of luck who "wins". *

+ * *

* The implementation of this service is heavily inspired by the "Component Disabler" of ACS AEM Commons. *