| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.sling.servlets.post.AbstractSlingPostOperation
public abstract class AbstractSlingPostOperation
Holds various states and encapsulates methods that are needed to handle a post request.
| Field Summary | |
|---|---|
| protected  org.slf4j.Logger | logdefault log | 
| Fields inherited from interface org.apache.sling.servlets.post.SlingPostOperation | 
|---|
| PROP_OPERATION_NAME, SERVICE_NAME | 
| Constructor Summary | |
|---|---|
| AbstractSlingPostOperation() | |
| Method Summary | |
|---|---|
| protected abstract  void | doRun(SlingHttpServletRequest request,
      HtmlResponse response,
      java.util.List<Modification> changes) | 
| protected  java.lang.String | externalizePath(SlingHttpServletRequest request,
                java.lang.String path)Returns an external form of the given path prepending the context path and appending a display extension. | 
| protected  java.util.Iterator<Resource> | getApplyToResources(SlingHttpServletRequest request)Returns an iterator on Resourceinstances addressed in theSlingPostConstants.RP_APPLY_TOrequest parameter. | 
| protected  java.lang.String | getItemPath(SlingHttpServletRequest request)Returns the path of the resource of the request as the item path. | 
| protected  boolean | hasItemPathPrefix(java.lang.String name)Returns trueif thenamestarts with either
 of the prefixes
 {@link SlingPostConstants#ITEM_PREFIX_RELATIVE_CURRENT. | 
| protected  void | orderNode(SlingHttpServletRequest request,
          javax.jcr.Item item,
          java.util.List<Modification> changes)Orders the given node according to the specified command. | 
| protected  boolean | requireItemPathPrefix(SlingHttpServletRequest request)Returns true if any of the request parameters starts with {@link SlingPostConstants#ITEM_PREFIX_RELATIVE_CURRENT . | 
| protected  java.lang.String | resolvePath(java.lang.String absPath,
            java.lang.String relPath)Resolves the given path with respect to the current root path. | 
|  void | run(SlingHttpServletRequest request,
    HtmlResponse response,
    SlingPostProcessor[] processors)Prepares and finalizes the actual operation. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected final org.slf4j.Logger log
| Constructor Detail | 
|---|
public AbstractSlingPostOperation()
| Method Detail | 
|---|
public void run(SlingHttpServletRequest request,
                HtmlResponse response,
                SlingPostProcessor[] processors)
getItemPath(SlingHttpServletRequest) method and setting the
 location and parent location on the response. After the operation has
 been done in the doRun(SlingHttpServletRequest, HtmlResponse, List)
 method the session is saved if there are unsaved modifications. In case
 of errorrs, the unsaved changes in the session are rolled back.
run in interface SlingPostOperationrequest - the request to operate onresponse - The HtmlResponse to record execution
            progress.protected java.lang.String getItemPath(SlingHttpServletRequest request)
This method may be overwritten by extension if the operation has different requirements on path processing.
protected abstract void doRun(SlingHttpServletRequest request,
                              HtmlResponse response,
                              java.util.List<Modification> changes)
                       throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected java.util.Iterator<Resource> getApplyToResources(SlingHttpServletRequest request)
Resource instances addressed in the
 SlingPostConstants.RP_APPLY_TO request parameter. If the request
 parameter is not set, null is returned. If the parameter
 is set with valid resources an empty iterator is returned. Any resources
 addressed in the SlingPostConstants.RP_APPLY_TO parameter is
 ignored.
request - The SlingHttpServletRequest object used to
            get the SlingPostConstants.RP_APPLY_TO parameter.
null if the parameter is not set in the request.
protected final java.lang.String externalizePath(SlingHttpServletRequest request,
                                                 java.lang.String path)
path - the path to externalize
protected final java.lang.String resolvePath(java.lang.String absPath,
                                             java.lang.String relPath)
relPath - the path to resolve
protected final boolean requireItemPathPrefix(SlingHttpServletRequest request)
././..//: are considered as
 parameters to be stored.
protected boolean hasItemPathPrefix(java.lang.String name)
true if the name starts with either
 of the prefixes
 ./..//
protected void orderNode(SlingHttpServletRequest request,
                         javax.jcr.Item item,
                         java.util.List<Modification> changes)
                  throws javax.jcr.RepositoryException
item - node to order
javax.jcr.RepositoryException - if an error occurs| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||