You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2018/02/23 18:22:37 UTC
[sling-whiteboard] branch master updated: Updating to allow the
list to not include pagination.
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git
The following commit(s) were added to refs/heads/master by this push:
new b862386 Updating to allow the list to not include pagination.
new 7f7473b Merge branch 'master' of github.com:apache/sling-whiteboard
b862386 is described below
commit b862386be1c472fc0d6b67923d6e828ac94cd091
Author: Dan Klco <da...@gmail.com>
AuthorDate: Fri Feb 23 13:21:54 2018 -0500
Updating to allow the list to not include pagination.
---
.../sling/cms/reference/models/ItemList.java | 6 +++++-
.../reference/components/general/list/edit.json | 25 ++++++++++++++++++++++
.../reference/components/general/list/list.jsp | 4 +++-
3 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/cms/core/src/main/java/org/apache/sling/cms/reference/models/ItemList.java b/cms/core/src/main/java/org/apache/sling/cms/reference/models/ItemList.java
index e02a9ed..c0375b7 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/reference/models/ItemList.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/reference/models/ItemList.java
@@ -96,9 +96,13 @@ public class ItemList {
@PostConstruct
public void init() {
+ log.trace("init");
+
Set<String> distinct = new HashSet<String>();
- query = query.replace("{SUFFIX}", request.getRequestPathInfo().getSuffix());
+ if (request.getRequestPathInfo().getSuffix() != null) {
+ query = query.replace("{SUFFIX}", request.getRequestPathInfo().getSuffix());
+ }
log.debug("Listing results of: {}", query);
Iterator<Resource> res = request.getResourceResolver().findResources(query, Query.JCR_SQL2);
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/edit.json b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/edit.json
index 1d4e9a2..b6f8450 100644
--- a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/edit.json
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/edit.json
@@ -20,6 +20,31 @@
"required": true,
"type": "number"
},
+ "includePagination": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/select",
+ "label": "Include Pagination",
+ "name": "includePagination",
+ "required": true,
+ "options": {
+ "yes": {
+ "jcr:primaryType": "nt:unstructured",
+ "label": "Yes",
+ "value": "true"
+ },
+ "no": {
+ "jcr:primaryType": "nt:unstructured",
+ "label": "No",
+ "value": "false"
+ }
+ }
+ },
+ "includePaginationTypeHint": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/hidden",
+ "name": "includePagination@TypeHint",
+ "value": "Boolean"
+ },
"itemType": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/fields/select",
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/list.jsp b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/list.jsp
index 8ed5b27..6fb59ab 100644
--- a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/list.jsp
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/list.jsp
@@ -27,6 +27,8 @@
<c:forEach var="item" items="${list.items}">
<sling:include path="${item.path}" resourceType="${properties.itemType}" />
</c:forEach>
- <sling:call script="pagination.jsp" />
+ <c:if test="${properties.includePagitation}">
+ <sling:call script="pagination.jsp" />
+ </c:if>
</${tag}>
</c:if>
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
dklco@apache.org.