public class SortNodesOperation extends Object implements org.apache.sling.servlets.post.PostOperation
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
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SORTER_NAME |
static String |
OPERATION_SORT
Name of the sort operation.
|
static String |
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.
|
| Constructor and Description |
|---|
SortNodesOperation() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bindNodeSorter(NodeSorter sorter,
Map<String,Object> properties) |
void |
run(org.apache.sling.api.SlingHttpServletRequest slingRequest,
org.apache.sling.servlets.post.PostResponse response,
org.apache.sling.servlets.post.SlingPostProcessor[] processors) |
protected void |
unbindNodeSorter(NodeSorter sorter,
Map<String,Object> properties) |
public static final String OPERATION_SORT
public static final String RP_SORTER_NAME
public static final String DEFAULT_SORTER_NAME
protected void bindNodeSorter(NodeSorter sorter, Map<String,Object> properties)
protected void unbindNodeSorter(NodeSorter sorter, Map<String,Object> properties)
public void run(org.apache.sling.api.SlingHttpServletRequest slingRequest,
org.apache.sling.servlets.post.PostResponse response,
org.apache.sling.servlets.post.SlingPostProcessor[] processors)
run in interface org.apache.sling.servlets.post.PostOperationCopyright © 2013–2021 Adobe. All rights reserved.