public class List
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
List.PageComparator<P extends com.day.cq.wcm.foundation.List.PageWrapper>
Compares pages with each other by property.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALLOW_DUPLICATES_PROPERTY_NAME |
static java.lang.String |
ANCESTOR_PAGE_PROPERTY_NAME |
static java.lang.String |
DEFAULT_QUERY |
static java.lang.String |
LIMIT_PROPERTY_NAME |
static Logger |
log |
static java.lang.String |
ORDER_BY_PROPERTY_NAME |
static java.lang.String |
ORDERED_PROPERTY_NAME |
static java.lang.String |
PAGE_MAX_PARAM_NAME |
static java.lang.String |
PAGE_MAX_PROPERTY_NAME |
static java.lang.String |
PAGE_START_PARAM_NAME |
static java.lang.String |
PAGES_PROPERTY_NAME |
static java.lang.String |
PARENT_PAGE_PROPERTY_NAME |
static java.lang.String |
QUERY_PROPERTY_NAME |
static java.lang.String |
SAVEDQUERY_PROPERTY_NAME |
static java.lang.String |
SEARCH_IN_PROPERTY_NAME |
static java.lang.String |
SOURCE_CHILDREN
Used to create a list from child pages.
|
static java.lang.String |
SOURCE_DESCENDANTS
Used to create a list from descendant pages.
|
static java.lang.String |
SOURCE_PROPERTY_NAME |
static java.lang.String |
SOURCE_QUERYBUILDER
Used to create a list from a querybuilder search result.
|
static java.lang.String |
SOURCE_SEARCH
Used to create a list from a search result.
|
static java.lang.String |
SOURCE_STATIC
Used to create a list from a fixed selection of pages.
|
static java.lang.String |
SOURCE_TAGS
Used to create a list from list of tags.
|
static java.lang.String |
TAGS_MATCH_PROPERTY_NAME |
static java.lang.String |
TAGS_PROPERTY_NAME |
static java.lang.String |
TAGS_SEARCH_ROOT_PROPERTY_NAME |
static java.lang.String |
TYPE_DEFAULT
Used for default rendering of the list items.
|
static java.lang.String |
TYPE_PROPERTY_NAME |
static java.lang.String |
URL_EXTENSION |
Constructor and Description |
---|
List(SlingHttpServletRequest request)
Creates a
List instance based on the specified request. |
List(SlingHttpServletRequest request,
PageFilter pageFilter)
Creates a
List instance based on the specified request. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getNextPageLink()
Returns the link to the page with the next set of list items.
|
java.util.Iterator<Node> |
getNodes()
Returns the list as nodes.
|
int |
getPageMaximum()
Returns the maximum of list items to return per page.
|
java.util.Iterator<Page> |
getPages()
Returns the list items as pages, respecting both starting index and
maximum number of list items if specified.
|
int |
getPageStart()
Returns the starting index for list items on this page.
|
java.lang.String |
getPreviousPageLink()
Returns the link to the page with the previous set of list items.
|
java.util.Iterator<Resource> |
getResources()
Deprecated.
use
getPages() instead |
java.lang.String |
getType()
Returns the type of the list.
|
boolean |
isEmpty()
States whether the list is empty.
|
boolean |
isOrdered()
States whether the list is ordered.
|
boolean |
isPaginating()
States whether the list is paginating, i.e.
|
void |
setLimit(int l)
Sets the limit for list items.
|
void |
setOrderBy(java.lang.String ob)
Sets the property to order the list by.
|
void |
setOrderComparator(java.util.Comparator<Page> obc)
Sets the comparator used to order the list with.
|
void |
setOrdered(boolean o)
Sets the list style (numbered or not).
|
void |
setPageIterator(java.util.Iterator<Page> iter)
Sets the page iterator to generate the list from.
|
void |
setPageMaximum(int pm)
Sets the maximum list items to return.
|
void |
setPageStart(int psi)
Sets the starting index to be respected when returning
list items.
|
void |
setQuery(java.lang.String q)
Sets the query for the fulltext search.
|
void |
setQuery(java.lang.String q,
java.lang.String type)
Sets the query for the search with the specified type (xpath, sql).
|
void |
setSource(java.lang.String src)
Sets the source for the list.
|
void |
setStartIn(java.lang.String start)
Sets the the of the page to start searching on.
|
void |
setType(java.lang.String t)
Sets the type of the list.
|
int |
size()
Returns the number of list items.
|
public static final Logger log
public static final java.lang.String DEFAULT_QUERY
public static final java.lang.String URL_EXTENSION
public static final java.lang.String TYPE_PROPERTY_NAME
public static final java.lang.String SOURCE_PROPERTY_NAME
public static final java.lang.String SOURCE_CHILDREN
public static final java.lang.String SOURCE_DESCENDANTS
public static final java.lang.String SOURCE_STATIC
public static final java.lang.String SOURCE_SEARCH
public static final java.lang.String SOURCE_QUERYBUILDER
public static final java.lang.String SOURCE_TAGS
public static final java.lang.String TYPE_DEFAULT
public static final java.lang.String PARENT_PAGE_PROPERTY_NAME
public static final java.lang.String ANCESTOR_PAGE_PROPERTY_NAME
public static final java.lang.String TAGS_SEARCH_ROOT_PROPERTY_NAME
public static final java.lang.String TAGS_PROPERTY_NAME
public static final java.lang.String TAGS_MATCH_PROPERTY_NAME
public static final java.lang.String PAGES_PROPERTY_NAME
public static final java.lang.String QUERY_PROPERTY_NAME
public static final java.lang.String SEARCH_IN_PROPERTY_NAME
public static final java.lang.String LIMIT_PROPERTY_NAME
public static final java.lang.String PAGE_MAX_PROPERTY_NAME
public static final java.lang.String ORDER_BY_PROPERTY_NAME
public static final java.lang.String ORDERED_PROPERTY_NAME
public static final java.lang.String SAVEDQUERY_PROPERTY_NAME
public static final java.lang.String PAGE_START_PARAM_NAME
public static final java.lang.String PAGE_MAX_PARAM_NAME
public static final java.lang.String ALLOW_DUPLICATES_PROPERTY_NAME
public List(SlingHttpServletRequest request)
List
instance based on the specified request.request
- The requestpublic List(SlingHttpServletRequest request, PageFilter pageFilter)
List
instance based on the specified request.request
- The requestpageFilter
- Page filterpublic java.util.Iterator<Resource> getResources()
getPages()
insteadpublic java.util.Iterator<Page> getPages()
public java.util.Iterator<Node> getNodes()
source
is
SOURCE_QUERYBUILDER
. Otherwise null
will be
returned.null
public boolean isOrdered()
true
if list is ordered, false
otherwisepublic boolean isEmpty()
true
if list is empty, false
otherwisepublic int size()
public boolean isPaginating()
true
if list is paginating, false
otherwisepublic int getPageStart()
public int getPageMaximum()
public java.lang.String getNextPageLink()
public java.lang.String getPreviousPageLink()
public void setSource(java.lang.String src)
SOURCE_PROPERTY_NAME
.src
- The list sourcepublic void setQuery(java.lang.String q)
q
- The querypublic void setQuery(java.lang.String q, java.lang.String type)
q
- The querytype
- The query type (optional)public void setStartIn(java.lang.String start)
start
- The start page pathpublic java.lang.String getType()
public void setType(java.lang.String t)
TYPE_PROPERTY_NAME
.t
- The list typepublic void setOrderComparator(java.util.Comparator<Page> obc)
obc
- The comparator to order the list withpublic void setOrderBy(java.lang.String ob)
ORDER_BY_PROPERTY_NAME
.ob
- The property to order the list bypublic void setOrdered(boolean o)
false
o
- true
if list should be rendered with numbered items,
false
otherwisepublic void setLimit(int l)
LIMIT_PROPERTY_NAME
.l
- The limitpublic void setPageMaximum(int pm)
PAGE_MAX_PROPERTY_NAME
.pm
- The maximum number of pages per pagepublic void setPageStart(int psi)
psi
- The starting index (defaults to 0).public void setPageIterator(java.util.Iterator<Page> iter)
iter
- The iterator"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"