Package com.adobe.acs.commons.sorter
Class SortNodesOperation
java.lang.Object
com.adobe.acs.commons.sorter.SortNodesOperation
- All Implemented Interfaces:
org.apache.sling.servlets.post.PostOperation
public class SortNodesOperation
extends Object
implements org.apache.sling.servlets.post.PostOperation
The
SortNodesOperation class implements the OPERATION_SORT operation for the Sling POST servlet.
Use this operation to alphabetize JCR nodes. For example, the following command line sorts the children of the /content/sample page:
curl -u admin:admin -F":operation=acs-commons:sortNodes" http://localhost:4502/content/sample
You can use optional NodeNameSorter.RP_CASE_SENSITIVE and RP_SORTER_NAME parameters to control whether to sort by
by node name (default) or by jcr:title and whether the sort should be case-sensitive:
curl -u admin:admin -F":operation=acs-commons:sortNodes" \
-F":sorterName:byTitle" -F":caseSensitive:true" \
http://localhost:4502/content/someFolder
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringName of the sort operation.static final StringName of the request parameter indicating whether to sort nodes by jcr:title If this request parameter is missing then nodes will be sorted by node name.Fields inherited from interface org.apache.sling.servlets.post.PostOperation
PROP_OPERATION_NAME, SERVICE_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbindNodeSorter(NodeSorter sorter, Map<String, Object> properties) voidrun(org.apache.sling.api.SlingHttpServletRequest slingRequest, org.apache.sling.servlets.post.PostResponse response, org.apache.sling.servlets.post.SlingPostProcessor[] processors) protected voidunbindNodeSorter(NodeSorter sorter, Map<String, Object> properties)
-
Field Details
-
OPERATION_SORT
Name of the sort operation. The acs-commons: prefix is to avoid name clash with other PostOperations .- See Also:
-
RP_SORTER_NAME
Name of the request parameter indicating whether to sort nodes by jcr:title If this request parameter is missing then nodes will be sorted by node name.- See Also:
-
DEFAULT_SORTER_NAME
- See Also:
-
-
Constructor Details
-
SortNodesOperation
public SortNodesOperation()
-
-
Method Details
-
bindNodeSorter
-
unbindNodeSorter
-
run
public void run(org.apache.sling.api.SlingHttpServletRequest slingRequest, org.apache.sling.servlets.post.PostResponse response, org.apache.sling.servlets.post.SlingPostProcessor[] processors) - Specified by:
runin interfaceorg.apache.sling.servlets.post.PostOperation
-