Skip to content

Commit

Permalink
Fixed folder publish order bug and folder detection bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Robert committed Sep 28, 2020
1 parent ff93c0f commit 91318d0
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,20 @@ protected static enum QueueMethod {
)
private ReplicationFilter publishFilter = ReplicationFilter.FOLDERS_ONLY;

@FormField(name = "Queueing Method",
component = SelectComponent.EnumerationSelector.class,
description = "For small publishing tasks, standard is sufficient. For large folder trees, MCP is recommended.",
options = "default=USE_MCP_QUEUE")
QueueMethod queueMethod = QueueMethod.USE_MCP_QUEUE;

@FormField(name = "Agents",
component = TextfieldComponent.class,
hint = "(leave blank for default agents)",
description = "Publish agents to use, if blank then all default agents will be used. Multiple agents can be listed using commas or regex.")
private String agents = null;
List<String> agentList = new ArrayList<>();
AgentFilter replicationAgentFilter;

@FormField(name = "Queueing Method",
component = SelectComponent.EnumerationSelector.class,
description = "For small publishing tasks, standard is sufficient. For large folder trees, MCP is recommended.",
options = "default=USE_MCP_QUEUE")
QueueMethod queueMethod = QueueMethod.USE_MCP_QUEUE;

@FormField(name = "Dry Run",
component = CheckboxComponent.class,
options = "checked",
Expand Down Expand Up @@ -162,7 +163,7 @@ public void storeReport(ProcessInstance instance, ResourceResolver rr) throws Re

// Should match nt:folder, sling:OrderedFolder, sling:UnorderedFolder, etc
public static Boolean isFolder(Resource res) {
String primaryType = String.valueOf(res.getResourceMetadata().get("jcr:primaryType"));
String primaryType = String.valueOf(res.getResourceType());
return (primaryType.toLowerCase().contains("folder"));
}

Expand All @@ -171,7 +172,7 @@ private void activateTreeStructure(ActionManager t) {
visitor.setResourceVisitorChecked((resource, u) -> {
String path = resource.getPath();
if (publishFilter.shouldReplicate(resource)) {
t.deferredWithResolver(rr -> performReplication(t, path));
t.withResolver(rr -> performReplication(t, path));
} else {
record(path, "Skip", "Skipping folder");
}
Expand Down

0 comments on commit 91318d0

Please sign in to comment.