Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tech] Merge release-2.5.4 branch to master #570

Merged
merged 21 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
152b995
[Tech] Bump version to 2.5.3-SNAPSHOT
smiakchilo Jan 23, 2025
7cf4c12
[EAK-558] Added Gson dependency
smiakchilo Jan 23, 2025
3da8a1f
[EAK-558] Created a servlet for outputting EToolbox Lists in simplifi…
smiakchilo Jan 23, 2025
5b52feb
[EAK-558] Added info on EToolbox Lists output in JSON
smiakchilo Jan 23, 2025
12685d3
[EAK-558] Cosmetic wording change
smiakchilo Jan 23, 2025
b83e811
[EAK-558] Code cleanup
smiakchilo Jan 24, 2025
408fec6
[EAK-561] Depends On: action unhandled exceptions could break initial…
NastaLeo Jan 24, 2025
abd9e3d
[EAK-558] Switched to using ListItemModel
smiakchilo Jan 24, 2025
d821332
Merge pull request #560 from exadel-inc/feature/EAK-558
smiakchilo Jan 24, 2025
994d0dd
Merge remote-tracking branch 'origin/master' into develop
ala-n Jan 29, 2025
0ce22a7
[EAK-566] Changed the structure of LinkTarget options
ala-n Feb 17, 2025
7756081
[EAK-566] Updated test cases
smiakchilo Feb 17, 2025
6aa83d4
[Tech] Updated Jackson dependency version
smiakchilo Feb 17, 2025
d2fc600
[Tech] Cosmetic wording update
smiakchilo Feb 17, 2025
30b8116
Merge pull request #567 from exadel-inc/bugfix/EAK-566
smiakchilo Feb 19, 2025
49f175e
Merge pull request #568 from exadel-inc/tech/update-jackson
smiakchilo Feb 19, 2025
5c6fc58
[EAK-558] Made OptionProviderServlet return an empty array instead of…
smiakchilo Feb 23, 2025
c66b71c
[EAK-558] Modified info on EToolbox Lists usage
smiakchilo Feb 23, 2025
89a3f70
[EAK-558] Retired the dedicated Lists JSON servlet
smiakchilo Feb 23, 2025
d24b247
Merge pull request #569 from exadel-inc/feature/eak-558-2
smiakchilo Feb 24, 2025
3b3e334
[Tech] Switched to 2.5.4 release version
smiakchilo Feb 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 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.3</version>
<version>2.5.4</version>
</parent>

<artifactId>etoolbox-authoring-kit-all</artifactId>
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.3</version>
<version>2.5.4</version>
</parent>

<artifactId>etoolbox-authoring-kit-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@
/**
* Defines the {@code target} attribute for a link to an internal resource
* @see LinkTarget
* @return One of {@code LinkTarget} values
* @return String value
*/
LinkTarget targetInternal() default LinkTarget.AUTO;
String targetInternal() default LinkTarget.AUTO;

/**
* Defines the {@code target} attribute for a link to an external resource
* @see LinkTarget
* @return One of {@code LinkTarget} values
* @return String value
*/
LinkTarget targetExternal() default LinkTarget.AUTO;
String targetExternal() default LinkTarget.AUTO;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@
package com.exadel.aem.toolkit.api.annotations.widgets.rte;

/**
* Contains possible values of {@link HtmlLinkRules#targetExternal()} and {@link HtmlLinkRules#targetInternal()} properties
* Enumerates values of {@link HtmlLinkRules#targetExternal()} and {@link HtmlLinkRules#targetInternal()} properties.
* These properties define the value of `target` attribute for an anchor tag
*/
public enum LinkTarget {
AUTO {
@Override
public String toString() {
return "";
}
},
MANUAL {
@Override
public String toString() {
return "manual";
}
},
BLANK {
@Override
public String toString() {
return "blank";
}
},
public class LinkTarget {

public static final String AUTO = "";

public static final String BLANK = "_blank";

@Deprecated
public static final String MANUAL = "manual";

public static final String PARENT = "_parent";

public static final String SELF = AUTO;

public static final String TOP = "_top";

/**
* Default (instantiation-preventing) constructor
*/
private LinkTarget() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public class CoreConstants {
public static final String EQUALITY_SIGN = "=";
public static final String WILDCARD = "*";

public static final String CONTENT_TYPE_JSON = "application/json;charset=utf-8";

/**
* Default (instantiation-restricting) constructor
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
import com.exadel.aem.toolkit.core.lists.ListConstants;

/**
* Provides the collection of AEM resources that either represent Exadel Toolbox Lists or serve as folders for Exadel
* Toolbox Lists to be displayed in the Exadel Toolbox Lists console
* Provides the collection of AEM resources that either represent an EToolbox Lists or serve as folders for EToolbox
* Lists to be displayed in the EToolbox Lists console
* <p><u>Note</u>: This class is not a part of the public API and is subject to change. Do not use it in your own
* code</p>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import javax.annotation.Nonnull;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.sling.api.SlingHttpServletRequest;
Expand Down Expand Up @@ -59,7 +58,6 @@
"sling.servlet.methods=" + HttpConstants.METHOD_GET
})
public class OptionProviderServlet extends SlingSafeMethodsServlet {
private static final String CONTENT_TYPE_JSON = "application/json;charset=utf-8";

private static final String QUERY_KEY_OUTPUT = "output";
private static final String QUERY_VALUE_JSON = "json";
Expand All @@ -74,28 +72,28 @@ public class OptionProviderServlet extends SlingSafeMethodsServlet {
* @param response {@code SlingHttpServletResponse} instance
*/
@Override
protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws ServletException, IOException {
protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response)
throws ServletException, IOException {

List<Resource> options = optionProvider.getOptions(request);

if (CollectionUtils.isEmpty(options) && isJsonOutput(request)) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
if (!isJsonOutput(request)) {
DataSource ds = new SimpleDataSource(options.iterator());
request.setAttribute(DataSource.class.getName(), ds);
return;
}

if (isJsonOutput(request)) {
response.setContentType(CONTENT_TYPE_JSON);
response.setCharacterEncoding(StandardCharsets.UTF_8.toString());
try {
response.getWriter().print(getJsonOutput(options));
} catch (JSONException | NullPointerException e) {
throw new ServletException(e);
}
response.setCharacterEncoding(StandardCharsets.UTF_8.toString());
response.setContentType(CoreConstants.CONTENT_TYPE_JSON);
if (CollectionUtils.isEmpty(options)) {
response.getWriter().write(CoreConstants.ARRAY_OPENING + CoreConstants.ARRAY_CLOSING);
return;
}

DataSource ds = new SimpleDataSource(options.iterator());
request.setAttribute(DataSource.class.getName(), ds);
try {
response.getWriter().print(getJsonOutput(options));
} catch (JSONException | NullPointerException e) {
throw new ServletException(e);
}
}

/**
Expand All @@ -104,6 +102,9 @@ protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHtt
* @return True or false
*/
private static boolean isJsonOutput(SlingHttpServletRequest request) {
if (QUERY_VALUE_JSON.equalsIgnoreCase(request.getRequestPathInfo().getExtension())) {
return true;
}
RequestParameter jsonParameter = request.getRequestParameter(QUERY_KEY_OUTPUT);
if (jsonParameter == null) {
return false;
Expand Down
6 changes: 6 additions & 0 deletions docs/content/authoring-tools/etoolbox-lists.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,9 @@ public class MyComponent {
String optionList;
}
```

## Retrieving Lists' content via HTTP

Your website's authoring logic may require fetching the content of a list via HTTP — e.g., with an AJAX request. This can be achieved with the OptionSource / [OptionProvider](../dev-tools/option-provider.md) servlet. Make a GET request to `/apps/etoolbox-authoring-kit/datasources/option-provider.json?path=<path_to_EToolbox_list>`.

By default, the servlet returns a JSON array of objects with `text` and `value` properties matching the same-named attributes of list items. You will probably want to modify the mapping. To say, a typical EToolbox List makes use of `jcr:title` and `value` attributes. Add `&textMember=jcr:title` to expose _jcr:title_. Similarly, you can alter the `valueMember` parameter, add some `attributeMembers`, etc. Please remember that if an item doesn't have a non-blank mapping for both _text_ and _value_, it won't be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ mvn clean test -Pintegration -D"aem.host"=192.168.0.81 -D"aem.port"=8080 -D"aem.

### Doing regression testing

The ToolKit supports regression testing as well. Regression testing is done using an external AEM project. The aim is to make sure that a <newer> version of ToolKit (namely, the plugin) produces essentially the same XML markup as an <older> one. The <older> version is considered a "reference" and is used as a baseline for comparison.
The ToolKit supports regression testing as well. Regression testing is done using an external AEM project. The aim is to make sure that a _newer_ version of ToolKit (namely, the plugin) produces essentially the same XML markup as an _older_ one. The _older_ version is used as a baseline for comparison.

To run regression tests, you need to specify the dedicated Maven profile like the following:
```
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.3</version> <!-- Prefer the latest stable version whenever possible -->
<version>2.5.4</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.3</version>
<version>2.5.4</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.3</version>
<version>2.5.4</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 docs/website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eak-website",
"version": "2.5.3",
"version": "2.5.4",
"description": "EAK website package definition",
"main": "index.js",
"scripts": {
Expand Down
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.3</version>
<version>2.5.4</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.3</version>
<version>2.5.4</version>
</parent>

<artifactId>etoolbox-authoring-kit-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class ScriptedComponent extends ScriptedParent {
},
maxUndoSteps = 25,
htmlLinkRules = @HtmlLinkRules(
targetInternal = LinkTarget.MANUAL,
targetInternal = LinkTarget.TOP,
targetExternal = LinkTarget.BLANK,
protocols = {"http:", "https:"},
defaultProtocol = "http:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class RichTextEditorWidget {
indentSize = 1,
maxUndoSteps = 25,
htmlLinkRules = @HtmlLinkRules(
targetInternal = LinkTarget.MANUAL,
targetInternal = LinkTarget.PARENT,
targetExternal = LinkTarget.BLANK,
protocols = {"http:", "https:"},
defaultProtocol = "http:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
protocols="[http:,https:]">
<targetConfig jcr:primaryType="nt:unstructured"
mode="auto"
targetExternal="blank"
targetInternal="manual"/>
targetExternal="_blank"
targetInternal="_top"/>
</links>
</htmlRules>
<granite:data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
</rtePlugins>
<htmlRules jcr:primaryType="nt:unstructured">
<links jcr:primaryType="nt:unstructured" defaultProtocol="http:" protocols="[http:,https:]">
<targetConfig jcr:primaryType="nt:unstructured" mode="auto" targetExternal="blank" targetInternal="manual"/>
<targetConfig jcr:primaryType="nt:unstructured" mode="auto" targetExternal="_blank" targetInternal="_parent"/>
</links>
</htmlRules>
</text>
Expand Down
10 changes: 5 additions & 5 deletions 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.3</version>
<version>2.5.4</version>

<name>Exadel Toolbox Authoring Kit</name>
<description>Automates generating and managing rich and responsive authoring interfaces for Adobe Experience Manager</description>
Expand Down Expand Up @@ -462,25 +462,25 @@
<dependency>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-anydiff-core</artifactId>
<version>1.0.0</version>
<version>1.1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.13.4</version>
<version>2.18.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.13.4</version>
<version>2.18.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.4.2</version>
<version>2.18.0</version>
<scope>compile</scope>
</dependency>
<dependency>
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.3",
"version": "2.5.4",
"private": true,
"devDependencies": {
"eslint": "^9.19.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.3</version>
<version>2.5.4</version>
</parent>

<artifactId>etoolbox-authoring-kit-ui.apps</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@
return true;
}
const queryResult = ns.QueryProcessor.evaluateQuery(this.parsedQuery, this.$el);
ns.ActionRegistry.getAction(this.action).call(this, queryResult, this.data, this);
try {
ns.ActionRegistry.getAction(this.action).call(this, queryResult, this.data, this);
} catch (e) {
console.debug('[DependsOn]: Error while executing an action', e);
}
}
}

Expand Down
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.3</version>
<version>2.5.4</version>
</parent>

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