Skip to content

Commit

Permalink
Merge pull request #546 from exadel-inc/release/2.5.3
Browse files Browse the repository at this point in the history
[Tech] Merge release-2.5.3 branch to master
  • Loading branch information
smiakchilo authored Aug 30, 2024
2 parents f2de770 + f406094 commit fc285f3
Show file tree
Hide file tree
Showing 19 changed files with 94 additions and 39 deletions.
4 changes: 2 additions & 2 deletions all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
<parent>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-authoring-kit</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</parent>

<artifactId>etoolbox-authoring-kit-all</artifactId>

<name>Exadel Toolbox Authoring Kit - Cumulative Package</name>
<description>All-in-one content package for the ui.apps and ui.content modules of Exadel Toolbox Authoring Kit</description>
<description>All-in-one content package of Exadel Toolbox Authoring Kit</description>

<packaging>content-package</packaging>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-authoring-kit</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</parent>

<artifactId>etoolbox-authoring-kit-core</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions docs/content/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ seoTitle: Installation - Exadel Authoring Kit
<dependency>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-authoring-kit-core</artifactId>
<version>2.5.2</version> <!-- Prefer the latest stable version whenever possible -->
<version>2.5.3</version> <!-- Prefer the latest stable version whenever possible -->
<scope>provided</scope> <!-- Do not use compile or runtime scope!-->
</dependency>
```
Expand All @@ -21,7 +21,7 @@ seoTitle: Installation - Exadel Authoring Kit
<plugin>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-authoring-kit-plugin</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -79,7 +79,7 @@ You need to do two steps.
<dependency>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-authoring-kit-all</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
<type>content-package</type>
</dependency>
```
Expand Down
4 changes: 2 additions & 2 deletions docs/website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion it.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-authoring-kit</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</parent>

<artifactId>etoolbox-authoring-kit-it.tests</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-authoring-kit</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</parent>

<artifactId>etoolbox-authoring-kit-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.ConfigurationContainer;
import org.apache.maven.model.Plugin;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
Expand Down Expand Up @@ -218,7 +219,7 @@ private List<String> getClasspathElements() throws MojoExecutionException {
}

/**
* Scans the module structure of the current Maven installation to retrieve the ToolKit's plugin configurations and
* Scans the module structure of the current Maven setup to retrieve the ToolKit's plugin configurations and
* stores the matches between AEM component Java packages and repository paths. The references are passed to the
* {@link PluginSettings} builder
* @param builder {@link PluginSettings.Builder} instance
Expand All @@ -232,27 +233,46 @@ private void populateReferenceEntries(PluginSettings.Builder builder) {
.collect(Collectors.toList());

for (MavenProject contentPackage : contentPackages) {
Xpp3Dom pluginConfig = contentPackage
Plugin pluginDefinition = contentPackage
.getBuildPlugins()
.stream()
.filter(plugin -> PLUGIN_ARTIFACT_ID.equals(plugin.getArtifactId()))
.map(ConfigurationContainer::getConfiguration)
.map(Xpp3Dom.class::cast)
.findFirst()
.orElse(null);
if (pluginConfig == null) {
if (pluginDefinition == null) {
continue;
}
String pathBase = Optional.ofNullable(pluginConfig.getChild(CONFIG_KEY_PATH_BASE))
.map(Xpp3Dom::getValue)
.orElse(null);
String referenceBase = Optional.ofNullable(pluginConfig.getChild(CONFIG_KEY_REFERENCE_BASE))
.map(Xpp3Dom::getValue)
.orElse(null);
builder.referenceEntry(pathBase, referenceBase);
Optional.ofNullable(pluginDefinition.getConfiguration())
.filter(Xpp3Dom.class::isInstance)
.map(Xpp3Dom.class::cast)
.ifPresent(config -> populateReferenceEntry(config, builder));
pluginDefinition
.getExecutions()
.stream()
.map(ConfigurationContainer::getConfiguration)
.filter(Xpp3Dom.class::isInstance)
.map(Xpp3Dom.class::cast)
.forEach(config -> populateReferenceEntry(config, builder));
}
}

/**
* Extracts the path and reference base from the provided configuration and passes them to the
* {@link PluginSettings} builder
* @param config A {@link Xpp3Dom} object representing a configuration of the ToolKit's plugin or one of its
* executions
* @param builder {@link PluginSettings.Builder} instance
*/
private void populateReferenceEntry(Xpp3Dom config, PluginSettings.Builder builder) {
String pathBase = Optional.ofNullable(config.getChild(CONFIG_KEY_PATH_BASE))
.map(Xpp3Dom::getValue)
.orElse(null);
String referenceBase = Optional.ofNullable(config.getChild(CONFIG_KEY_REFERENCE_BASE))
.map(Xpp3Dom::getValue)
.orElse(null);
builder.referenceEntry(pathBase, referenceBase);
}

/**
* Transfers to the main logger a line retrieved from the secondary Maven process
* @param logger A logging method such as {@code .info()} or {@code .error()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
*/
package com.exadel.aem.toolkit.plugin.maven;

import java.util.ArrayList;
import java.util.List;
import java.util.LinkedHashSet;
import java.util.Set;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import com.exadel.aem.toolkit.plugin.exceptions.handlers.ExceptionHandlers;
import com.exadel.aem.toolkit.plugin.utils.ClassUtil;
Expand All @@ -29,9 +31,12 @@ public class PluginSettings {

public static final PluginSettings EMPTY = new PluginSettings();

private static final int HASH_SEED = 7;
private static final int HASH_FACTOR = 31;

private String defaultPathBase;

private List<ReferenceEntry> referenceEntries;
private Set<ReferenceEntry> referenceEntries;

private String terminateOn;

Expand Down Expand Up @@ -78,7 +83,7 @@ public String getTerminateOnRule() {
* Initializes a {@code Builder} instance used to populate a {@link PluginSettings} object with values
* @return {@code Builder} object
*/
public static Builder builder() {
static Builder builder() {
return new Builder();
}

Expand All @@ -87,7 +92,7 @@ public static Builder builder() {
*/
static class Builder {
private String pathBase;
private List<ReferenceEntry> referenceEntries;
private Set<ReferenceEntry> referenceEntries;
private String terminateOn;

/**
Expand All @@ -110,12 +115,13 @@ public Builder defaultPathBase(String value) {
* @return This instance
* @see PluginSettings#getPathBase(Class)
*/
@SuppressWarnings("UnusedReturnValue")
public Builder referenceEntry(String pathValue, String referenceValue) {
if (StringUtils.isAnyBlank(pathValue, referenceValue)) {
return this;
}
if (referenceEntries == null) {
referenceEntries = new ArrayList<>();
referenceEntries = new LinkedHashSet<>();
}
referenceEntries.add(new ReferenceEntry(pathValue, referenceValue));
return this;
Expand Down Expand Up @@ -179,5 +185,31 @@ public String getPathBase() {
public boolean matches(Class<?> component) {
return ClassUtil.matchesReference(component, referenceBase);
}

/**
* Compares the current instance with another object
* @param other Another object
* @return True if the objects are equal, false otherwise
*/
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other == null || getClass() != other.getClass()) {
return false;
}
ReferenceEntry that = (ReferenceEntry) other;
return new EqualsBuilder().append(pathBase, that.pathBase).append(referenceBase, that.referenceBase).isEquals();
}

/**
* Calculates the hash code of the current instance
* @return Integer value
*/
@Override
public int hashCode() {
return new HashCodeBuilder(HASH_SEED, HASH_FACTOR).append(pathBase).append(referenceBase).toHashCode();
}
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-authoring-kit</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>

<name>Exadel Toolbox Authoring Kit</name>
<description>Automates generating and managing rich and responsive authoring interfaces for Adobe Experience Manager</description>
Expand Down
4 changes: 2 additions & 2 deletions ui.apps/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui.apps/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "depends-on",
"description": "A clientlib that executes defined action on dependent fields",
"version": "2.5.2",
"version": "2.5.3",
"private": true,
"devDependencies": {
"eslint": "^8.45.0",
Expand Down
2 changes: 1 addition & 1 deletion ui.apps/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-authoring-kit</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</parent>

<artifactId>etoolbox-authoring-kit-ui.apps</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
jcr:primaryType="cq:ClientLibraryFolder"
categories="[eak.coral-overlay]"
dependencies="[granite.jquery, granite.utils, cq.authoring.dialog.rte.coralui3]"
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015,compilationLevel=advanced,languageOut=ECMASCRIPT5]"
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015;compilationLevel=advanced;languageOut=ECMASCRIPT5]"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
jcr:primaryType="cq:ClientLibraryFolder"
categories="[cq.authoring.dependson,eak.dependson]"
dependencies="[eak.utils]"
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015,compilationLevel=advanced,languageOut=ECMASCRIPT5]"
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015;compilationLevel=advanced;languageOut=ECMASCRIPT5]"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
visibility: function ($el, state) {
$el.find(DATEPICKER_INPUT_SELECTOR).attr('readonly', state ? null : '');
ns.ElementAccessors.DEFAULT_ACCESSOR.visibility($el, state);
},
set: function ($el, value) {
$el.prop('value', new Date(value));
}
});
})(Granite.$, Granite.DependsOnPlugin = (Granite.DependsOnPlugin || {}));
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
jcr:primaryType="cq:ClientLibraryFolder"
allowProxy="{Boolean}true"
categories="[eak.lists.item-dialog]"
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015,compilationLevel=advanced,languageOut=ECMASCRIPT5]"/>
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015;compilationLevel=advanced;languageOut=ECMASCRIPT5]"/>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
jcr:primaryType="cq:ClientLibraryFolder"
categories="[eak.policies]"
dependencies="[eak.utils]"
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015,compilationLevel=advanced,languageOut=ECMASCRIPT5]"
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015;compilationLevel=advanced;languageOut=ECMASCRIPT5]"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
jcr:primaryType="cq:ClientLibraryFolder"
categories="[eak.utils]"
dependencies="[granite.jquery,granite.utils]"
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015,compilationLevel=advanced,languageOut=ECMASCRIPT5]"
jsProcessor="[min:gcc;languageIn=ECMASCRIPT_2015;compilationLevel=advanced;languageOut=ECMASCRIPT5]"
/>
2 changes: 1 addition & 1 deletion ui.content/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-authoring-kit</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</parent>

<artifactId>etoolbox-authoring-kit-ui.content</artifactId>
Expand Down

0 comments on commit fc285f3

Please sign in to comment.