diff --git a/CHANGELOG.md b/CHANGELOG.md index 39d4d43e13..ca131d319d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com) - #3415 - Allow Robots.txt generation to serve different file by requested resource path - #3426 - Content Sync: view history of completed jobs +- #3417 - Configurable recursion in Content Sync ### Changed @@ -36,9 +37,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com) - #3357 - Added debugging and null checking to ReferencesModel to prevent NPE - #3398 - CreateRedirectConfigurationServlet throws PersistenceException when ancestor node types are different than expected - #3275 - CCVAR: Fixed Same Attribute not updating correctly. +- #3402 - EnsureOakIndexManagerImpl does not pick up changes in EnsureOakIndex configurations. ### Changed +- #3403 - Replace deprecated com.day.cq.contentsync.handler.util.RequestResponseFactory by SlingHttpServletRequestBuilder - #3376 - Redirect Manager: refactor code to not require service user - #3408 - Reduce usage of Apache Commons Lang 2 - #3401 - Move SyslogAppender into separate bundle for onprem only. SyslogAppender does not work in Cloud Service. @@ -50,7 +53,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com) - #3355 - Fixed system notifications dismissal, and upgraded to CoralUI 3. - ### Added - #3333 - Use lodash embedded by ACS AEM Commons diff --git a/bundle/bnd.bnd b/bundle/bnd.bnd index 703ee8a1d3..8aec531d39 100644 --- a/bundle/bnd.bnd +++ b/bundle/bnd.bnd @@ -19,6 +19,7 @@ Import-Package: \ !io.jsonwebtoken.*,\ !org.bouncycastle.jce.*,\ !org.checkerframework.checker.nullness.qual,\ + com.day.cq.wcm.api;version="[1.30,2)",\ * # support processing of legacy Felix SCR annotations through the felix.scr.bnd plugin, look at https://github.com/apache/felix/blob/trunk/tools/org.apache.felix.scr.bnd/src/main/java/org/apache/felix/scrplugin/bnd/SCRDescriptorBndPlugin.java#L60 # paths require special handling: https://bnd.bndtools.org/chapters/820-instructions.html#file diff --git a/bundle/src/main/java/com/adobe/acs/commons/mcp/impl/processes/RefreshFolderThumbnailsFactory.java b/bundle/src/main/java/com/adobe/acs/commons/mcp/impl/processes/RefreshFolderThumbnailsFactory.java index fb95720f26..3da88d57e5 100644 --- a/bundle/src/main/java/com/adobe/acs/commons/mcp/impl/processes/RefreshFolderThumbnailsFactory.java +++ b/bundle/src/main/java/com/adobe/acs/commons/mcp/impl/processes/RefreshFolderThumbnailsFactory.java @@ -17,16 +17,14 @@ */ package com.adobe.acs.commons.mcp.impl.processes; +import org.apache.sling.engine.SlingRequestProcessor; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Reference; + import com.adobe.acs.commons.mcp.ProcessDefinitionFactory; import com.adobe.acs.commons.util.RequireAem; -import com.day.cq.contentsync.handler.util.RequestResponseFactory; -import org.apache.felix.scr.annotations.Component; -import org.apache.felix.scr.annotations.Service; -import org.apache.felix.scr.annotations.Reference; -import org.apache.sling.engine.SlingRequestProcessor; -@Component -@Service(ProcessDefinitionFactory.class) +@Component(service = ProcessDefinitionFactory.class) public class RefreshFolderThumbnailsFactory extends ProcessDefinitionFactory { // Disable this feature on AEM as a Cloud Service @@ -35,10 +33,7 @@ public class RefreshFolderThumbnailsFactory extends ProcessDefinitionFactory THUMBNAIL_PARAMS = new HashMap<>(); - - static { - THUMBNAIL_PARAMS.put("width", "200"); - THUMBNAIL_PARAMS.put("height", "120"); - } - private static final int PLACEHOLDER_SIZE = 1024; - private RequestResponseFactory requestFactory; private SlingRequestProcessor slingProcessor; @FormField(name = "Starting Path", @@ -113,8 +105,7 @@ public boolean shouldReplace(Resource r) throws Exception { private transient List foldersToReplace = Collections.synchronizedList(new ArrayList<>()); - public RefreshFolderTumbnails(RequestResponseFactory reqRspFactory, SlingRequestProcessor slingProcessor) { - this.requestFactory = reqRspFactory; + public RefreshFolderTumbnails(SlingRequestProcessor slingProcessor) { this.slingProcessor = slingProcessor; } @@ -197,12 +188,20 @@ private void rebuildThumbnails(ActionManager manager) { } private void rebuildThumbnail(ResourceResolver rr, String folderPath) throws ServletException, IOException { - HttpServletRequest req = requestFactory.createRequest("GET", folderPath + ".folderthumbnail.jpg", THUMBNAIL_PARAMS); - try (NullOutputStream out = new NullOutputStream()) { - HttpServletResponse res = requestFactory.createResponse(out); - slingProcessor.processRequest(req, res, rr); - res.flushBuffer(); + Resource resource = rr.getResource(folderPath); + if (resource == null) { + throw new IllegalArgumentException("Resource not found at " + folderPath); } + HttpServletRequest req = Builders.newRequestBuilder(resource) + .withRequestMethod("GET") + .withSelectors("folderthumbnail") + .withExtension("jpg") + .withParameter("width", "200") + .withParameter("height", "120") + .build(); + HttpServletResponse res = Builders.newResponseBuilder().build(); + slingProcessor.processRequest(req, res, rr); + res.flushBuffer(); record(folderPath, "Rebuild", "Thumbnail was rebuilt"); } diff --git a/bundle/src/test/java/com/adobe/acs/commons/mcp/impl/processes/cfi/MockContentFragment.java b/bundle/src/test/java/com/adobe/acs/commons/mcp/impl/processes/cfi/MockContentFragment.java index 182226bca9..5e7811bd92 100644 --- a/bundle/src/test/java/com/adobe/acs/commons/mcp/impl/processes/cfi/MockContentFragment.java +++ b/bundle/src/test/java/com/adobe/acs/commons/mcp/impl/processes/cfi/MockContentFragment.java @@ -26,6 +26,7 @@ import com.adobe.cq.dam.cfm.VariationTemplate; import com.adobe.cq.dam.cfm.VersionDef; import com.adobe.cq.dam.cfm.VersionedContent; +import com.day.cq.tagging.Tag; import java.util.Calendar; import java.util.HashMap; @@ -176,5 +177,27 @@ public void removeVariation(String name) throws ContentFragmentException { public Calendar getLastModifiedDeep() throws ContentFragmentException { return Calendar.getInstance(); } - + + @Override + public @Nullable Calendar getLastModifiedDate() { + return Calendar.getInstance(); + } + + @Override + public @NotNull Tag[] getTags() throws ContentFragmentException { + return new Tag[0]; + } + + @Override + public @NotNull Tag[] getVariationTags(@NotNull String arg0) throws ContentFragmentException { + return new Tag[0]; + } + + @Override + public void setTags(@NotNull Tag[] arg0) throws ContentFragmentException { + } + + @Override + public void setVariationTags(@NotNull Tag[] arg0, @NotNull String arg1) throws ContentFragmentException { + } } diff --git a/bundle/src/test/java/com/adobe/acs/commons/mcp/impl/processes/cfi/MockFragmentData.java b/bundle/src/test/java/com/adobe/acs/commons/mcp/impl/processes/cfi/MockFragmentData.java index 3787099ca4..229dcb8e92 100755 --- a/bundle/src/test/java/com/adobe/acs/commons/mcp/impl/processes/cfi/MockFragmentData.java +++ b/bundle/src/test/java/com/adobe/acs/commons/mcp/impl/processes/cfi/MockFragmentData.java @@ -76,4 +76,9 @@ public String getContentType() { public void setContentType(@Nullable String contentType) { } + + @Override + public @Nullable Calendar getLastModified() { + return null; + } } diff --git a/pom.xml b/pom.xml index 8d68465ee4..f281353197 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ - 6.5.10.0002 + 6.5.21.0000 2023.11.14227.20231108T162349Z-231100