Class UsersExportServlet

  • All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

    @SlingServlet(label="ACS AEM Commons - Users to CSV - Export Servlet",
                  methods="GET",
                  resourceTypes="acs-commons/components/utilities/exporters/users-to-csv",
                  selectors="export",
                  extensions="csv")
    public class UsersExportServlet
    extends org.apache.sling.api.servlets.SlingSafeMethodsServlet
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  UsersExportServlet.CsvUser
      Internal class representing a user that will be exported in CSV format.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean checkGroups​(String[] groups, String groupFilter, UsersExportServlet.CsvUser csvUser)
      Determines if the user should be included based on the specified group filter type, and requested groups.
      void doGet​(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
      Generates a CSV file representing the User Data.
      • Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet

        doGeneric, doHead, doOptions, doTrace, getAllowedRequestMethods, getServletInfo, handleMethodNotImplemented, mayService, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log
    • Constructor Detail

      • UsersExportServlet

        public UsersExportServlet()
    • Method Detail

      • doGet

        public void doGet​(org.apache.sling.api.SlingHttpServletRequest request,
                          org.apache.sling.api.SlingHttpServletResponse response)
                   throws IOException,
                          javax.servlet.ServletException
        Generates a CSV file representing the User Data.
        Overrides:
        doGet in class org.apache.sling.api.servlets.SlingSafeMethodsServlet
        Parameters:
        request - the Sling HTTP Request object
        response - the Sling HTTP Response object
        Throws:
        IOException
        javax.servlet.ServletException
      • checkGroups

        protected boolean checkGroups​(String[] groups,
                                      String groupFilter,
                                      UsersExportServlet.CsvUser csvUser)
                               throws javax.jcr.RepositoryException
        Determines if the user should be included based on the specified group filter type, and requested groups.
        Parameters:
        groups - the groups
        groupFilter - the groupFilter
        csvUser - the user
        Returns:
        true if the user should be included.
        Throws:
        javax.jcr.RepositoryException