Skip to content

Commit

Permalink
Merge pull request #42 from orbinson/add-distribute-method
Browse files Browse the repository at this point in the history
Add distribute method
  • Loading branch information
bdhoine authored May 2, 2023
2 parents 6399154 + 72c9637 commit 531dd0c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add distribute method using Sling Content Distribution: [#39](https://github.com/orbinson/aem-groovy-console/issues/39)

## [19.0.3] - 2023-02-21

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ class AemScriptMetaClassExtensionProvider implements ScriptMetaClassExtensionPro
replicator.replicate(session, ReplicationActionType.DELETE, path, options)
}

delegate.distribute { String path, String agentId = "publish", boolean isDeep = false ->
DistributionRequest distributionRequest = new SimpleDistributionRequest(DistributionRequestType.ADD, isDeep, path);
distributor.distribute(agentId, resourceResolver, distributionRequest);
}

delegate.invalidate { String path, String agentId = "publish", boolean isDeep = false ->
DistributionRequest distributionRequest = new SimpleDistributionRequest(DistributionRequestType.INVALIDATE, isDeep, path);
distributor.distribute(agentId, resourceResolver, distributionRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ <h4 class="panel-title">
<li>deactivate(String path, ReplicationOptions options) - <span class="muted">Deactivate the node at the given path with supplied options.</span></li>
<li>delete(String path) - <span class="muted">Delete the node at the given path.</span></li>
<li>delete(String path, ReplicationOptions options) - <span class="muted">Delete the node at the given path with supplied options.</span></li>
<li>distribute(String path, String agentId = "publish", boolean isDeep = "false") - <span class="muted">Distribute the node at the given path with supplied options. (Only applicable on AEMaaCS)</span></li>
<li>invalidate(String path, String agentId = "publish", boolean isDeep = "false") - <span class="muted">Invalidate the node at the given path with supplied options. (Only applicable on AEMaaCS)</span></li>
<li>createQuery(Map predicates) - <span class="muted">Create a <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/search/Query.html" target="_blank">Query</a> instance from the <a href="https://developer.adobe.com/experience-manager/reference-materials/6-5/javadoc/com/day/cq/search/QueryBuilder.html" target="_blank">QueryBuilder</a> for the current JCR session.</span></li>
<li>xpathQuery(String query) - <span class="muted">Execute an XPath query using the <a href="https://developer.adobe.com/experience-manager/reference-materials/spec/jsr170/javadocs/jcr-2.0/javax/jcr/query/QueryManager.html" target="_blank">QueryManager</a> for the current JCR session.</span></li>
Expand Down

0 comments on commit 531dd0c

Please sign in to comment.