diff --git a/guacamole/src/main/frontend/src/app/rest/types/DirectoryPatch.js b/guacamole/src/main/frontend/src/app/rest/types/DirectoryPatch.js index fb2a3c050..664dcdcdf 100644 --- a/guacamole/src/main/frontend/src/app/rest/types/DirectoryPatch.js +++ b/guacamole/src/main/frontend/src/app/rest/types/DirectoryPatch.js @@ -59,7 +59,7 @@ angular.module('rest').factory('DirectoryPatch', [function defineDirectoryPatch( this.path = template.path || '/'; /** - * The object being added, or undefined if deleting. + * The object being added/replaced, or undefined if deleting. * * @type {DirectoryObject} */ @@ -77,6 +77,11 @@ angular.module('rest').factory('DirectoryPatch', [function defineDirectoryPatch( */ ADD : 'add', + /** + * Replaces (updates) the specified object from the relation. + */ + REPLACE : 'replace', + /** * Removes the specified object from the relation. */ diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java index 0230051a9..0ea12c3ef 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/directory/DirectoryResource.java @@ -478,18 +478,18 @@ public abstract class DirectoryResource addedObjects = new ArrayList<>(); + Collection replacedObjects = new ArrayList<>(); Collection removedIdentifiers = new ArrayList<>(); // A list of all responses associated with the successful @@ -590,7 +591,56 @@ public abstract class DirectoryResource updatedIterator = replacedObjects.iterator(); + while (updatedIterator.hasNext()) { + + InternalType internal = updatedIterator.next(); + fireDirectorySuccessEvent( + DirectoryEvent.Operation.UPDATE, + internal.getIdentifier(), internal); + + } + // Fire directory success events for each removed object Iterator removedIterator = removedIdentifiers.iterator(); while (removedIterator.hasNext()) {