Skip to content

Commit

Permalink
Merge pull request #515 from exadel-inc/release-2.5.1
Browse files Browse the repository at this point in the history
[Tech] Merged release-2.5.1 branch to master
  • Loading branch information
smiakchilo authored Feb 12, 2024
2 parents cf63b40 + 3818865 commit bc18e28
Show file tree
Hide file tree
Showing 21 changed files with 83 additions and 30 deletions.
8 changes: 4 additions & 4 deletions all/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.0</version>
<version>2.5.1</version>
</parent>

<artifactId>etoolbox-authoring-kit-all</artifactId>
Expand Down Expand Up @@ -66,13 +66,13 @@
<excludeDefaultDirectories>true</excludeDefaultDirectories>
<filesets>
<fileset>
<directory>${basedir}/src/main/content/jcr_root/etc/packages/${project.groupId}/${project.parent.artifactId}</directory>
<directory>${basedir}/src/main/content/jcr_root/etc/packages/${project.groupId}</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>.snapshot</exclude>
<exclude>.snapshot/.keep</exclude>
<exclude>${project.parent.artifactId}/.snapshot</exclude>
<exclude>${project.parent.artifactId}/.snapshot/.keep</exclude>
</excludes>
</fileset>
</filesets>
Expand Down
5 changes: 2 additions & 3 deletions all/src/main/content/META-INF/vault/filter.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<!-- The following filters clear old directories in JCR. They can be removed after v.2 release -->
<filter root="/etc/packages/authoring-toolkit"/>
<filter root="/etc/packages/aem-authoring-toolkit"/>
<!-- The following filters clear irrelevant directories in JCR -->
<filter root="/etc/packages/com.exadel.etoolbox/etoolbox-authoring-kit-plus"/>
</workspaceFilter>
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.0</version>
<version>2.5.1</version>
</parent>

<artifactId>etoolbox-authoring-kit-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import java.lang.annotation.Target;

import com.exadel.aem.toolkit.api.annotations.meta.AnnotationRendering;
import com.exadel.aem.toolkit.api.annotations.meta.ValueRestriction;
import com.exadel.aem.toolkit.api.annotations.meta.ValueRestrictions;

/**
* Defines a target for a drag-and-drop operation in Granite UI. Upon processing this annotation, a {@code
Expand Down Expand Up @@ -46,11 +48,13 @@
* Maps to the {@code propertyName} attribute of {@code cq:editConfig/cq:dropTargets/<targetName>} node
* @return Non-blank string
*/
@ValueRestriction(ValueRestrictions.NOT_BLANK)
String propertyName();

/**
* Used to specify tag name of the current {@code cq:editConfig/cq:dropTargets} subnode
* @return Non-blank string
*/
@ValueRestriction(ValueRestrictions.NOT_BLANK)
String nodeName();
}
8 changes: 4 additions & 4 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.0</version> <!-- Prefer the latest stable version whenever possible -->
<version>2.5.1</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.0</version>
<version>2.5.1</version>
<executions>
<execution>
<goals>
Expand All @@ -32,7 +32,7 @@ seoTitle: Installation - Exadel Authoring Kit
<configuration>
<!-- RECOMMENDED: Place here the path to the node under which your component nodes are stored -->
<componentsPathBase>jcr_root/apps/acme/components</componentsPathBase>
<!-- RECOMMENDED: Specify root package for component classes that match the current package -->
<!-- RECOMMENDED: Specify root package for component classes that match the current package. Multiple values can be separated with a comma -->
<componentsReferenceBase>com.acme.project.components.*</componentsReferenceBase>
<!-- OPTIONAL: specify list of exceptions that would cause this plugin to terminate -->
<terminateOn>ALL</terminateOn>
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.0</version>
<version>2.5.1</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.0</version>
<version>2.5.1</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.0</version>
<version>2.5.1</version>
</parent>

<artifactId>etoolbox-authoring-kit-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@
import java.util.function.BiConsumer;
import java.util.stream.Collectors;

import org.apache.commons.lang3.StringUtils;

import com.exadel.aem.toolkit.api.annotations.editconfig.DropTargetConfig;
import com.exadel.aem.toolkit.api.annotations.editconfig.EditConfig;
import com.exadel.aem.toolkit.api.handlers.Source;
import com.exadel.aem.toolkit.api.handlers.Target;
import com.exadel.aem.toolkit.plugin.exceptions.ValidationException;
import com.exadel.aem.toolkit.plugin.maven.PluginRuntime;
import com.exadel.aem.toolkit.plugin.metadata.RenderingFilter;
import com.exadel.aem.toolkit.plugin.utils.DialogConstants;

Expand All @@ -31,6 +35,8 @@
*/
public class DropTargetsHandler implements BiConsumer<Source, Target> {

private static final String INVALID_NAME_MESSAGE = "Invalid drop target node name";

/**
* Processes data that can be extracted from the given {@code Source} and stores it into the provided {@code Target}
* @param source {@code Source} object used for data retrieval
Expand All @@ -45,6 +51,9 @@ public void accept(Source source, Target target) {
Target dropTargetsElement = target.getOrCreateTarget(DialogConstants.NN_DROP_TARGETS);
for (int i = 0; i < editConfig.dropTargets().length; i++) {
DropTargetConfig dropTargetConfig = editConfig.dropTargets()[i];
if (StringUtils.isBlank(dropTargetConfig.nodeName())) {
PluginRuntime.context().getExceptionHandler().handle(new ValidationException(INVALID_NAME_MESSAGE));
}
dropTargetsElement.getOrCreateTarget(dropTargetConfig.nodeName())
.attribute(DialogConstants.PN_PRIMARY_TYPE, DialogConstants.NT_DROP_TARGET_CONFIG)
.attributes(dropTargetConfig, new RenderingFilter(dropTargetConfig))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
*/
public class ReflectionContextHelper {

private static final char SEPARATOR_COMMA = ',';
private Reflections reflections;

private ClassLoader classLoader;
Expand Down Expand Up @@ -101,9 +102,10 @@ public ClassLoader getClassLoader() {
* @return A non-null list of {@code ComponentSource} objects; can be empty
*/
public List<ComponentSource> getComponents(String packageBase) {
String[] packageRoots = StringUtils.split(packageBase, SEPARATOR_COMMA);
return getComponents()
.stream()
.filter(comp -> StringUtils.isEmpty(packageBase) || ClassUtil.matchesReference(comp.adaptTo(Class.class), packageBase))
.filter(comp -> StringUtils.isEmpty(packageBase) || ClassUtil.matchesReference(comp.adaptTo(Class.class), packageRoots))
.collect(Collectors.toList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,20 @@ public void testDialogTitleMissing() {
ValidationException.class,
"Title property is missing for dialog");
}

@Test
public void testWrongDropTarget() {
pluginContext.testThrows(
ValidatorTestCases.InvalidDropTargetConfig.class,
ValidationException.class,
"Invalid drop target");
}

@Test
public void testWrongDropTarget2() {
pluginContext.testThrows(
ValidatorTestCases.InvalidDropTargetConfig2.class,
ValidationException.class,
"' ' provided");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import static com.exadel.aem.toolkit.plugin.maven.TestConstants.DEFAULT_COMPONENT_NAME;
import static com.exadel.aem.toolkit.plugin.maven.TestConstants.DEFAULT_COMPONENT_TITLE;

import com.exadel.aem.toolkit.api.annotations.editconfig.DropTargetConfig;
import com.exadel.aem.toolkit.api.annotations.editconfig.EditConfig;
import com.exadel.aem.toolkit.api.annotations.main.AemComponent;
import com.exadel.aem.toolkit.api.annotations.main.Dialog;
import com.exadel.aem.toolkit.api.annotations.main.HtmlTag;
Expand Down Expand Up @@ -114,4 +116,22 @@ public static class ComponentWithWrongHtmlTag1 {}
@Dialog
@HtmlTag(className = " ")
public static class ComponentWithWrongHtmlTag2 {}

@AemComponent(path = DEFAULT_COMPONENT_NAME, title = DEFAULT_COMPONENT_TITLE)
@EditConfig(
dropTargets = @DropTargetConfig(
nodeName = " ",
accept = {"image/*"},
groups = {"media"},
propertyName = ""))
public static class InvalidDropTargetConfig {}

@AemComponent(path = DEFAULT_COMPONENT_NAME, title = DEFAULT_COMPONENT_TITLE)
@EditConfig(
dropTargets = @DropTargetConfig(
nodeName = "image",
accept = {"image/*"},
groups = {"media"},
propertyName = " "))
public static class InvalidDropTargetConfig2 {}
}
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.0</version>
<version>2.5.1</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.0",
"version": "2.5.1",
"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.0</version>
<version>2.5.1</version>
</parent>

<artifactId>etoolbox-authoring-kit-ui.apps</artifactId>
Expand Down
4 changes: 0 additions & 4 deletions ui.apps/src/main/content/META-INF/vault/filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,4 @@
<exclude pattern="/apps/etoolbox-authoring-kit/fixes(/.*)?"/>
<exclude pattern="/apps/etoolbox-authoring-kit/samples(/.*)?"/>
</filter>

<!-- The following filters clear old directories in JCR content. They can be removed after v.2 release -->
<filter root="/apps/authoring-toolkit"/>
<filter root="/apps/cq/core/content/nav/tools/aembox/lists"/>
</workspaceFilter>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:Folder"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig"
org.apache.sling.commons.log.file="logs/eak.log"
org.apache.sling.commons.log.level="info"
org.apache.sling.commons.log.names="[com.exadel.aem.toolkit]"
org.apache.sling.commons.log.pattern="\{0,date,yyyy-MM-dd HH:mm:ss.SSS} {4} [{3}] {5}" />
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.0</version>
<version>2.5.1</version>
</parent>

<artifactId>etoolbox-authoring-kit-ui.content</artifactId>
Expand Down
3 changes: 0 additions & 3 deletions ui.content/src/main/content/META-INF/vault/filter.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<workspaceFilter version="1.0">
<filter root="/conf/etoolbox-authoring-kit"/>

<!-- The following filter clears an old directory in JCR content. This can be removed after v.2 release -->
<filter root="/conf/authoring-toolkit"/>
</workspaceFilter>

0 comments on commit bc18e28

Please sign in to comment.