From 152b9956247537aefe6b832aca79de3344d72035 Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Fri, 24 Jan 2025 01:04:35 +0300 Subject: [PATCH 01/16] [Tech] Bump version to 2.5.3-SNAPSHOT --- all/pom.xml | 2 +- core/pom.xml | 2 +- docs/website/package-lock.json | 4 ++-- it.tests/pom.xml | 2 +- plugin/pom.xml | 2 +- pom.xml | 4 ++-- ui.apps/package-lock.json | 4 ++-- ui.apps/package.json | 2 +- ui.apps/pom.xml | 2 +- ui.content/pom.xml | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/all/pom.xml b/all/pom.xml index a2b9ce708..14cf65cdb 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -7,7 +7,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3 + 2.5.3-SNAPSHOT etoolbox-authoring-kit-all diff --git a/core/pom.xml b/core/pom.xml index 68ced1e82..b8c85a616 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -7,7 +7,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3 + 2.5.3-SNAPSHOT etoolbox-authoring-kit-core diff --git a/docs/website/package-lock.json b/docs/website/package-lock.json index ed5b995f7..d7dd0a21e 100644 --- a/docs/website/package-lock.json +++ b/docs/website/package-lock.json @@ -1,12 +1,12 @@ { "name": "eak-website", - "version": "2.5.3", + "version": "2.5.3-SNAPSHOT", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "eak-website", - "version": "2.5.3", + "version": "2.5.3-SNAPSHOT", "license": "ISC", "dependencies": { "@exadel/esl": "^4.9.4", diff --git a/it.tests/pom.xml b/it.tests/pom.xml index daf6562ff..ee2042514 100644 --- a/it.tests/pom.xml +++ b/it.tests/pom.xml @@ -20,7 +20,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3 + 2.5.3-SNAPSHOT etoolbox-authoring-kit-it.tests diff --git a/plugin/pom.xml b/plugin/pom.xml index 5d7765969..37e143d80 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -7,7 +7,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3 + 2.5.3-SNAPSHOT etoolbox-authoring-kit-plugin diff --git a/pom.xml b/pom.xml index e679ce836..5ea9a2bae 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3 + 2.5.3-SNAPSHOT Exadel Toolbox Authoring Kit Automates generating and managing rich and responsive authoring interfaces for Adobe Experience Manager @@ -462,7 +462,7 @@ com.exadel.etoolbox etoolbox-anydiff-core - 1.0.0 + 1.1.1 test diff --git a/ui.apps/package-lock.json b/ui.apps/package-lock.json index 10bd93c0d..5cb4e27ba 100644 --- a/ui.apps/package-lock.json +++ b/ui.apps/package-lock.json @@ -1,12 +1,12 @@ { "name": "depends-on", - "version": "2.5.3", + "version": "2.5.3-SNAPSHOT", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "depends-on", - "version": "2.5.3", + "version": "2.5.3-SNAPSHOT", "license": "Apache-2.0", "devDependencies": { "eslint": "^9.0.0", diff --git a/ui.apps/package.json b/ui.apps/package.json index ac330a484..98639b944 100644 --- a/ui.apps/package.json +++ b/ui.apps/package.json @@ -1,7 +1,7 @@ { "name": "depends-on", "description": "A clientlib that executes defined action on dependent fields", - "version": "2.5.3", + "version": "2.5.3-SNAPSHOT", "private": true, "devDependencies": { "eslint": "^9.0.0", diff --git a/ui.apps/pom.xml b/ui.apps/pom.xml index b2ebe4e60..4f9dc4023 100644 --- a/ui.apps/pom.xml +++ b/ui.apps/pom.xml @@ -7,7 +7,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3 + 2.5.3-SNAPSHOT etoolbox-authoring-kit-ui.apps diff --git a/ui.content/pom.xml b/ui.content/pom.xml index f3602689b..f4512ad6c 100644 --- a/ui.content/pom.xml +++ b/ui.content/pom.xml @@ -8,7 +8,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3 + 2.5.3-SNAPSHOT etoolbox-authoring-kit-ui.content From 7cf4c12a2ebec5996aa2c7175d76693a07bfbadc Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Fri, 24 Jan 2025 02:24:37 +0300 Subject: [PATCH 02/16] [EAK-558] Added Gson dependency --- core/pom.xml | 4 ++++ pom.xml | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/core/pom.xml b/core/pom.xml index b8c85a616..a6551a230 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -114,6 +114,10 @@ com.google.code.findbugs jsr305 + + com.google.code.gson + gson + com.google.guava guava diff --git a/pom.xml b/pom.xml index 5ea9a2bae..ade9bb294 100644 --- a/pom.xml +++ b/pom.xml @@ -489,6 +489,12 @@ 3.0.2 provided + + com.google.code.gson + gson + 2.11.0 + test + com.codeborne selenide From 3da8a1f7e84898903ad4d1f15a84e7fc6977571e Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Fri, 24 Jan 2025 02:26:18 +0300 Subject: [PATCH 03/16] [EAK-558] Created a servlet for outputting EToolbox Lists in simplified JSON format --- .../aem/toolkit/core/CoreConstants.java | 2 + .../core/lists/servlets/ListsJsonServlet.java | 107 +++++++++++++++++ .../servlets/OptionProviderServlet.java | 3 +- .../lists/servlets/ListsJsonServletTest.java | 110 ++++++++++++++++++ 4 files changed, 220 insertions(+), 2 deletions(-) create mode 100644 core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java create mode 100644 core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java diff --git a/core/src/main/java/com/exadel/aem/toolkit/core/CoreConstants.java b/core/src/main/java/com/exadel/aem/toolkit/core/CoreConstants.java index b531ce239..2d03b8f45 100644 --- a/core/src/main/java/com/exadel/aem/toolkit/core/CoreConstants.java +++ b/core/src/main/java/com/exadel/aem/toolkit/core/CoreConstants.java @@ -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 */ diff --git a/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java b/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java new file mode 100644 index 000000000..1c7275f36 --- /dev/null +++ b/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java @@ -0,0 +1,107 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.exadel.aem.toolkit.core.lists.servlets; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import javax.annotation.Nonnull; +import javax.servlet.Servlet; + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpStatus; +import org.apache.sling.api.SlingHttpServletRequest; +import org.apache.sling.api.SlingHttpServletResponse; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.api.resource.ValueMap; +import org.apache.sling.api.servlets.HttpConstants; +import org.apache.sling.api.servlets.SlingSafeMethodsServlet; +import org.osgi.service.component.annotations.Component; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import com.google.gson.Gson; +import com.day.cq.commons.jcr.JcrConstants; +import com.day.cq.wcm.api.Page; +import com.day.cq.wcm.api.PageManager; + +import com.exadel.aem.toolkit.core.CoreConstants; +import com.exadel.aem.toolkit.core.lists.ListConstants; + +/** + * Delivers content of an Exadel Toolbox List as a JSON array + *

Note: This class is not a part of the public API and is subject to change. Do not use it in your own + * code

+ */ +@Component( + service = Servlet.class, + property = { + "sling.servlet.resourceTypes=/apps/etoolbox-authoring-kit/lists/components/structure/page-list", + "sling.servlet.extensions=json", + "sling.servlet.methods=" + HttpConstants.METHOD_GET, + "sling.servlet.selectors=list" + } +) +public class ListsJsonServlet extends SlingSafeMethodsServlet { + + private static final Logger LOG = LoggerFactory.getLogger(ListsJsonServlet.class); + + private static final Gson GSON = new Gson(); + + /** + * Processes a GET request to deliver the content of an Exadel Toolbox List as a JSON array + * @param request {@code SlingHttpServletRequest} instance + * @param response {@code SlingHttpServletResponse} instance + * @throws IOException If failed to output to the response stream + */ + @Override + protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws IOException { + PageManager pageManager = request.getResourceResolver().adaptTo(PageManager.class); + Page page = pageManager != null ? pageManager.getContainingPage(request.getResource()) : null; + if (page == null) { + LOG.warn("Resource at {} cannot be adapted to a page", request.getResource().getPath()); + response.setStatus(HttpStatus.SC_NOT_FOUND); + return; + } + + Resource listResource = page.getContentResource().getChild("list"); + if (listResource == null) { + LOG.warn("Path {} does not belong to an EToolbox List", request.getResource().getPath()); + response.setStatus(HttpStatus.SC_NOT_FOUND); + return; + } + + List> result = new ArrayList<>(); + for (Resource item : listResource.getChildren()) { + if (!ListConstants.LIST_ITEM_RESOURCE_TYPE.equals(item.getResourceType())) { + continue; + } + ValueMap valueMap = item.getValueMap(); + Map userValues = valueMap + .entrySet() + .stream() + .filter(entry -> JcrConstants.JCR_TITLE.equals(entry.getKey()) + || !StringUtils.contains(entry.getKey(), CoreConstants.SEPARATOR_COLON)) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + if (userValues.isEmpty()) { + continue; + } + result.add(userValues); + } + + response.setContentType(CoreConstants.CONTENT_TYPE_JSON); + response.getWriter().write(GSON.toJson(result)); + } +} diff --git a/core/src/main/java/com/exadel/aem/toolkit/core/optionprovider/servlets/OptionProviderServlet.java b/core/src/main/java/com/exadel/aem/toolkit/core/optionprovider/servlets/OptionProviderServlet.java index 3e992b6d0..8b9083921 100644 --- a/core/src/main/java/com/exadel/aem/toolkit/core/optionprovider/servlets/OptionProviderServlet.java +++ b/core/src/main/java/com/exadel/aem/toolkit/core/optionprovider/servlets/OptionProviderServlet.java @@ -59,7 +59,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"; @@ -84,7 +83,7 @@ protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHtt } if (isJsonOutput(request)) { - response.setContentType(CONTENT_TYPE_JSON); + response.setContentType(CoreConstants.CONTENT_TYPE_JSON); response.setCharacterEncoding(StandardCharsets.UTF_8.toString()); try { response.getWriter().print(getJsonOutput(options)); diff --git a/core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java b/core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java new file mode 100644 index 000000000..686de87bf --- /dev/null +++ b/core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java @@ -0,0 +1,110 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.exadel.aem.toolkit.core.lists.servlets; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpStatus; +import org.apache.sling.testing.mock.sling.ResourceResolverType; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import com.google.gson.Gson; +import io.wcm.testing.mock.aem.junit.AemContext; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import com.exadel.aem.toolkit.core.AemContextFactory; + +public class ListsJsonServletTest { + + private static final String SIMPLE_LIST_PATH = "/content/etoolbox-authoring-kit/lists/simpleList"; + private static final String CUSTOM_LIST_PATH = "/content/etoolbox-authoring-kit/lists/etoolbox-lists/customList"; + + @Rule + public AemContext context = AemContextFactory.newInstance(ResourceResolverType.JCR_OAK); + + private ListsJsonServlet servlet; + + @Before + public void setUp() { + servlet = new ListsJsonServlet(); + context.load().json("/com/exadel/aem/toolkit/core/lists/utils/simpleList.json", SIMPLE_LIST_PATH); + context.load().json("/com/exadel/aem/toolkit/core/lists/utils/customList.json", CUSTOM_LIST_PATH); + context.create().page("/content/etoolbox-authoring-kit/lists/dummy", StringUtils.EMPTY); + } + + @Test + public void shouldRetrieveSimpleJson() throws IOException { + context.request().setResource(context.resourceResolver().getResource(SIMPLE_LIST_PATH + "/jcr:content")); + servlet.doGet(context.request(), context.response()); + + assertEquals(HttpStatus.SC_OK, context.response().getStatus()); + String jsonResponse = context.response().getOutputAsString(); + + @SuppressWarnings("unchecked") + List> result = new Gson().fromJson(jsonResponse, List.class); + assertEquals(4, result.size()); + assertTrue(result.stream().allMatch(item -> item.containsKey("value"))); + } + + @Test + public void shouldRetrieveCustomJson() throws IOException { + context.request().setResource(context.resourceResolver().getResource(CUSTOM_LIST_PATH + "/jcr:content")); + servlet.doGet(context.request(), context.response()); + + assertEquals(HttpStatus.SC_OK, context.response().getStatus()); + String jsonResponse = context.response().getOutputAsString(); + + @SuppressWarnings("unchecked") + List> result = new Gson().fromJson(jsonResponse, List.class); + assertEquals(2, result.size()); + assertTrue(result.stream().allMatch(item -> item.containsKey("textValue"))); + assertTrue(result.stream().allMatch(item -> item.containsKey("booleanValue"))); + } + + @Test + public void shouldReturn404ForNonList() throws IOException { + context.request().setResource(context.resourceResolver().getResource("/content/etoolbox-authoring-kit/lists")); + servlet.doGet(context.request(), context.response()); + + assertEquals(HttpStatus.SC_NOT_FOUND, context.response().getStatus()); + + context.request().setResource(context.resourceResolver().getResource("/content/etoolbox-authoring-kit/lists/dummy")); + servlet.doGet(context.request(), context.response()); + + assertEquals(HttpStatus.SC_NOT_FOUND, context.response().getStatus()); + } + +/* + @Test + public void testDoGetPageNotFound() throws ServletException, IOException { + context.request().setResource(context.resourceResolver().getResource("/content/nonexistent")); + servlet.doGet(context.request(), context.response()); + + assertEquals(HttpStatus.SC_NOT_FOUND, context.response().getStatus()); + } + + @Test + public void testDoGetListNotFound() throws ServletException, IOException { + context.request().setResource(context.resourceResolver().getResource(PAGE_PATH + "/jcr:content/empty")); + servlet.doGet(context.request(), context.response()); + + assertEquals(HttpStatus.SC_NOT_FOUND, context.response().getStatus()); + } +*/ +} From 5b52feb6074399812dfda4300004cfbe193f8aab Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Fri, 24 Jan 2025 02:28:13 +0300 Subject: [PATCH 04/16] [EAK-558] Added info on EToolbox Lists output in JSON --- docs/content/authoring-tools/etoolbox-lists.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/content/authoring-tools/etoolbox-lists.md b/docs/content/authoring-tools/etoolbox-lists.md index a5b3b32ac..a7e0a8d7a 100644 --- a/docs/content/authoring-tools/etoolbox-lists.md +++ b/docs/content/authoring-tools/etoolbox-lists.md @@ -123,3 +123,7 @@ public class MyComponent { String optionList; } ``` + +## Retrieving Lists' content via HTTP + +You website's authoring logic may require fetching the content of a list via HTTP - e.g., with an AJAX request. EToolbox provides a servlet that delivers a flat array of items in JSON format. The data will be stripped of all the "system" properties like _jcr:created_, etc. Request it with the `.list.` selector and `.json` extension. Example: `/content/path/to/your/lists/sampleList.list.json`. From 12685d32383d0606a584d1fb1794aa8d91100757 Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Fri, 24 Jan 2025 02:28:29 +0300 Subject: [PATCH 05/16] [EAK-558] Cosmetic wording change --- .../exadel/aem/toolkit/core/lists/servlets/ListsServlet.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsServlet.java b/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsServlet.java index ccdbc952e..26dd362f7 100644 --- a/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsServlet.java +++ b/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsServlet.java @@ -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 *

Note: This class is not a part of the public API and is subject to change. Do not use it in your own * code

*/ From b83e811edec0ef9c431547f4e475c658e324662b Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Fri, 24 Jan 2025 13:28:41 +0300 Subject: [PATCH 06/16] [EAK-558] Code cleanup --- .../lists/servlets/ListsJsonServletTest.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java b/core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java index 686de87bf..3faea170a 100644 --- a/core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java +++ b/core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java @@ -89,22 +89,4 @@ public void shouldReturn404ForNonList() throws IOException { assertEquals(HttpStatus.SC_NOT_FOUND, context.response().getStatus()); } - -/* - @Test - public void testDoGetPageNotFound() throws ServletException, IOException { - context.request().setResource(context.resourceResolver().getResource("/content/nonexistent")); - servlet.doGet(context.request(), context.response()); - - assertEquals(HttpStatus.SC_NOT_FOUND, context.response().getStatus()); - } - - @Test - public void testDoGetListNotFound() throws ServletException, IOException { - context.request().setResource(context.resourceResolver().getResource(PAGE_PATH + "/jcr:content/empty")); - servlet.doGet(context.request(), context.response()); - - assertEquals(HttpStatus.SC_NOT_FOUND, context.response().getStatus()); - } -*/ } From 408fec662eeff801e9c2f25b85a4f6178ec8e557 Mon Sep 17 00:00:00 2001 From: Anastasiya Lesun <72765981+NastaLeo@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:33:04 +0100 Subject: [PATCH 07/16] [EAK-561] Depends On: action unhandled exceptions could break initialization flow (#559) Closes: #561 --- .../depends-on/js/dependsOnQueryObserver.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui.apps/src/main/content/jcr_root/apps/etoolbox-authoring-kit/depends-on/js/dependsOnQueryObserver.js b/ui.apps/src/main/content/jcr_root/apps/etoolbox-authoring-kit/depends-on/js/dependsOnQueryObserver.js index 448fffc1d..3776ec1ff 100644 --- a/ui.apps/src/main/content/jcr_root/apps/etoolbox-authoring-kit/depends-on/js/dependsOnQueryObserver.js +++ b/ui.apps/src/main/content/jcr_root/apps/etoolbox-authoring-kit/depends-on/js/dependsOnQueryObserver.js @@ -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); + } } } From abd9e3d864e9c900e1eb62ed8e9e7799bf3d4110 Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Fri, 24 Jan 2025 14:24:46 +0300 Subject: [PATCH 08/16] [EAK-558] Switched to using ListItemModel --- .../core/lists/servlets/ListsJsonServlet.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java b/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java index 1c7275f36..ce33121f2 100644 --- a/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java +++ b/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java @@ -17,28 +17,25 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import javax.annotation.Nonnull; import javax.servlet.Servlet; -import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpStatus; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.SlingHttpServletResponse; import org.apache.sling.api.resource.Resource; -import org.apache.sling.api.resource.ValueMap; import org.apache.sling.api.servlets.HttpConstants; import org.apache.sling.api.servlets.SlingSafeMethodsServlet; import org.osgi.service.component.annotations.Component; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.gson.Gson; -import com.day.cq.commons.jcr.JcrConstants; import com.day.cq.wcm.api.Page; import com.day.cq.wcm.api.PageManager; import com.exadel.aem.toolkit.core.CoreConstants; import com.exadel.aem.toolkit.core.lists.ListConstants; +import com.exadel.aem.toolkit.core.lists.models.internal.ListItemModel; /** * Delivers content of an Exadel Toolbox List as a JSON array @@ -88,17 +85,10 @@ protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHtt if (!ListConstants.LIST_ITEM_RESOURCE_TYPE.equals(item.getResourceType())) { continue; } - ValueMap valueMap = item.getValueMap(); - Map userValues = valueMap - .entrySet() - .stream() - .filter(entry -> JcrConstants.JCR_TITLE.equals(entry.getKey()) - || !StringUtils.contains(entry.getKey(), CoreConstants.SEPARATOR_COLON)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); - if (userValues.isEmpty()) { - continue; + ListItemModel listItemModel = item.adaptTo(ListItemModel.class); + if (listItemModel != null) { + result.add(listItemModel.getProperties()); } - result.add(userValues); } response.setContentType(CoreConstants.CONTENT_TYPE_JSON); From 0ce22a7d9a0dc4383bd7a82d47bbe47005feda6c Mon Sep 17 00:00:00 2001 From: "ala'n (Alexey Stsefanovich)" Date: Tue, 18 Feb 2025 00:31:37 +0300 Subject: [PATCH 09/16] [EAK-566] Changed the structure of LinkTarget options --- .../widgets/rte/HtmlLinkRules.java | 8 ++-- .../annotations/widgets/rte/LinkTarget.java | 41 ++++++++++--------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/core/src/main/java/com/exadel/aem/toolkit/api/annotations/widgets/rte/HtmlLinkRules.java b/core/src/main/java/com/exadel/aem/toolkit/api/annotations/widgets/rte/HtmlLinkRules.java index 7490c201e..870d8e135 100644 --- a/core/src/main/java/com/exadel/aem/toolkit/api/annotations/widgets/rte/HtmlLinkRules.java +++ b/core/src/main/java/com/exadel/aem/toolkit/api/annotations/widgets/rte/HtmlLinkRules.java @@ -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; } diff --git a/core/src/main/java/com/exadel/aem/toolkit/api/annotations/widgets/rte/LinkTarget.java b/core/src/main/java/com/exadel/aem/toolkit/api/annotations/widgets/rte/LinkTarget.java index 21b4f6982..97410733f 100644 --- a/core/src/main/java/com/exadel/aem/toolkit/api/annotations/widgets/rte/LinkTarget.java +++ b/core/src/main/java/com/exadel/aem/toolkit/api/annotations/widgets/rte/LinkTarget.java @@ -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() { + } } From 7756081ad8b93d42d474693d0d281438598ef603 Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Tue, 18 Feb 2025 00:31:56 +0300 Subject: [PATCH 10/16] [EAK-566] Updated test cases --- .../handlers/common/cases/components/ScriptedComponent.java | 2 +- .../plugin/handlers/widgets/cases/RichTextEditorWidget.java | 2 +- .../components/generic/scriptedComponent/_cq_dialog.xml | 4 ++-- .../resources/handlers/widgets/richTextEditor/_cq_dialog.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin/src/test/com/exadel/aem/toolkit/plugin/handlers/common/cases/components/ScriptedComponent.java b/plugin/src/test/com/exadel/aem/toolkit/plugin/handlers/common/cases/components/ScriptedComponent.java index e9362181b..9904f4789 100644 --- a/plugin/src/test/com/exadel/aem/toolkit/plugin/handlers/common/cases/components/ScriptedComponent.java +++ b/plugin/src/test/com/exadel/aem/toolkit/plugin/handlers/common/cases/components/ScriptedComponent.java @@ -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:" diff --git a/plugin/src/test/com/exadel/aem/toolkit/plugin/handlers/widgets/cases/RichTextEditorWidget.java b/plugin/src/test/com/exadel/aem/toolkit/plugin/handlers/widgets/cases/RichTextEditorWidget.java index 4005c7964..cbd6266ad 100644 --- a/plugin/src/test/com/exadel/aem/toolkit/plugin/handlers/widgets/cases/RichTextEditorWidget.java +++ b/plugin/src/test/com/exadel/aem/toolkit/plugin/handlers/widgets/cases/RichTextEditorWidget.java @@ -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:" diff --git a/plugin/src/test/resources/handlers/common/components/generic/scriptedComponent/_cq_dialog.xml b/plugin/src/test/resources/handlers/common/components/generic/scriptedComponent/_cq_dialog.xml index 3321f5677..ef9f916b1 100644 --- a/plugin/src/test/resources/handlers/common/components/generic/scriptedComponent/_cq_dialog.xml +++ b/plugin/src/test/resources/handlers/common/components/generic/scriptedComponent/_cq_dialog.xml @@ -131,8 +131,8 @@ protocols="[http:,https:]"> + targetExternal="_blank" + targetInternal="_top"/> - + From 6aa83d40720f403f5222666db336cb4295fa4173 Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Tue, 18 Feb 2025 00:45:39 +0300 Subject: [PATCH 11/16] [Tech] Updated Jackson dependency version --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ade9bb294..a16ab2f06 100644 --- a/pom.xml +++ b/pom.xml @@ -468,19 +468,19 @@ com.fasterxml.jackson.core jackson-annotations - 2.13.4 + 2.18.0 compile com.fasterxml.jackson.core jackson-core - 2.13.4 + 2.18.0 compile com.fasterxml.jackson.core jackson-databind - 2.13.4.2 + 2.18.0 compile From d2fc6001e30dc3544cc537c74f229736d2544621 Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Tue, 18 Feb 2025 01:29:58 +0300 Subject: [PATCH 12/16] [Tech] Cosmetic wording update --- .../dev-tools/component-management/customizing-toolkit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/dev-tools/component-management/customizing-toolkit.md b/docs/content/dev-tools/component-management/customizing-toolkit.md index 5e9c527c2..c2673f24f 100644 --- a/docs/content/dev-tools/component-management/customizing-toolkit.md +++ b/docs/content/dev-tools/component-management/customizing-toolkit.md @@ -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 version of ToolKit (namely, the plugin) produces essentially the same XML markup as an one. The 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: ``` From 5c6fc580b26c7491859f762eab4631732fb4ecba Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Mon, 24 Feb 2025 00:48:16 +0300 Subject: [PATCH 13/16] [EAK-558] Made OptionProviderServlet return an empty array instead of HTTP 404 if no valid items to display --- .../servlets/OptionProviderServlet.java | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/com/exadel/aem/toolkit/core/optionprovider/servlets/OptionProviderServlet.java b/core/src/main/java/com/exadel/aem/toolkit/core/optionprovider/servlets/OptionProviderServlet.java index 8b9083921..6b60fae41 100644 --- a/core/src/main/java/com/exadel/aem/toolkit/core/optionprovider/servlets/OptionProviderServlet.java +++ b/core/src/main/java/com/exadel/aem/toolkit/core/optionprovider/servlets/OptionProviderServlet.java @@ -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; @@ -73,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 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(CoreConstants.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); + } } /** @@ -103,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; From c66b71c00f38126a1875544bcfd5a41e536d9207 Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Mon, 24 Feb 2025 00:48:48 +0300 Subject: [PATCH 14/16] [EAK-558] Modified info on EToolbox Lists usage --- docs/content/authoring-tools/etoolbox-lists.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/content/authoring-tools/etoolbox-lists.md b/docs/content/authoring-tools/etoolbox-lists.md index a7e0a8d7a..ee2797f2a 100644 --- a/docs/content/authoring-tools/etoolbox-lists.md +++ b/docs/content/authoring-tools/etoolbox-lists.md @@ -126,4 +126,6 @@ public class MyComponent { ## Retrieving Lists' content via HTTP -You website's authoring logic may require fetching the content of a list via HTTP - e.g., with an AJAX request. EToolbox provides a servlet that delivers a flat array of items in JSON format. The data will be stripped of all the "system" properties like _jcr:created_, etc. Request it with the `.list.` selector and `.json` extension. Example: `/content/path/to/your/lists/sampleList.list.json`. +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=`. + +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. From 89a3f70564742b50628e332a124572ec6d40e787 Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Mon, 24 Feb 2025 00:51:45 +0300 Subject: [PATCH 15/16] [EAK-558] Retired the dedicated Lists JSON servlet --- core/pom.xml | 4 - .../core/lists/servlets/ListsJsonServlet.java | 97 ------------------- .../lists/servlets/ListsJsonServletTest.java | 92 ------------------ pom.xml | 6 -- 4 files changed, 199 deletions(-) delete mode 100644 core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java delete mode 100644 core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java diff --git a/core/pom.xml b/core/pom.xml index a6551a230..b8c85a616 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -114,10 +114,6 @@ com.google.code.findbugs jsr305 - - com.google.code.gson - gson - com.google.guava guava diff --git a/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java b/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java deleted file mode 100644 index ce33121f2..000000000 --- a/core/src/main/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServlet.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.exadel.aem.toolkit.core.lists.servlets; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import javax.annotation.Nonnull; -import javax.servlet.Servlet; - -import org.apache.http.HttpStatus; -import org.apache.sling.api.SlingHttpServletRequest; -import org.apache.sling.api.SlingHttpServletResponse; -import org.apache.sling.api.resource.Resource; -import org.apache.sling.api.servlets.HttpConstants; -import org.apache.sling.api.servlets.SlingSafeMethodsServlet; -import org.osgi.service.component.annotations.Component; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import com.google.gson.Gson; -import com.day.cq.wcm.api.Page; -import com.day.cq.wcm.api.PageManager; - -import com.exadel.aem.toolkit.core.CoreConstants; -import com.exadel.aem.toolkit.core.lists.ListConstants; -import com.exadel.aem.toolkit.core.lists.models.internal.ListItemModel; - -/** - * Delivers content of an Exadel Toolbox List as a JSON array - *

Note: This class is not a part of the public API and is subject to change. Do not use it in your own - * code

- */ -@Component( - service = Servlet.class, - property = { - "sling.servlet.resourceTypes=/apps/etoolbox-authoring-kit/lists/components/structure/page-list", - "sling.servlet.extensions=json", - "sling.servlet.methods=" + HttpConstants.METHOD_GET, - "sling.servlet.selectors=list" - } -) -public class ListsJsonServlet extends SlingSafeMethodsServlet { - - private static final Logger LOG = LoggerFactory.getLogger(ListsJsonServlet.class); - - private static final Gson GSON = new Gson(); - - /** - * Processes a GET request to deliver the content of an Exadel Toolbox List as a JSON array - * @param request {@code SlingHttpServletRequest} instance - * @param response {@code SlingHttpServletResponse} instance - * @throws IOException If failed to output to the response stream - */ - @Override - protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws IOException { - PageManager pageManager = request.getResourceResolver().adaptTo(PageManager.class); - Page page = pageManager != null ? pageManager.getContainingPage(request.getResource()) : null; - if (page == null) { - LOG.warn("Resource at {} cannot be adapted to a page", request.getResource().getPath()); - response.setStatus(HttpStatus.SC_NOT_FOUND); - return; - } - - Resource listResource = page.getContentResource().getChild("list"); - if (listResource == null) { - LOG.warn("Path {} does not belong to an EToolbox List", request.getResource().getPath()); - response.setStatus(HttpStatus.SC_NOT_FOUND); - return; - } - - List> result = new ArrayList<>(); - for (Resource item : listResource.getChildren()) { - if (!ListConstants.LIST_ITEM_RESOURCE_TYPE.equals(item.getResourceType())) { - continue; - } - ListItemModel listItemModel = item.adaptTo(ListItemModel.class); - if (listItemModel != null) { - result.add(listItemModel.getProperties()); - } - } - - response.setContentType(CoreConstants.CONTENT_TYPE_JSON); - response.getWriter().write(GSON.toJson(result)); - } -} diff --git a/core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java b/core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java deleted file mode 100644 index 3faea170a..000000000 --- a/core/src/test/java/com/exadel/aem/toolkit/core/lists/servlets/ListsJsonServletTest.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed under the Apache License, Version 2.0 (the "License"). - * You may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.exadel.aem.toolkit.core.lists.servlets; - -import java.io.IOException; -import java.util.List; -import java.util.Map; - -import org.apache.commons.lang3.StringUtils; -import org.apache.http.HttpStatus; -import org.apache.sling.testing.mock.sling.ResourceResolverType; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import com.google.gson.Gson; -import io.wcm.testing.mock.aem.junit.AemContext; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -import com.exadel.aem.toolkit.core.AemContextFactory; - -public class ListsJsonServletTest { - - private static final String SIMPLE_LIST_PATH = "/content/etoolbox-authoring-kit/lists/simpleList"; - private static final String CUSTOM_LIST_PATH = "/content/etoolbox-authoring-kit/lists/etoolbox-lists/customList"; - - @Rule - public AemContext context = AemContextFactory.newInstance(ResourceResolverType.JCR_OAK); - - private ListsJsonServlet servlet; - - @Before - public void setUp() { - servlet = new ListsJsonServlet(); - context.load().json("/com/exadel/aem/toolkit/core/lists/utils/simpleList.json", SIMPLE_LIST_PATH); - context.load().json("/com/exadel/aem/toolkit/core/lists/utils/customList.json", CUSTOM_LIST_PATH); - context.create().page("/content/etoolbox-authoring-kit/lists/dummy", StringUtils.EMPTY); - } - - @Test - public void shouldRetrieveSimpleJson() throws IOException { - context.request().setResource(context.resourceResolver().getResource(SIMPLE_LIST_PATH + "/jcr:content")); - servlet.doGet(context.request(), context.response()); - - assertEquals(HttpStatus.SC_OK, context.response().getStatus()); - String jsonResponse = context.response().getOutputAsString(); - - @SuppressWarnings("unchecked") - List> result = new Gson().fromJson(jsonResponse, List.class); - assertEquals(4, result.size()); - assertTrue(result.stream().allMatch(item -> item.containsKey("value"))); - } - - @Test - public void shouldRetrieveCustomJson() throws IOException { - context.request().setResource(context.resourceResolver().getResource(CUSTOM_LIST_PATH + "/jcr:content")); - servlet.doGet(context.request(), context.response()); - - assertEquals(HttpStatus.SC_OK, context.response().getStatus()); - String jsonResponse = context.response().getOutputAsString(); - - @SuppressWarnings("unchecked") - List> result = new Gson().fromJson(jsonResponse, List.class); - assertEquals(2, result.size()); - assertTrue(result.stream().allMatch(item -> item.containsKey("textValue"))); - assertTrue(result.stream().allMatch(item -> item.containsKey("booleanValue"))); - } - - @Test - public void shouldReturn404ForNonList() throws IOException { - context.request().setResource(context.resourceResolver().getResource("/content/etoolbox-authoring-kit/lists")); - servlet.doGet(context.request(), context.response()); - - assertEquals(HttpStatus.SC_NOT_FOUND, context.response().getStatus()); - - context.request().setResource(context.resourceResolver().getResource("/content/etoolbox-authoring-kit/lists/dummy")); - servlet.doGet(context.request(), context.response()); - - assertEquals(HttpStatus.SC_NOT_FOUND, context.response().getStatus()); - } -} diff --git a/pom.xml b/pom.xml index a16ab2f06..63a6f5413 100644 --- a/pom.xml +++ b/pom.xml @@ -489,12 +489,6 @@ 3.0.2 provided
- - com.google.code.gson - gson - 2.11.0 - test - com.codeborne selenide From 3b3e3347940ee87acd6274e2cfb6d9ce1653246a Mon Sep 17 00:00:00 2001 From: Stepan Miakchilo Date: Tue, 25 Feb 2025 00:56:31 +0300 Subject: [PATCH 16/16] [Tech] Switched to 2.5.4 release version --- all/pom.xml | 2 +- core/pom.xml | 2 +- docs/content/getting-started/installation.md | 6 +++--- docs/website/package-lock.json | 4 ++-- docs/website/package.json | 2 +- it.tests/pom.xml | 2 +- plugin/pom.xml | 2 +- pom.xml | 2 +- ui.apps/package-lock.json | 4 ++-- ui.apps/package.json | 2 +- ui.apps/pom.xml | 2 +- ui.content/pom.xml | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/all/pom.xml b/all/pom.xml index 14cf65cdb..5f04e4e20 100644 --- a/all/pom.xml +++ b/all/pom.xml @@ -7,7 +7,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3-SNAPSHOT + 2.5.4 etoolbox-authoring-kit-all diff --git a/core/pom.xml b/core/pom.xml index b8c85a616..1403c7bc6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -7,7 +7,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3-SNAPSHOT + 2.5.4 etoolbox-authoring-kit-core diff --git a/docs/content/getting-started/installation.md b/docs/content/getting-started/installation.md index fe9557eca..7eb2333c8 100644 --- a/docs/content/getting-started/installation.md +++ b/docs/content/getting-started/installation.md @@ -11,7 +11,7 @@ seoTitle: Installation - Exadel Authoring Kit com.exadel.etoolbox etoolbox-authoring-kit-core - 2.5.3 + 2.5.4 provided ``` @@ -21,7 +21,7 @@ seoTitle: Installation - Exadel Authoring Kit com.exadel.etoolbox etoolbox-authoring-kit-plugin - 2.5.3 + 2.5.4 @@ -79,7 +79,7 @@ You need to do two steps. com.exadel.etoolbox etoolbox-authoring-kit-all - 2.5.3 + 2.5.4 content-package ``` diff --git a/docs/website/package-lock.json b/docs/website/package-lock.json index f521ade49..d9cd03300 100644 --- a/docs/website/package-lock.json +++ b/docs/website/package-lock.json @@ -1,12 +1,12 @@ { "name": "eak-website", - "version": "2.5.3-SNAPSHOT", + "version": "2.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "eak-website", - "version": "2.5.3-SNAPSHOT", + "version": "2.5.4", "license": "ISC", "dependencies": { "@exadel/esl": "^5.0.0", diff --git a/docs/website/package.json b/docs/website/package.json index 8efede446..011841ea7 100644 --- a/docs/website/package.json +++ b/docs/website/package.json @@ -1,6 +1,6 @@ { "name": "eak-website", - "version": "2.5.3-SNAPSHOT", + "version": "2.5.4", "description": "EAK website package definition", "main": "index.js", "scripts": { diff --git a/it.tests/pom.xml b/it.tests/pom.xml index ee2042514..a48a171e5 100644 --- a/it.tests/pom.xml +++ b/it.tests/pom.xml @@ -20,7 +20,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3-SNAPSHOT + 2.5.4 etoolbox-authoring-kit-it.tests diff --git a/plugin/pom.xml b/plugin/pom.xml index 37e143d80..552a63309 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -7,7 +7,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3-SNAPSHOT + 2.5.4 etoolbox-authoring-kit-plugin diff --git a/pom.xml b/pom.xml index 63a6f5413..ce4d67a58 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3-SNAPSHOT + 2.5.4 Exadel Toolbox Authoring Kit Automates generating and managing rich and responsive authoring interfaces for Adobe Experience Manager diff --git a/ui.apps/package-lock.json b/ui.apps/package-lock.json index f3b697186..98bcf644a 100644 --- a/ui.apps/package-lock.json +++ b/ui.apps/package-lock.json @@ -1,12 +1,12 @@ { "name": "depends-on", - "version": "2.5.3-SNAPSHOT", + "version": "2.5.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "depends-on", - "version": "2.5.3-SNAPSHOT", + "version": "2.5.4", "license": "Apache-2.0", "devDependencies": { "eslint": "^9.19.0", diff --git a/ui.apps/package.json b/ui.apps/package.json index c08b19735..ac95e1627 100644 --- a/ui.apps/package.json +++ b/ui.apps/package.json @@ -1,7 +1,7 @@ { "name": "depends-on", "description": "A clientlib that executes defined action on dependent fields", - "version": "2.5.3-SNAPSHOT", + "version": "2.5.4", "private": true, "devDependencies": { "eslint": "^9.19.0", diff --git a/ui.apps/pom.xml b/ui.apps/pom.xml index 4f9dc4023..dfcb90a4d 100644 --- a/ui.apps/pom.xml +++ b/ui.apps/pom.xml @@ -7,7 +7,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3-SNAPSHOT + 2.5.4 etoolbox-authoring-kit-ui.apps diff --git a/ui.content/pom.xml b/ui.content/pom.xml index f4512ad6c..50afd361b 100644 --- a/ui.content/pom.xml +++ b/ui.content/pom.xml @@ -8,7 +8,7 @@ com.exadel.etoolbox etoolbox-authoring-kit - 2.5.3-SNAPSHOT + 2.5.4 etoolbox-authoring-kit-ui.content