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/18 03:31:41 UTC
[sling-whiteboard] branch master updated: Did some minor
refactoring to clean up the site creation process and added a new list
reference component
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 afd7941 Did some minor refactoring to clean up the site creation process and added a new list reference component
new e1fb392 Merge branch 'master' of github.com:apache/sling-whiteboard
afd7941 is described below
commit afd7941a1b3cb5843a50e04986621a367520770b
Author: Dan Klco <da...@gmail.com>
AuthorDate: Sat Feb 17 22:31:09 2018 -0500
Did some minor refactoring to clean up the site creation process and
added a new list reference component
---
.../apache/sling/cms/core/models/PageTemplate.java | 15 +-
.../apache/sling/cms/core/models/SiteConfig.java | 9 +-
.../sling/cms/reference/models/ItemList.java | 157 +++++++++++++++++++++
cms/ui/src/main/frontend/gulpfile.js | 3 +
.../reference/components/general/childlist.json | 5 +
.../components/general/childlist/childlist.jsp | 32 +++++
.../components/general/childlist/edit.json | 49 +++++++
.../apps/reference/components/general/list.json | 5 +
.../reference/components/general/list/config.json | 25 ++++
.../reference/components/general/list/edit.json | 46 ++++++
.../reference/components/general/list/list.jsp | 32 +++++
.../components/general/list/listItemOptions.jsp | 32 +++++
.../components/general/list/pagination.jsp | 58 ++++++++
.../reference/components/general/listitem.json | 5 +
.../components/general/listitem/listitem.jsp | 32 +++++
.../apps/reference/components/pages/base/edit.json | 10 +-
.../jcr_root/etc/fileeditors/general.json | 4 +-
.../components/cms/siteconfig/siteconfig.jsp | 2 +-
18 files changed, 506 insertions(+), 15 deletions(-)
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/models/PageTemplate.java b/cms/core/src/main/java/org/apache/sling/cms/core/models/PageTemplate.java
index 61cceef..268b0e1 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/core/models/PageTemplate.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/models/PageTemplate.java
@@ -44,8 +44,9 @@ public class PageTemplate {
private String[] availableComponentTypes;
@Inject
+ @Optional
private List<Resource> componentConfigurations;
-
+
@Inject
private List<Resource> fields;
@@ -76,16 +77,16 @@ public class PageTemplate {
public String[] getAvailableComponentTypes() {
return availableComponentTypes;
}
-
-
/**
* @return the componentConfigs
*/
- public Map<String,Resource> getComponentConfigs() {
- Map<String,Resource> configs = new HashMap<String,Resource>();
- for(Resource cfg : componentConfigurations){
- configs.put(cfg.getValueMap().get("type", String.class), cfg);
+ public Map<String, Resource> getComponentConfigs() {
+ Map<String, Resource> configs = new HashMap<String, Resource>();
+ if (componentConfigurations != null) {
+ for (Resource cfg : componentConfigurations) {
+ configs.put(cfg.getValueMap().get("type", String.class), cfg);
+ }
}
return configs;
}
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/models/SiteConfig.java b/cms/core/src/main/java/org/apache/sling/cms/core/models/SiteConfig.java
index 3d90717..a729db9 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/core/models/SiteConfig.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/models/SiteConfig.java
@@ -23,6 +23,7 @@ import javax.inject.Inject;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.cms.CMSUtils;
import org.apache.sling.models.annotations.Model;
+import org.apache.sling.models.annotations.Optional;
/**
* A model representing a site configuration.
@@ -31,9 +32,11 @@ import org.apache.sling.models.annotations.Model;
public class SiteConfig {
@Inject
- private List<Resource> pageTemplates;
+ @Optional
+ private List<Resource> templates;
@Inject
+ @Optional
private List<Resource> parameters;
private Resource resource;
@@ -46,7 +49,7 @@ public class SiteConfig {
* @return the pageTemplates
*/
public List<PageTemplate> getPageTemplates() {
- return CMSUtils.adaptResources(pageTemplates, PageTemplate.class);
+ return CMSUtils.adaptResources(templates, PageTemplate.class);
}
/**
@@ -76,7 +79,7 @@ public class SiteConfig {
*/
@Override
public String toString() {
- return "SiteConfig [parameters=" + parameters + ", pageTemplates=" + pageTemplates + ", resource=" + resource
+ return "SiteConfig [parameters=" + parameters + ", templates=" + templates + ", resource=" + resource
+ "]";
}
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
new file mode 100644
index 0000000..e02a9ed
--- /dev/null
+++ b/cms/core/src/main/java/org/apache/sling/cms/reference/models/ItemList.java
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.cms.reference.models;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.*;
+
+import javax.annotation.PostConstruct;
+import javax.jcr.query.Query;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.jackrabbit.util.Text;
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.models.annotations.Model;
+import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Model for retrieving a list of items from the Sling repository using a JCR
+ * SQL2 query.
+ */
+@Model(adaptables = SlingHttpServletRequest.class)
+public class ItemList {
+
+ private static final Logger log = LoggerFactory.getLogger(List.class);
+
+ private int count;
+
+ private int end;
+
+ @ValueMapValue
+ private int limit;
+
+ private int page;
+
+ private Integer[] pages;
+
+ @ValueMapValue
+ private String query;
+
+ private SlingHttpServletRequest request;
+
+ private List<Resource> items = new ArrayList<Resource>();
+
+ private int start;
+
+ public ItemList(SlingHttpServletRequest request) {
+ this.request = request;
+ }
+
+ public int getCount() {
+ return count;
+ }
+
+ public int getCurrentPage() {
+ return page + 1;
+ }
+
+ public int getEnd() {
+ return end;
+ }
+
+ public Integer[] getPages() {
+ return pages;
+ }
+
+ public String getQuery() {
+ return query;
+ }
+
+ public List<Resource> getItems() {
+ return items;
+ }
+
+ public int getStart() {
+ return start;
+ }
+
+ @PostConstruct
+ public void init() {
+
+ Set<String> distinct = new HashSet<String>();
+
+ query = query.replace("{SUFFIX}", request.getRequestPathInfo().getSuffix());
+ log.debug("Listing results of: {}", query);
+
+ Iterator<Resource> res = request.getResourceResolver().findResources(query, Query.JCR_SQL2);
+ while (res.hasNext()) {
+ Resource result = res.next();
+ if (!distinct.contains(result.getPath())) {
+ items.add(result);
+ distinct.add(result.getPath());
+ }
+ }
+ count = items.size();
+ log.debug("Found {} results", count);
+
+ if (StringUtils.isNotBlank(request.getParameter("page")) && request.getParameter("page").matches("\\d+")) {
+ page = Integer.parseInt(request.getParameter("page"), 10) - 1;
+ log.debug("Using page {}", page);
+ } else {
+ page = 0;
+ log.debug("Page {} not specified or not valid", request.getParameter("page"));
+ }
+
+ if (page * limit >= count) {
+ start = count;
+ } else {
+ start = page * limit;
+ }
+ log.debug("Using start {}", start);
+
+ if ((page * limit) + limit >= count) {
+ end = count;
+ } else {
+ end = (page * limit) + limit;
+ }
+ log.debug("Using end {}", end);
+ items = items.subList(start, end);
+
+ List<Integer> pgs = new ArrayList<Integer>();
+ int max = ((int) Math.ceil((double) count / limit)) + 1;
+ for (int i = 1; i < max; i++) {
+ pgs.add(i);
+ }
+ pages = pgs.toArray(new Integer[pgs.size()]);
+ log.debug("Loaded pages {}", Arrays.toString(pages));
+ }
+
+ public boolean isFirst() {
+ return page == 0;
+ }
+
+ public boolean isLast() {
+ if (pages.length > 0) {
+ return page + 1 == pages[pages.length - 1];
+ }
+ return true;
+ }
+}
diff --git a/cms/ui/src/main/frontend/gulpfile.js b/cms/ui/src/main/frontend/gulpfile.js
index 80513a2..1d91383 100755
--- a/cms/ui/src/main/frontend/gulpfile.js
+++ b/cms/ui/src/main/frontend/gulpfile.js
@@ -91,6 +91,9 @@ gulp.task('assets', function() {
gulp.src('./src/{fonts,img}/**/*')
.pipe(gulp.dest('./dist/jcr_root/etc/clientlibs/sling-cms'))
.pipe(gulp.dest('./dist/jcr_root/content/starter'));
+ gulp.src('./src/img/sling-logo.svg')
+ .pipe(gulp.dest('./dist/jcr_root/content/starter'))
+ .pipe(gulp.dest('./dist/jcr_root/content/starter'));
gulp.src('./node_modules/summernote/dist/font/*')
.pipe(gulp.dest('./dist/jcr_root/etc/clientlibs/sling-cms/css/font'));
});
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/childlist.json b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/childlist.json
new file mode 100644
index 0000000..44a79da
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/childlist.json
@@ -0,0 +1,5 @@
+{
+ "jcr:primaryType": "sling:Component",
+ "componentType": "General",
+ "jcr:title": "Child List"
+}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/childlist/childlist.jsp b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/childlist/childlist.jsp
new file mode 100644
index 0000000..dc02188
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/childlist/childlist.jsp
@@ -0,0 +1,32 @@
+<%-- /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */ --%>
+<%@include file="/libs/sling-cms/global.jsp"%>
+<c:if test="${not empty properties.itemType}">
+ <c:set var="basePath" value="${not empty properties.basePath ? properties.basePath : resource.path} }" />
+ <c:set var="limit" value="${not empty properties.limit ? properties.limit : 1000} }" />
+ <c:set var="tag" value="${not empty properties.tag ? properties.tag : 'ul'} }" />
+ <c:set var="class" value="${not empty properties.class ? properties.class : ''} }" />
+ <${tag} class="${class}">
+ <c:forEach var="child" items="${sling:listChildren(sling:getResource(resourceResolver,basePath))}" end="${limit}">
+ <c:if test="${child.resourceType == 'sling:Page'}">
+ <sling:include path="${child.path}" resourceType="${properties.itemType}" />
+ </c:if>
+ </c:forEach>
+ </${tag}>
+</c:if>
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/childlist/edit.json b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/childlist/edit.json
new file mode 100644
index 0000000..a0a528b
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/childlist/edit.json
@@ -0,0 +1,49 @@
+ {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/slingform",
+ "button": "Save",
+ "fields": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/general/container",
+ "basePath": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/path",
+ "basePath": "/content",
+ "label": "Base Path",
+ "name": "basePath",
+ "required": false,
+ "titleProperty": "jcr:content/jcr:title",
+ "type": "sling:Page"
+ },
+ "itemType": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/select",
+ "label": "Item Type",
+ "name": "itemType",
+ "optionsScript": "/apps/reference/components/general/list/listItemOptions.jsp",
+ "required": true
+ },
+ "limit": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/text",
+ "label": "Limit",
+ "name": "limit",
+ "required": false,
+ "type": "number"
+ },
+ "tag": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/text",
+ "label": "List Tag",
+ "name": "tag",
+ "required": false
+ },
+ "class": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/text",
+ "label": "List Class",
+ "name": "class",
+ "required": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list.json b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list.json
new file mode 100644
index 0000000..816e431
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list.json
@@ -0,0 +1,5 @@
+{
+ "jcr:primaryType": "sling:Component",
+ "componentType": "General",
+ "jcr:title": "List"
+}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/config.json b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/config.json
new file mode 100644
index 0000000..696f63e
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/config.json
@@ -0,0 +1,25 @@
+ {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType" : "sling-cms/components/general/container",
+ "paginationClass": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType" : "sling-cms/components/editor/fields/text",
+ "label": "Pagination Class",
+ "name": "paginationClass",
+ "required": true
+ },
+ "pageItemClass": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType" : "sling-cms/components/editor/fields/text",
+ "label": "Page Item Class",
+ "name": "pageItemClass",
+ "required": true
+ },
+ "pageLinkClass": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType" : "sling-cms/components/editor/fields/text",
+ "label": "PageLink Class",
+ "name": "pageLinkClass",
+ "required": true
+ }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..1d4e9a2
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/edit.json
@@ -0,0 +1,46 @@
+ {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/slingform",
+ "button": "Save",
+ "fields": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/general/container",
+ "query": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/textarea",
+ "label": "Query",
+ "name": "query",
+ "required": true
+ },
+ "limit": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/text",
+ "label": "Limit",
+ "name": "limit",
+ "required": true,
+ "type": "number"
+ },
+ "itemType": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/select",
+ "label": "Item Type",
+ "name": "itemType",
+ "optionsScript": "/apps/reference/components/general/list/listItemOptions.jsp",
+ "required": true
+ },
+ "tag": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/text",
+ "label": "List Tag",
+ "name": "tag",
+ "required": false
+ },
+ "class": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/text",
+ "label": "List Class",
+ "name": "class",
+ "required": false
+ }
+ }
+}
\ No newline at end of file
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
new file mode 100644
index 0000000..8ed5b27
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/list.jsp
@@ -0,0 +1,32 @@
+<%-- /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */ --%>
+ <%@include file="/libs/sling-cms/global.jsp"%>
+<sling:adaptTo var="pageMgr" adaptable="${resource}" adaptTo="org.apache.sling.cms.core.models.PageManager" />
+<c:set var="listConfig" value="${pageMgr.page.template.componentConfigs['reference/components/general/list']}" scope="request" />
+<c:set var="tag" value="${not empty properties.tag ? properties.tag : 'ul'}" />
+<c:set var="clazz" value="${not empty properties.class ? properties.class : ''}" />
+<c:if test="${not empty properties.limit}">
+ <c:set var="list" value="${sling:adaptTo(slingRequest, 'org.apache.sling.cms.reference.models.ItemList')}" scope="request" />
+ <${tag} class="list ${clazz}">
+ <c:forEach var="item" items="${list.items}">
+ <sling:include path="${item.path}" resourceType="${properties.itemType}" />
+ </c:forEach>
+ <sling:call script="pagination.jsp" />
+ </${tag}>
+</c:if>
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/listItemOptions.jsp b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/listItemOptions.jsp
new file mode 100644
index 0000000..2f2d4db
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/listItemOptions.jsp
@@ -0,0 +1,32 @@
+<%-- /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */ --%>
+ <%@include file="/libs/sling-cms/global.jsp"%>
+<option value="">Select Component</option>
+<c:set var="query" value="SELECT * FROM [sling:Component] WHERE [componentType]='ListItems'" />
+<c:forEach var="component" items="${sling:findResources(resourceResolver,query,'JCR-SQL2')}">
+ <c:choose>
+ <c:when test="${fn:startsWith(component.path,'/apps/')}">
+ <c:set var="rt" value="${fn:substringAfter(component.path,'/apps/')}" />
+ </c:when>
+ <c:otherwise>
+ <c:set var="rt" value="${fn:substringAfter(component.path,'/libs/')}" />
+ </c:otherwise>
+ </c:choose>
+ <option value="${rt}" ${rt == editProperties.itemType ? 'selected' : ''}><sling:encode value="${component.valueMap['jcr:title']}" mode="HTML" /></option>
+</c:forEach>
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/pagination.jsp b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/pagination.jsp
new file mode 100644
index 0000000..6070ddb
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/list/pagination.jsp
@@ -0,0 +1,58 @@
+<%-- /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */ --%>
+<%@include file="/libs/sling-cms/global.jsp"%>
+<nav>
+ <ul class="${listConfig.valueMap.paginationClass}">
+ <c:choose>
+ <c:when test="${list.first == true}">
+ <li class="${listConfig.valueMap.pageItemClass} disabled">
+ <span class="${listConfig.valueMap.pageLinkClass}">
+ <
+ </span>
+ </li>
+ </c:when>
+ <c:otherwise>
+ <li class="${listConfig.valueMap.pageItemClass}">
+ <a class="${listConfig.valueMap.pageLinkClass}" href="?page=0"><</a>
+ </li>
+ </c:otherwise>
+ </c:choose>
+ <c:forEach var="page" items="${list.pages}">
+ <li class="${listConfig.valueMap.pageItemClass} ">
+ <a href="?page=${page}" class="${listConfig.valueMap.pageLinkClass}">
+ ${page}
+ </a>
+ </li>
+ </c:forEach>
+ <c:choose>
+ <c:when test="${list.last}">
+ <li class="${listConfig.valueMap.pageItemClass} disabled">
+ <span class="${listConfig.valueMap.pageLinkClass}">
+ >
+ </span>
+ </li>
+ </c:when>
+ <c:otherwise>
+ <li class="${listConfig.valueMap.pageItemClass}">
+ <a class="${listConfig.valueMap.pageLinkClass}" href="?&page=${list.currentPage + 1}">></a>
+ </li>
+ </c:otherwise>
+ </c:choose>
+ </ul>
+</nav>
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/listitem.json b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/listitem.json
new file mode 100644
index 0000000..63dd0b4
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/listitem.json
@@ -0,0 +1,5 @@
+{
+ "jcr:primaryType": "sling:Component",
+ "componentType": "ListItems",
+ "jcr:title": "List Item"
+}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/listitem/listitem.jsp b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/listitem/listitem.jsp
new file mode 100644
index 0000000..b062b4f
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/listitem/listitem.jsp
@@ -0,0 +1,32 @@
+<%-- /*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */ --%>
+ <%@include file="/libs/sling-cms/global.jsp"%>
+<li>
+ <c:choose>
+ <c:when test="${resource.resourceType == 'sling:File' || resource.resourceType == 'nt:file'}">
+ <c:set var="url" value="${resource.path }" />
+ </c:when>
+ <c:otherwise>
+ <c:set var="url" value="${resource.path}.html" />
+ </c:otherwise>
+ </c:choose>
+ <a href="${url}">
+ <sling:encode value="${resource.valueMap['jcr:content/jcr:title']}" default="${resource.name}" mode="HTML" />
+ </a>
+</li>
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/pages/base/edit.json b/cms/ui/src/main/resources/jcr_root/apps/reference/components/pages/base/edit.json
index 4e0c678..eda9de6 100644
--- a/cms/ui/src/main/resources/jcr_root/apps/reference/components/pages/base/edit.json
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/pages/base/edit.json
@@ -18,11 +18,17 @@
"label": "Description",
"name": "jcr:description"
},
- "keywords": {
+ "taxonomy": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/fields/taxonomy",
"label": "Keywords",
- "name": "keywords"
+ "name": "sling:taxonomy"
+ },
+ "taxonomyTypeHint": {
+ "jcr:primaryType": "nt:unstructured",
+ "name": "jcr:content/sling:taxonomy@TypeHint",
+ "value": "String[]",
+ "sling:resourceType": "sling-cms/components/editor/fields/hidden"
},
"canonical": {
"jcr:primaryType": "nt:unstructured",
diff --git a/cms/ui/src/main/resources/jcr_root/etc/fileeditors/general.json b/cms/ui/src/main/resources/jcr_root/etc/fileeditors/general.json
index bfd121d..a7c2598 100644
--- a/cms/ui/src/main/resources/jcr_root/etc/fileeditors/general.json
+++ b/cms/ui/src/main/resources/jcr_root/etc/fileeditors/general.json
@@ -27,13 +27,13 @@
},
"taxonomy": {
"jcr:primaryType": "nt:unstructured",
- "name": "jcr:content/taxonomy",
+ "name": "jcr:content/sling:taxonomy",
"label": "Taxonomy",
"sling:resourceType": "sling-cms/components/editor/fields/taxonomy"
},
"taxonomyTypeHint": {
"jcr:primaryType": "nt:unstructured",
- "name": "jcr:content/taxonomy@TypeHint",
+ "name": "jcr:content/sling:taxonomy@TypeHint",
"value": "String[]",
"sling:resourceType": "sling-cms/components/editor/fields/hidden"
},
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
index 436c9ab..60fe54d 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
@@ -31,7 +31,7 @@
<h3>Page Templates</h3>
<c:set var="oldAvailableTypes" value="${availableTypes}" />
<c:set var="availableTypes" value="SlingCMS-PageTemplate" scope="request" />
-<sling:include path="${slingRequest.requestPathInfo.suffix}/pageTemplates" resourceType="sling-cms/components/general/namedcontainer" />
+<sling:include path="${slingRequest.requestPathInfo.suffix}/templates" resourceType="sling-cms/components/general/namedcontainer" />
<c:set var="availableTypes" value="${oldAvailableTypes}" scope="request" />
<sling:call script="/libs/sling-cms/components/editor/scripts/finalize.jsp" />
--
To stop receiving notification emails like this one, please contact
dklco@apache.org.