Class UpdateGroupServlet

java.lang.Object
jakarta.servlet.GenericServlet
org.apache.sling.api.servlets.SlingJakartaSafeMethodsServlet
All Implemented Interfaces:
jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable, UpdateGroup

public class UpdateGroupServlet extends AbstractGroupPostServlet implements UpdateGroup

Sling Post Operation implementation for updating a group in the jackrabbit UserManager.

Rest Service Description

Updates a group's properties. Maps on to nodes of resourceType sling/groups like /rep:system/rep:userManager/rep:groups/ae/3f/ed/testGroup mapped to a resource url /system/userManager/group/testGroup. This servlet responds at /system/userManager/group/testGroup.update.html

Methods

  • POST

Post Parameters

*
Any additional parameters become properties of the group node (optional)
*@Delete
The property is deleted, eg prop1@Delete

Response

200
Success, a redirect is sent to the group's resource locator. The redirect comes with HTML describing the status.
404
The resource was not found
500
Failure

Example

curl -Fprop1=value2 -Fproperty1=value1 http://localhost:8080/system/userManager/group/testGroup.update.html
See Also:
  • Constructor Details

    • UpdateGroupServlet

      public UpdateGroupServlet()
  • Method Details

    • activate

      protected void activate(Map<String,Object> props)
      Overrides:
      activate in class AbstractAuthorizablePostServlet
    • deactivate

      protected void deactivate()
      Overrides:
      deactivate in class AbstractAuthorizablePostServlet
    • bindPostResponseCreator

      protected void bindPostResponseCreator(org.apache.sling.servlets.post.JakartaPostResponseCreator creator, Map<String,Object> properties)
      Overridden since the @Reference annotation is not inherited from the super method
      Overrides:
      bindPostResponseCreator in class AbstractPostServlet
      See Also:
    • unbindPostResponseCreator

      protected void unbindPostResponseCreator(org.apache.sling.servlets.post.JakartaPostResponseCreator creator, Map<String,Object> properties)
      Description copied from class: AbstractPostServlet
      Unbind a post response creator
      Overrides:
      unbindPostResponseCreator in class AbstractPostServlet
    • handleOperation

      protected void handleOperation(org.apache.sling.api.SlingJakartaHttpServletRequest request, org.apache.sling.servlets.post.JakartaPostResponse response, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryException
      Description copied from class: AbstractPostServlet
      Extending Servlet should implement this operation to do the work
      Specified by:
      handleOperation in class AbstractPostServlet
      Parameters:
      request - the sling http request to process
      response - the response
      changes - the changes to report
      Throws:
      javax.jcr.RepositoryException - in case of exceptions during the operation
    • updateGroup

      public org.apache.jackrabbit.api.security.user.Group updateGroup(javax.jcr.Session jcrSession, String name, Map<String,?> properties, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryException
      Description copied from interface: UpdateGroup
      Update a group in the repository
      Specified by:
      updateGroup in interface UpdateGroup
      Parameters:
      jcrSession - the JCR session of the user creating the group
      name - The name of the group to update (required)
      properties - Extra properties to update on the group. The entry values should be either a String or String[] (optional)
      changes - The list of changes for this operation (optional)
      Returns:
      the group that was updated or null if not found
      Throws:
      javax.jcr.RepositoryException - if group can't be updated