Skip to content

Commit bc18e28

Browse files
authored
Merge pull request #515 from exadel-inc/release-2.5.1
[Tech] Merged release-2.5.1 branch to master
2 parents cf63b40 + 3818865 commit bc18e28

File tree

21 files changed

+83
-30
lines changed

21 files changed

+83
-30
lines changed

all/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.exadel.etoolbox</groupId>
99
<artifactId>etoolbox-authoring-kit</artifactId>
10-
<version>2.5.0</version>
10+
<version>2.5.1</version>
1111
</parent>
1212

1313
<artifactId>etoolbox-authoring-kit-all</artifactId>
@@ -66,13 +66,13 @@
6666
<excludeDefaultDirectories>true</excludeDefaultDirectories>
6767
<filesets>
6868
<fileset>
69-
<directory>${basedir}/src/main/content/jcr_root/etc/packages/${project.groupId}/${project.parent.artifactId}</directory>
69+
<directory>${basedir}/src/main/content/jcr_root/etc/packages/${project.groupId}</directory>
7070
<includes>
7171
<include>**</include>
7272
</includes>
7373
<excludes>
74-
<exclude>.snapshot</exclude>
75-
<exclude>.snapshot/.keep</exclude>
74+
<exclude>${project.parent.artifactId}/.snapshot</exclude>
75+
<exclude>${project.parent.artifactId}/.snapshot/.keep</exclude>
7676
</excludes>
7777
</fileset>
7878
</filesets>
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<workspaceFilter version="1.0">
3-
<!-- The following filters clear old directories in JCR. They can be removed after v.2 release -->
4-
<filter root="/etc/packages/authoring-toolkit"/>
5-
<filter root="/etc/packages/aem-authoring-toolkit"/>
3+
<!-- The following filters clear irrelevant directories in JCR -->
4+
<filter root="/etc/packages/com.exadel.etoolbox/etoolbox-authoring-kit-plus"/>
65
</workspaceFilter>

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.exadel.etoolbox</groupId>
99
<artifactId>etoolbox-authoring-kit</artifactId>
10-
<version>2.5.0</version>
10+
<version>2.5.1</version>
1111
</parent>
1212

1313
<artifactId>etoolbox-authoring-kit-core</artifactId>

core/src/main/java/com/exadel/aem/toolkit/api/annotations/editconfig/DropTargetConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import java.lang.annotation.Target;
1919

2020
import com.exadel.aem.toolkit.api.annotations.meta.AnnotationRendering;
21+
import com.exadel.aem.toolkit.api.annotations.meta.ValueRestriction;
22+
import com.exadel.aem.toolkit.api.annotations.meta.ValueRestrictions;
2123

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

5154
/**
5255
* Used to specify tag name of the current {@code cq:editConfig/cq:dropTargets} subnode
5356
* @return Non-blank string
5457
*/
58+
@ValueRestriction(ValueRestrictions.NOT_BLANK)
5559
String nodeName();
5660
}

docs/content/getting-started/installation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ seoTitle: Installation - Exadel Authoring Kit
1111
<dependency>
1212
<groupId>com.exadel.etoolbox</groupId>
1313
<artifactId>etoolbox-authoring-kit-core</artifactId>
14-
<version>2.5.0</version> <!-- Prefer the latest stable version whenever possible -->
14+
<version>2.5.1</version> <!-- Prefer the latest stable version whenever possible -->
1515
<scope>provided</scope> <!-- Do not use compile or runtime scope!-->
1616
</dependency>
1717
```
@@ -21,7 +21,7 @@ seoTitle: Installation - Exadel Authoring Kit
2121
<plugin>
2222
<groupId>com.exadel.etoolbox</groupId>
2323
<artifactId>etoolbox-authoring-kit-plugin</artifactId>
24-
<version>2.5.0</version>
24+
<version>2.5.1</version>
2525
<executions>
2626
<execution>
2727
<goals>
@@ -32,7 +32,7 @@ seoTitle: Installation - Exadel Authoring Kit
3232
<configuration>
3333
<!-- RECOMMENDED: Place here the path to the node under which your component nodes are stored -->
3434
<componentsPathBase>jcr_root/apps/acme/components</componentsPathBase>
35-
<!-- RECOMMENDED: Specify root package for component classes that match the current package -->
35+
<!-- RECOMMENDED: Specify root package for component classes that match the current package. Multiple values can be separated with a comma -->
3636
<componentsReferenceBase>com.acme.project.components.*</componentsReferenceBase>
3737
<!-- OPTIONAL: specify list of exceptions that would cause this plugin to terminate -->
3838
<terminateOn>ALL</terminateOn>
@@ -79,7 +79,7 @@ You need to do two steps.
7979
<dependency>
8080
<groupId>com.exadel.etoolbox</groupId>
8181
<artifactId>etoolbox-authoring-kit-all</artifactId>
82-
<version>2.5.0</version>
82+
<version>2.5.1</version>
8383
<type>content-package</type>
8484
</dependency>
8585
```

docs/website/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

it.tests/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>com.exadel.etoolbox</groupId>
2222
<artifactId>etoolbox-authoring-kit</artifactId>
23-
<version>2.5.0</version>
23+
<version>2.5.1</version>
2424
</parent>
2525

2626
<artifactId>etoolbox-authoring-kit-it.tests</artifactId>

plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>com.exadel.etoolbox</groupId>
99
<artifactId>etoolbox-authoring-kit</artifactId>
10-
<version>2.5.0</version>
10+
<version>2.5.1</version>
1111
</parent>
1212

1313
<artifactId>etoolbox-authoring-kit-plugin</artifactId>

plugin/src/main/java/com/exadel/aem/toolkit/plugin/handlers/editconfig/DropTargetsHandler.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
import java.util.function.BiConsumer;
1818
import java.util.stream.Collectors;
1919

20+
import org.apache.commons.lang3.StringUtils;
21+
2022
import com.exadel.aem.toolkit.api.annotations.editconfig.DropTargetConfig;
2123
import com.exadel.aem.toolkit.api.annotations.editconfig.EditConfig;
2224
import com.exadel.aem.toolkit.api.handlers.Source;
2325
import com.exadel.aem.toolkit.api.handlers.Target;
26+
import com.exadel.aem.toolkit.plugin.exceptions.ValidationException;
27+
import com.exadel.aem.toolkit.plugin.maven.PluginRuntime;
2428
import com.exadel.aem.toolkit.plugin.metadata.RenderingFilter;
2529
import com.exadel.aem.toolkit.plugin.utils.DialogConstants;
2630

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

38+
private static final String INVALID_NAME_MESSAGE = "Invalid drop target node name";
39+
3440
/**
3541
* Processes data that can be extracted from the given {@code Source} and stores it into the provided {@code Target}
3642
* @param source {@code Source} object used for data retrieval
@@ -45,6 +51,9 @@ public void accept(Source source, Target target) {
4551
Target dropTargetsElement = target.getOrCreateTarget(DialogConstants.NN_DROP_TARGETS);
4652
for (int i = 0; i < editConfig.dropTargets().length; i++) {
4753
DropTargetConfig dropTargetConfig = editConfig.dropTargets()[i];
54+
if (StringUtils.isBlank(dropTargetConfig.nodeName())) {
55+
PluginRuntime.context().getExceptionHandler().handle(new ValidationException(INVALID_NAME_MESSAGE));
56+
}
4857
dropTargetsElement.getOrCreateTarget(dropTargetConfig.nodeName())
4958
.attribute(DialogConstants.PN_PRIMARY_TYPE, DialogConstants.NT_DROP_TARGET_CONFIG)
5059
.attributes(dropTargetConfig, new RenderingFilter(dropTargetConfig))

plugin/src/main/java/com/exadel/aem/toolkit/plugin/runtime/ReflectionContextHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
*/
6060
public class ReflectionContextHelper {
6161

62+
private static final char SEPARATOR_COMMA = ',';
6263
private Reflections reflections;
6364

6465
private ClassLoader classLoader;
@@ -101,9 +102,10 @@ public ClassLoader getClassLoader() {
101102
* @return A non-null list of {@code ComponentSource} objects; can be empty
102103
*/
103104
public List<ComponentSource> getComponents(String packageBase) {
105+
String[] packageRoots = StringUtils.split(packageBase, SEPARATOR_COMMA);
104106
return getComponents()
105107
.stream()
106-
.filter(comp -> StringUtils.isEmpty(packageBase) || ClassUtil.matchesReference(comp.adaptTo(Class.class), packageBase))
108+
.filter(comp -> StringUtils.isEmpty(packageBase) || ClassUtil.matchesReference(comp.adaptTo(Class.class), packageRoots))
107109
.collect(Collectors.toList());
108110
}
109111

0 commit comments

Comments
 (0)