Class AbstractAuthorizablePostServlet

    • Field Detail

      • RP_NODE_NAME_VALUE_FROM

        protected static final String RP_NODE_NAME_VALUE_FROM
      • RP_NODE_NAME_HINT_VALUE_FROM

        protected static final String RP_NODE_NAME_HINT_VALUE_FROM
      • principalNameGenerators

        protected transient LinkedList<org.apache.sling.jackrabbit.usermanager.impl.post.AbstractAuthorizablePostServlet.PrincipalNameGeneratorHolder> principalNameGenerators
        The principal name generators
      • principalNameFilter

        protected transient PrincipalNameFilter principalNameFilter
        The optional principal name filter
    • Constructor Detail

      • AbstractAuthorizablePostServlet

        public AbstractAuthorizablePostServlet()
    • Method Detail

      • unbindPrincipalNameGenerator

        protected void unbindPrincipalNameGenerator​(PrincipalNameGenerator generator)
      • bindPrincipalNameFilter

        protected void bindPrincipalNameFilter​(PrincipalNameFilter filter)
        Bind a new principal name filter
      • unbindPrincipalNameFilter

        protected void unbindPrincipalNameFilter​(PrincipalNameFilter filter)
      • getOrGeneratePrincipalName

        protected String getOrGeneratePrincipalName​(javax.jcr.Session jcrSession,
                                                    Map<String,​?> properties,
                                                    org.apache.jackrabbit.oak.spi.security.user.AuthorizableType type)
                                             throws javax.jcr.RepositoryException
        Get or generate the name of the principal being created
        Parameters:
        request - the current request
        Returns:
        the principal name
        Throws:
        javax.jcr.RepositoryException
      • deactivate

        protected void deactivate()
      • collectContent

        @Deprecated
        protected Collection<org.apache.sling.servlets.post.impl.helper.RequestProperty> collectContent​(Map<String,​?> properties)
        Deprecated.
        use collectContentMap(Map) instead since 2.2.18
        Collects the properties that form the content to be written back to the repository.
        Parameters:
        properties - the properties out of which to generate the RequestPropertys
        Returns:
        the list of RequestPropertys
      • collectContentMap

        protected Map<String,​org.apache.sling.servlets.post.impl.helper.RequestProperty> collectContentMap​(Map<String,​?> properties)
        Collects the properties that form the content to be written back to the repository.
        Parameters:
        properties - the properties out of which to generate the RequestPropertys
        Returns:
        the list of RequestPropertys
      • processDeletes

        protected void processDeletes​(org.apache.jackrabbit.api.security.user.Authorizable authorizable,
                                      Collection<org.apache.sling.servlets.post.impl.helper.RequestProperty> reqProperties,
                                      List<org.apache.sling.servlets.post.Modification> changes)
                               throws javax.jcr.RepositoryException
        Removes all properties listed as RequestProperty.isDelete() from the authorizable.
        Parameters:
        authorizable - The org.apache.jackrabbit.api.security.user.Authorizable that should have properties deleted.
        reqProperties - The collection of request properties to check for properties to be removed.
        changes - The List to be updated with information on deleted properties.
        Throws:
        javax.jcr.RepositoryException - Is thrown if an error occurrs checking or removing properties.
      • processCreate

        protected void processCreate​(javax.jcr.Session session,
                                     org.apache.jackrabbit.api.security.user.Authorizable authorizable,
                                     Map<String,​org.apache.sling.servlets.post.impl.helper.RequestProperty> reqProperties,
                                     List<org.apache.sling.servlets.post.Modification> changes)
                              throws javax.jcr.RepositoryException
        Create resource(s) according to current request
        Parameters:
        session - the sessioin to write the authorizable properties
        authorizable - The org.apache.jackrabbit.api.security.user.Authorizable that should have properties deleted.
        reqProperties - The collection of request properties to check for properties to be removed.
        changes - The List to be updated with information on deleted properties.
        Throws:
        javax.jcr.RepositoryException - Is thrown if an error occurrs checking or removing properties.
      • writeContent

        protected void writeContent​(javax.jcr.Session session,
                                    org.apache.jackrabbit.api.security.user.Authorizable authorizable,
                                    Collection<org.apache.sling.servlets.post.impl.helper.RequestProperty> reqProperties,
                                    List<org.apache.sling.servlets.post.Modification> changes)
                             throws javax.jcr.RepositoryException
        Writes back the content
        Parameters:
        session - the sessioin to write the authorizable properties
        authorizable - the authorizable to modify
        reqProperties - the properties to write
        changes - the list of changes which is supposed to be extended
        Throws:
        javax.jcr.RepositoryException - if a repository error occurs
      • hasItemPathPrefix

        protected boolean hasItemPathPrefix​(String name)
        Parameters:
        name - the name
        Returns:
        true if the name starts with either of the prefixes SlingPostConstants.ITEM_PREFIX_RELATIVE_CURRENT, SlingPostConstants.ITEM_PREFIX_RELATIVE_PARENT and SlingPostConstants.ITEM_PREFIX_ABSOLUTE
      • requireItemPathPrefix

        protected final boolean requireItemPathPrefix​(Map<String,​?> properties)
        Parameters:
        properties - the request parameters
        Returns:
        true if any of the request parameters starts with SlingPostConstants.ITEM_PREFIX_RELATIVE_CURRENT. In this case only parameters starting with either of the prefixes SlingPostConstants.ITEM_PREFIX_RELATIVE_CURRENT, SlingPostConstants.ITEM_PREFIX_RELATIVE_PARENT and SlingPostConstants.ITEM_PREFIX_ABSOLUTE are considered as providing content to be stored. Otherwise all parameters not starting with the command prefix : are considered as parameters to be stored.
      • convertToString

        protected String convertToString​(Object obj)
      • convertToStringArray

        @NotNull
        protected @NotNull String[] convertToStringArray​(Object obj)
      • convertToRequestParameterArray

        @NotNull
        protected @NotNull org.apache.sling.api.request.RequestParameter[] convertToRequestParameterArray​(Object obj)