Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
cziegeler authored Oct 2, 2024
2 parents 82043ea + a9e5165 commit 45ce3a2
Show file tree
Hide file tree
Showing 36 changed files with 5,292 additions and 559 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com)
### Added

- #3415 - Allow Robots.txt generation to serve different file by requested resource path
- #3417 - Configurable recursion in Content Sync
- #3426 - Content Sync: view history of completed jobs
- #3417 - Configurable recursion in Content Sync

### Changed

- #3420 - Redirect Map Manager - enable Redirect Map Manager in AEM CS (would require a specific - not public yet - AEM CS release version, TBA)
- #3421 - Remove dependency on Apache Commons Lang 2 for Cloud Service
- #3429 - UI Widgets - add uniq function to embedded lodash library to resolve issue with composite multifield widget
- #3423 - Redirect Manager - status code is not retaining its value in the dialog after authoring
- #3417 - Configurable recursion in Content Sync

### Fixed

- #3413 - Redirect Manager: Interface triggers an error because of wrong deprecated resource type

## 6.6.4 - 2024-08-14

Expand All @@ -32,9 +38,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.
Expand All @@ -46,7 +54,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
Expand Down
26 changes: 24 additions & 2 deletions all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons</artifactId>
<version>6.7.0-SNAPSHOT</version>
<version>6.7.1-SNAPSHOT</version>
</parent>

<!-- ====================================================================== -->
Expand All @@ -35,7 +35,7 @@
<artifactId>acs-aem-commons-all</artifactId>
<name>ACS AEM Commons Container Package (All)</name>
<description>ACS AEM Commons container content package which delivers acs-aem-commons-ui.apps,
acs-aem-commons-ui.content, the OSGi bundle and configuration.
acs-aem-commons-ui.content, acs-aem-commons-ui.config and the OSGi bundle.
</description>
<packaging>content-package</packaging>

Expand All @@ -47,6 +47,7 @@
<inherited>false</inherited>
<configuration>
<packageType>container</packageType>
<excludes>**/META-INF/*,**/thumbnail.png</excludes>
</configuration>
<executions>
<execution>
Expand Down Expand Up @@ -86,6 +87,13 @@
<filter>true</filter>
<isAllVersionsFilter>true</isAllVersionsFilter>
</embedded>
<embedded>
<groupId>${project.groupId}</groupId>
<artifactId>acs-aem-commons-ui.config</artifactId>
<target>/apps/acs-commons/install</target>
<filter>true</filter>
<isAllVersionsFilter>true</isAllVersionsFilter>
</embedded>
</embeddeds>
</configuration>
</execution>
Expand Down Expand Up @@ -210,6 +218,13 @@
<type>zip</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>acs-aem-commons-ui.config</artifactId>
<version>${project.version}</version>
<type>zip</type>
<scope>provided</scope>
</dependency>
</dependencies>

<profiles>
Expand Down Expand Up @@ -292,6 +307,13 @@
<filter>true</filter>
<isAllVersionsFilter>true</isAllVersionsFilter>
</embedded>
<embedded>
<groupId>${project.groupId}</groupId>
<artifactId>acs-aem-commons-ui.config</artifactId>
<target>/apps/acs-commons/install</target>
<filter>true</filter>
<isAllVersionsFilter>true</isAllVersionsFilter>
</embedded>
</embeddeds>
</configuration>
</execution>
Expand Down
5 changes: 1 addition & 4 deletions all/src/main/content/META-INF/vault/filter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,5 @@
-->

<workspaceFilter version="1.0">
<filter root="/apps/acs-commons/config"/>
<filter root="/apps/acs-commons/config.author"/>
<filter root="/apps/acs-commons/config.publish"/>
<filter root="/apps/acs-commons/config.rde" type="cleanup"/>
<filter root="/apps/acs-commons/install"/>
</workspaceFilter>
2 changes: 1 addition & 1 deletion bundle-cloud/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons</artifactId>
<version>6.7.0-SNAPSHOT</version>
<version>6.7.1-SNAPSHOT</version>
</parent>

<!-- ====================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion bundle-onprem/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons</artifactId>
<version>6.7.0-SNAPSHOT</version>
<version>6.7.1-SNAPSHOT</version>
</parent>

<!-- ====================================================================== -->
Expand Down
1 change: 1 addition & 0 deletions bundle/bnd.bnd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<parent>
<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons</artifactId>
<version>6.7.0-SNAPSHOT</version>
<version>6.7.1-SNAPSHOT</version>
</parent>

<!-- ====================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RefreshFolderTumbnails> {

// Disable this feature on AEM as a Cloud Service
Expand All @@ -35,18 +33,14 @@ public class RefreshFolderThumbnailsFactory extends ProcessDefinitionFactory<Ref

@Reference
private SlingRequestProcessor slingProcessor;

@Reference
RequestResponseFactory reqRspFactory;


@Override
public String getName() {
return "Refresh asset folder thumbnails";
}

@Override
protected RefreshFolderTumbnails createProcessDefinitionInstance() {
return new RefreshFolderTumbnails(reqRspFactory, slingProcessor);
return new RefreshFolderTumbnails(slingProcessor);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,40 @@
*/
package com.adobe.acs.commons.mcp.impl.processes;

import com.adobe.acs.commons.fam.ActionManager;
import com.adobe.acs.commons.fam.actions.ActionBatch;
import com.adobe.acs.commons.functions.CheckedFunction;
import com.adobe.acs.commons.mcp.ProcessDefinition;
import com.adobe.acs.commons.mcp.ProcessInstance;
import com.adobe.acs.commons.mcp.form.CheckboxComponent;
import com.adobe.acs.commons.mcp.form.FormField;
import com.adobe.acs.commons.mcp.form.PathfieldComponent;
import com.adobe.acs.commons.mcp.form.RadioComponent;
import com.adobe.acs.commons.mcp.model.GenericBlobReport;
import com.adobe.acs.commons.util.visitors.TreeFilteringResourceVisitor;
import com.day.cq.commons.jcr.JcrConstants;
import com.day.cq.contentsync.handler.util.RequestResponseFactory;
import com.day.cq.dam.api.DamConstants;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.jcr.RepositoryException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.output.NullOutputStream;

import org.apache.sling.api.request.builder.Builders;
import org.apache.sling.api.resource.LoginException;
import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.engine.SlingRequestProcessor;

import com.adobe.acs.commons.fam.ActionManager;
import com.adobe.acs.commons.fam.actions.ActionBatch;
import com.adobe.acs.commons.functions.CheckedFunction;
import com.adobe.acs.commons.mcp.ProcessDefinition;
import com.adobe.acs.commons.mcp.ProcessInstance;
import com.adobe.acs.commons.mcp.form.CheckboxComponent;
import com.adobe.acs.commons.mcp.form.FormField;
import com.adobe.acs.commons.mcp.form.PathfieldComponent;
import com.adobe.acs.commons.mcp.form.RadioComponent;
import com.adobe.acs.commons.mcp.model.GenericBlobReport;
import com.adobe.acs.commons.util.visitors.TreeFilteringResourceVisitor;
import com.day.cq.commons.jcr.JcrConstants;
import com.day.cq.dam.api.DamConstants;

/**
* Replace folder thumbnails under a user-definable set of circumstances As a business user, I would like an easy way to
* scan and repair missing thumbnails, or just regenerate all thumbnails under a given tree of the DAM.
Expand Down Expand Up @@ -83,16 +83,8 @@ public boolean shouldReplace(Resource r) throws Exception {

public static final String FOLDER_THUMBNAIL = "/jcr:content/folderThumbnail";

private static Map<String, Object> 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",
Expand All @@ -113,8 +105,7 @@ public boolean shouldReplace(Resource r) throws Exception {

private transient List<String> foldersToReplace = Collections.synchronizedList(new ArrayList<>());

public RefreshFolderTumbnails(RequestResponseFactory reqRspFactory, SlingRequestProcessor slingProcessor) {
this.requestFactory = reqRspFactory;
public RefreshFolderTumbnails(SlingRequestProcessor slingProcessor) {
this.slingProcessor = slingProcessor;
}

Expand Down Expand Up @@ -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");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,11 @@ private String handleMatchingPatternAttribute(Pattern pattern, String attrValue)
url = prependHostName(url);
// Added check to determine whether the existing host has to be replaced
if (this.replaceHost) {
int index = attrValue.indexOf("://");
sb.setLength(0);
sb.append(attrValue, 0, index + 1);
if (!url.contains("://")) {
String reuseScheme = attrValue.substring(0, attrValue.indexOf("://") + 1);
sb.append(reuseScheme);
}
sb.append(url);
} else {
m.appendReplacement(sb, Matcher.quoteReplacement(url));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,9 @@ public String getContentType() {
public void setContentType(@Nullable String contentType) {

}

@Override
public @Nullable Calendar getLastModified() {
return null;
}
}
Loading

0 comments on commit 45ce3a2

Please sign in to comment.