public abstract class AbstractAuthorizablePostServlet extends AbstractPostServlet
Modifier and Type | Field and Description |
---|---|
static String |
PROP_DATE_FORMAT |
Constructor and Description |
---|
AbstractAuthorizablePostServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(Map<String,Object> props) |
protected Collection<org.apache.sling.servlets.post.impl.helper.RequestProperty> |
collectContent(Map<String,?> properties)
Collects the properties that form the content to be written back to the
repository.
|
protected org.apache.sling.api.request.RequestParameter[] |
convertToRequestParameterArray(Object obj) |
protected String |
convertToString(Object obj) |
protected String[] |
convertToStringArray(Object obj) |
protected void |
deactivate() |
protected boolean |
hasItemPathPrefix(String name) |
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)
Removes all properties listed as
RequestProperty.isDelete() from
the authorizable. |
protected boolean |
requireItemPathPrefix(Map<String,?> properties) |
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)
Writes back the content
|
bindPostResponseCreator, createHtmlResponse, doPost, externalizePath, getItemPath, getRedirectUrl, getRedirectUrl, handleOperation, handleOperation, isSetStatus, unbindPostResponseCreator
doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayService
doGeneric, doGet, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
public static final String PROP_DATE_FORMAT
protected void deactivate()
protected Collection<org.apache.sling.servlets.post.impl.helper.RequestProperty> collectContent(Map<String,?> properties)
properties
- the properties out of which to generate the RequestProperty
sRequestProperty
sprotected 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
RequestProperty.isDelete()
from
the authorizable.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.javax.jcr.RepositoryException
- Is thrown if an error occurrs checking or
removing properties.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
session
- the sessioin to write the authorizable propertiesauthorizable
- the authorizable to modifyreqProperties
- the properties to writechanges
- the list of changes which is supposed to be extendedjavax.jcr.RepositoryException
- if a repository error occursprotected boolean hasItemPathPrefix(String name)
name
- the nametrue
if the name
starts with either of
the prefixes SlingPostConstants.ITEM_PREFIX_RELATIVE_CURRENT
,
SlingPostConstants.ITEM_PREFIX_RELATIVE_PARENT
and
SlingPostConstants.ITEM_PREFIX_ABSOLUTE
protected final boolean requireItemPathPrefix(Map<String,?> properties)
properties
- the request parameterstrue
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.protected org.apache.sling.api.request.RequestParameter[] convertToRequestParameterArray(Object obj)
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.