Skip to content

Commit

Permalink
Merge branch 'master' into contentsync
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgonzalez authored Oct 1, 2024
2 parents d0f439e + 59c62cf commit ec93809
Show file tree
Hide file tree
Showing 23 changed files with 180 additions and 88 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com)
<!-- Keep this up to date! After a release, change the tag name to the latest release -->-

## Unreleased ([details][unreleased changes details])
- #3426 - Content Sync: view history of completed jobs

### Changed

- #3420 - Redirect Map Manager - enable Redirect Map Manager in AEM CS (would require a specific - not public yet - AEM CS release version, TBA)
- #3423 - Redirect Manager - status code is not retaining its value in the dialog after authoring

## 6.6.4 - 2024-08-14
- #3417 - Configurable recursion in Content Sync
Expand Down
2 changes: 1 addition & 1 deletion 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.6.5-SNAPSHOT</version>
<version>6.7.0-SNAPSHOT</version>
</parent>

<!-- ====================================================================== -->
Expand Down
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.6.5-SNAPSHOT</version>
<version>6.7.0-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.6.5-SNAPSHOT</version>
<version>6.7.0-SNAPSHOT</version>
</parent>

<!-- ====================================================================== -->
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.6.5-SNAPSHOT</version>
<version>6.7.0-SNAPSHOT</version>
</parent>

<!-- ====================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@
package com.adobe.acs.commons.contentsync;

import com.adobe.acs.commons.contentsync.impl.LastModifiedStrategy;
import org.apache.jackrabbit.JcrConstants;
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.api.resource.ResourceUtil;

import java.io.ByteArrayInputStream;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

import static com.adobe.acs.commons.contentsync.RemoteInstance.CONNECT_TIMEOUT;
import static com.adobe.acs.commons.contentsync.RemoteInstance.SOCKET_TIMEOUT;
Expand Down Expand Up @@ -64,4 +68,34 @@ public static Resource getHostsResource(ResourceResolver resourceResolver) throw
resourceProperties.put(JCR_PRIMARYTYPE, NT_UNSTRUCTURED);
return ResourceUtil.getOrCreateResource(resourceResolver, HOSTS_PATH, resourceProperties, NT_SLING_FOLDER, true);
}

public static void persistAuditLog(ResourceResolver resourceResolver, String path, long count, String data) throws PersistenceException {

String auditHome = CONFIG_PATH + "/audit";
ResourceUtil.getOrCreateResource(resourceResolver, auditHome,
Collections.singletonMap(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED), JcrConstants.NT_FOLDER, false);

Map<String, Object> auditProps = new HashMap<>();
auditProps.put(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED);
auditProps.put("syncPath", path);
auditProps.put(JcrConstants.JCR_MIXINTYPES, "mix:created");
auditProps.put("count", count);
String auditResourcePath = auditHome + "/" + UUID.randomUUID();
ResourceUtil.getOrCreateResource(resourceResolver, auditResourcePath, auditProps, null, false);

String auditLogPath = auditResourcePath + "/log";
ResourceUtil.getOrCreateResource(resourceResolver, auditLogPath,
Collections.singletonMap(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_FILE), null, false);

Map<String, Object> props = new HashMap<>();
props.put(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_RESOURCE);
props.put(JcrConstants.JCR_MIMETYPE, "text/plain");

props.put(JcrConstants.JCR_DATA, new ByteArrayInputStream(data.getBytes()));

ResourceUtil.getOrCreateResource(resourceResolver, auditLogPath + "/" + JcrConstants.JCR_CONTENT,
props, null, false);

resourceResolver.commit();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
* limitations under the License.
* #L%
*/
@org.osgi.annotation.versioning.Version("1.1.0")
@org.osgi.annotation.versioning.Version("1.2.0")
package com.adobe.acs.commons.contentsync;
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@

import javax.servlet.ServletException;

import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingAllMethodsServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adobe.acs.commons.util.RequireAem;

/**
* Servlet for adding a line into the redirect map text file
*/
Expand All @@ -43,10 +40,6 @@ public class AddEntryServlet extends SlingAllMethodsServlet {
private static final long serialVersionUID = -1704915461516132101L;
private static final Logger log = LoggerFactory.getLogger(AddEntryServlet.class);

// Disable this feature on AEM as a Cloud Service
@Reference(target="(distribution=classic)")
transient RequireAem requireAem;

@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
throws ServletException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,20 @@

import javax.servlet.ServletException;

import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adobe.acs.commons.util.RequireAem;

/**
* Servlet rendering the redirect map to a JSON Array
*/
@SlingServlet(methods = { "GET" }, resourceTypes = { "acs-commons/components/utilities/redirectmappage" }, selectors = {
"redirectentries" }, extensions = { "json" }, metatype = false)
public class RedirectEntriesServlet extends SlingSafeMethodsServlet {

// Disable this feature on AEM as a Cloud Service
@Reference(target="(distribution=classic)")
transient RequireAem requireAem;

private static final long serialVersionUID = -2825679173210628699L;
private static final Logger log = LoggerFactory.getLogger(RedirectEntriesServlet.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import javax.servlet.ServletException;

import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
Expand All @@ -31,7 +30,6 @@
import org.slf4j.LoggerFactory;

import com.adobe.acs.commons.redirectmaps.models.RedirectMapModel;
import com.adobe.acs.commons.util.RequireAem;
import com.google.common.net.MediaType;

/**
Expand All @@ -45,10 +43,6 @@ public class RedirectMapServlet extends SlingSafeMethodsServlet {
private static final Logger log = LoggerFactory.getLogger(RedirectMapServlet.class);
private static final long serialVersionUID = -3564475196678277711L;

// Disable this feature on AEM as a Cloud Service
@Reference(target="(distribution=classic)")
transient RequireAem requireAem;

@Override
protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
throws ServletException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@

import javax.servlet.ServletException;

import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingAllMethodsServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adobe.acs.commons.util.RequireAem;

/**
* Servlet for removing a line from the redirect map text file
*/
Expand All @@ -43,10 +40,6 @@ public class RemoveEntryServlet extends SlingAllMethodsServlet {
private static final long serialVersionUID = -5963945855717054678L;
private static final Logger log = LoggerFactory.getLogger(RemoveEntryServlet.class);

// Disable this feature on AEM as a Cloud Service
@Reference(target="(distribution=classic)")
transient RequireAem requireAem;

@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
throws ServletException, IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,13 @@

import javax.servlet.ServletException;

import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.servlets.SlingAllMethodsServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.adobe.acs.commons.util.RequireAem;

/**
* Servlet for updating a line in the redirect map text file
*/
Expand All @@ -43,10 +40,6 @@ public class UpdateEntryServlet extends SlingAllMethodsServlet {
private static final long serialVersionUID = -1704915461516132101L;
private static final Logger log = LoggerFactory.getLogger(UpdateEntryServlet.class);

// Disable this feature on AEM as a Cloud Service
@Reference(target="(distribution=classic)")
transient RequireAem requireAem;

@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
throws ServletException, IOException {
Expand Down
2 changes: 1 addition & 1 deletion oakpal-checks/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.6.5-SNAPSHOT</version>
<version>6.7.0-SNAPSHOT</version>
</parent>

<!-- ====================================================================== -->
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<groupId>com.adobe.acs</groupId>
<artifactId>acs-aem-commons</artifactId>
<version>6.6.5-SNAPSHOT</version>
<version>6.7.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>ACS AEM Commons - Reactor Project</name>
Expand Down
2 changes: 1 addition & 1 deletion ui.apps/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.6.5-SNAPSHOT</version>
<version>6.7.0-SNAPSHOT</version>
</parent>

<!-- ====================================================================== -->
Expand Down
Loading

0 comments on commit ec93809

Please sign in to comment.