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

Redirects Manager: rules are not orderable and not replicated #3503

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com)

## Unreleased ([details][unreleased changes details])

### Fixed

- # - Redirect Manager: ensure redirect configurations are orderable

## 6.10.0 - 2024-12-13

### Changed

- #3494 - Remove offline instrumentation with Jacoco
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse
if (config == null) {
String contextPrefix = StringUtils.defaultString(request.getParameter(REQ_PARAM_CTX_PREFIX));
config = resolver.create(bucket, configName,
ImmutableMap.of(JcrConstants.JCR_PRIMARYTYPE, JcrResourceConstants.NT_SLING_FOLDER,
ImmutableMap.of(JcrConstants.JCR_PRIMARYTYPE, JcrResourceConstants.NT_SLING_ORDERED_FOLDER,
ResourceResolver.PROPERTY_RESOURCE_TYPE, REDIRECTS_RESOURCE_PATH,
REQ_PARAM_CTX_PREFIX, contextPrefix));
log.info("created {} with context prefix '{}'", config.getPath(), contextPrefix);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,27 @@
import="
javax.jcr.Session,
javax.jcr.Node,
javax.jcr.nodetype.NodeType,
java.util.*,
java.io.PrintWriter,
com.day.cq.replication.Replicator,
com.day.cq.replication.ReplicationOptions,
com.day.cq.replication.ReplicationActionType" %><pre><%

String path = request.getParameter("path");
Resource configResource = resourceResolver.getResource(path);

Replicator replicator = sling.getService(Replicator.class);
ReplicationOptions opts = new ReplicationOptions();
opts.setSuppressVersions(true);
replicator.replicate(resourceResolver.adaptTo(Session.class), ReplicationActionType.ACTIVATE, path, null);
Session session = resourceResolver.adaptTo(Session.class);
replicator.replicate(session, ReplicationActionType.ACTIVATE, path, null);
out.println("Replicating: " + path);

if(!configResource.adaptTo(Node.class).isNodeType(NodeType.NT_HIERARCHY_NODE)){
for(Resource res : configResource.getChildren()){
replicator.replicate(session, ReplicationActionType.ACTIVATE, res.getPath(), null);
out.println("Replicating: " + res.getPath());
}
}
%></pre>
Loading