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 f8781a3  Adding stylewrapper and search reference components and 
updating column control
f8781a3 is described below

commit f8781a3451b2db0a8379669dcce729ce7621be12
Author: Dan Klco <daniel.k...@gmail.com>
AuthorDate: Tue Feb 13 15:13:02 2018 -0500

    Adding stylewrapper and search reference components and updating column 
control
---
 .../general/columncontrol/columncontrol.jsp        | 33 +++++++++++---
 .../components/general/columncontrol/config.json   |  7 +++
 .../components/general/columncontrol/edit.json     | 28 ++++++++++--
 .../components/general/columncontrol/options.jsp   |  4 --
 .../apps/reference/components/general/search.json  |  5 +++
 .../general/{columncontrol => search}/config.json  |  7 +++
 .../reference/components/general/search/edit.json  | 17 +++++++
 .../columncontrol.jsp => search/pagination.jsp}    | 10 +----
 .../columncontrol.jsp => search/result.jsp}        | 20 +++++----
 .../reference/components/general/search/search.jsp | 52 ++++++++++++++++++++++
 .../reference/components/general/stylewrapper.json |  5 +++
 .../{columncontrol => stylewrapper}/config.json    |  6 +--
 .../components/general/stylewrapper/edit.json      | 17 +++++++
 .../{columncontrol => stylewrapper}/options.jsp    | 12 ++---
 .../stylewrapper.jsp}                              |  8 +---
 15 files changed, 185 insertions(+), 46 deletions(-)

diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
index 9e14cfb..bc1bb4b 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
@@ -17,10 +17,31 @@
  * under the License.
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
-<div class="row">
-       <c:forEach var="col" items="${fn:split(properties.layout,',')}" 
varStatus="status">
-               <div class="${sling:encode(col,'HTML_ATTR')}">
-                       <sling:include path="col-${status.index}" 
resourceType="sling-cms/components/general/container" />
+ <c:choose>
+       <c:when test="${properties.container}">
+               <sling:adaptTo var="pageMgr" 
adaptable="${slingRequest.requestPathInfo.suffixResource}" 
adaptTo="org.apache.sling.cms.core.models.PageManager" />
+               <c:set var="configRsrc" 
value="${pageMgr.page.template.componentConfigs['reference/components/general/columncontrol']}"
 />
+               ${configRsrc}
+               ${configRsrc.valueMap.containerclass}
+               <c:set var="containerClass" 
value="${configRsrc.valueMap.containerclass}" />
+               <div class="${containerClass}">
+                       <div class="row">
+                               <c:forEach var="col" 
items="${fn:split(properties.layout,',')}" varStatus="status">
+                                       <div 
class="${sling:encode(col,'HTML_ATTR')}">
+                                               <sling:include 
path="col-${status.index}" 
resourceType="sling-cms/components/general/container" />
+                                       </div>
+                               </c:forEach>
+                       </div>
+               </div>
+       </c:when>
+       <c:otherwise>
+               <div class="row">
+                       <c:forEach var="col" 
items="${fn:split(properties.layout,',')}" varStatus="status">
+                               <div class="${sling:encode(col,'HTML_ATTR')}">
+                                       <sling:include 
path="col-${status.index}" 
resourceType="sling-cms/components/general/container" />
+                               </div>
+                       </c:forEach>
                </div>
-       </c:forEach>
-</div>
+       </c:otherwise>
+ </c:choose>
+
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
index d825160..3032090 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
@@ -8,5 +8,12 @@
                "name": "columns",
                "type": "text",
                "required": true
+       },
+       "containerclass": {
+               "jcr:primaryType": "nt:unstructured",
+               "sling:resourceType" : 
"sling-cms/components/editor/fields/text",
+               "label": "Container Class",
+               "name": "containerclass",
+               "required": true
        }
 }
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/edit.json
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/edit.json
index bbbc269..8fb7aa3 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/edit.json
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/edit.json
@@ -1,17 +1,39 @@
  {
        "jcr:primaryType": "nt:unstructured",
-       "sling:resourceType" : "sling-cms/components/editor/slingform",
+       "sling:resourceType": "sling-cms/components/editor/slingform",
        "button": "Save",
        "fields": {
                "jcr:primaryType": "nt:unstructured",
-               "sling:resourceType" : "sling-cms/components/general/container",
+               "sling:resourceType": "sling-cms/components/general/container",
                "layout": {
                        "jcr:primaryType": "nt:unstructured",
-                       "sling:resourceType" : 
"sling-cms/components/editor/fields/select",
+                       "sling:resourceType": 
"sling-cms/components/editor/fields/select",
                        "label": "Layout",
                        "name": "layout",
                        "required": true,
                        "optionsScript": 
"/apps/reference/components/general/columncontrol/options.jsp"
+               },
+               "container": {
+                       "jcr:primaryType": "nt:unstructured",
+                       "sling:resourceType": 
"sling-cms/components/editor/fields/select",
+                       "label": "Wrap In Container?",
+                       "name": "container",
+                       "required": true,
+                       "options": {
+                               "no": {
+                                       "label": "No",
+                                       "value": false
+                               },
+                               "yes": {
+                                       "label": "Yes",
+                                       "value": true
+                               }
+                       }
+               },
+               "containerTypeHint": {
+                       "sling:resourceType": 
"sling-cms/components/editor/fields/hidden",
+                       "name": "container@TypeHint",
+                       "value": "Boolean"
                }
        }
 }
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/options.jsp
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/options.jsp
index 0047853..4308c9f 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/options.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/options.jsp
@@ -18,11 +18,7 @@
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
 <sling:adaptTo var="pageMgr" 
adaptable="${slingRequest.requestPathInfo.suffixResource}" 
adaptTo="org.apache.sling.cms.core.models.PageManager" />
-pagemgr=${pageMgr }
-template=${pageMgr.page.template}
-configs=${pageMgr.page.template.componentConfigs }
 <c:set var="configRsrc" 
value="${pageMgr.page.template.componentConfigs['reference/components/general/columncontrol']}"
 />
-config=${configRsrc }
 <c:forEach var="layout" items="${configRsrc.valueMap.columns}">
        <option ${slingRequest.requestPathInfo.suffixResource.valueMap.layout 
== sling:encode(fn:split(layout,'=')[1],'HTML_ATTR') ? 'selected' : ''} 
value="${sling:encode(fn:split(layout,'=')[1],'HTML_ATTR')}">
                ${sling:encode(fn:split(layout,'=')[0],'HTML')}
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search.json
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search.json
new file mode 100644
index 0000000..fa97a55
--- /dev/null
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search.json
@@ -0,0 +1,5 @@
+{
+       "jcr:primaryType": "sling:Component",
+    "componentType": "General",
+    "jcr:title": "Search"
+}
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/config.json
similarity index 60%
copy from 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
copy to 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/config.json
index d825160..3032090 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/config.json
@@ -8,5 +8,12 @@
                "name": "columns",
                "type": "text",
                "required": true
+       },
+       "containerclass": {
+               "jcr:primaryType": "nt:unstructured",
+               "sling:resourceType" : 
"sling-cms/components/editor/fields/text",
+               "label": "Container Class",
+               "name": "containerclass",
+               "required": true
        }
 }
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/edit.json
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/edit.json
new file mode 100644
index 0000000..4478859
--- /dev/null
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/edit.json
@@ -0,0 +1,17 @@
+ {
+       "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",
+               "limit": {
+                       "jcr:primaryType": "nt:unstructured",
+                       "sling:resourceType": 
"sling-cms/components/editor/fields/text",
+                       "label": "Limit",
+                       "name": "limit",
+                       "required": true,
+                       "type": "number"
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/pagination.jsp
similarity index 71%
copy from 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
copy to 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/pagination.jsp
index 9e14cfb..8a15c07 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/pagination.jsp
@@ -16,11 +16,5 @@
  * specific language governing permissions and limitations
  * under the License.
  */ --%>
- <%@include file="/libs/sling-cms/global.jsp"%>
-<div class="row">
-       <c:forEach var="col" items="${fn:split(properties.layout,',')}" 
varStatus="status">
-               <div class="${sling:encode(col,'HTML_ATTR')}">
-                       <sling:include path="col-${status.index}" 
resourceType="sling-cms/components/general/container" />
-               </div>
-       </c:forEach>
-</div>
+<%@include file="/libs/sling-cms/global.jsp"%>
+Pagination!!
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/result.jsp
similarity index 63%
copy from 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
copy to 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/result.jsp
index 9e14cfb..032693b 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/result.jsp
@@ -16,11 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */ --%>
- <%@include file="/libs/sling-cms/global.jsp"%>
-<div class="row">
-       <c:forEach var="col" items="${fn:split(properties.layout,',')}" 
varStatus="status">
-               <div class="${sling:encode(col,'HTML_ATTR')}">
-                       <sling:include path="col-${status.index}" 
resourceType="sling-cms/components/general/container" />
-               </div>
-       </c:forEach>
-</div>
+<%@include file="/libs/sling-cms/global.jsp"%>
+<div class="searchresult">
+       <div class="searchresult__header">
+               <sling:encode 
value="${result.valueMap['jcr:content/jcr:title']}" mode="HTML" />
+       </div>
+       <p class="searchresult__body">
+               <sling:encode 
value="${result.valueMap['jcr:content/jcr:description']}" mode="HTML" />
+       </p>
+       <a href="${result.path}.html" class="searchresult__link">
+               
${fn:replace(result.path,sling:getAbsoluteParent(result,2).path,'')}.html
+       </a>
+</div>
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/search.jsp
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/search.jsp
new file mode 100644
index 0000000..11b387d
--- /dev/null
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/search/search.jsp
@@ -0,0 +1,52 @@
+<%-- /*
+ * 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.limit}">
+       <div class="search">
+               <div class="search__header">
+                       <fmt:message key="slingcms.search.header">
+                               <fmt:param 
value="${sling:encode(param.q,'HTML')}" />
+                       </fmt:message>
+               </div>
+               <div class="search__results">
+                       <c:if test="${not empty param.q}">
+                               <c:set var="quote" value="'"/>
+                               <c:set var="escape" value=""/>
+                               <c:catch>
+                               <sling:findResources var="results" 
query="SELECT parent.* FROM [sling:Page] AS parent INNER JOIN [nt:base] AS 
child ON ISDESCENDANTNODE(child,parent) WHERE ISDESCENDANTNODE(parent, 
'/content/danklco-com') AND CONTAINS(child.*, 
'${fn:replace(param.q,quote,escape)}')" language="JCR-SQL2" />
+                                       <c:choose>
+                                               <c:when test="${not empty 
param.page}">
+                                                       <c:set var="start" 
value="${param.page * properties.limit}" />
+                                                       <c:set var="end" 
value="${(param.page * properties.limit) + properties.limit}" />
+                                               </c:when>
+                                               <c:otherwise>
+                                                       <c:set var="start" 
value="0" />
+                                                       <c:set var="end" 
value="${properties.limit}" />
+                                               </c:otherwise>
+                                       </c:choose>
+                                       <c:forEach var="result" 
items="${results}" begin="${start}" end="${end}">
+                                               <c:set var="result" 
value="${result}" scope="request" />
+                                               <sling:call script="result.jsp" 
/>
+                                       </c:forEach>
+                               </c:catch>
+                       </c:if>
+               </div>
+               <sling:call script="pagination.jsp" />
+       </div>
+</c:if>
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper.json
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper.json
new file mode 100644
index 0000000..8bb29f7
--- /dev/null
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper.json
@@ -0,0 +1,5 @@
+{
+       "jcr:primaryType": "sling:Component",
+    "componentType": "General",
+    "jcr:title": "Style Wrapper"
+}
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/config.json
similarity index 80%
copy from 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
copy to 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/config.json
index d825160..7910776 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/config.json
@@ -1,11 +1,11 @@
  {
        "jcr:primaryType": "nt:unstructured",
        "sling:resourceType" : "sling-cms/components/general/container",
-       "columns": {
+       "styles": {
                "jcr:primaryType": "nt:unstructured",
                "sling:resourceType" : 
"sling-cms/components/editor/fields/repeating",
-               "label": "Columns",
-               "name": "columns",
+               "label": "Style Options",
+               "name": "styles",
                "type": "text",
                "required": true
        }
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/edit.json
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/edit.json
new file mode 100644
index 0000000..8dfa516
--- /dev/null
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/edit.json
@@ -0,0 +1,17 @@
+ {
+       "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",
+               "styles": {
+                       "jcr:primaryType": "nt:unstructured",
+                       "sling:resourceType": 
"sling-cms/components/editor/fields/select",
+                       "label": "Style Option",
+                       "name": "styles",
+                       "required": true,
+                       "optionsScript": 
"/apps/reference/components/general/stylewrapper/options.jsp"
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/options.jsp
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/options.jsp
similarity index 71%
copy from 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/options.jsp
copy to 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/options.jsp
index 0047853..de9a85d 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/options.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/options.jsp
@@ -18,13 +18,9 @@
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
 <sling:adaptTo var="pageMgr" 
adaptable="${slingRequest.requestPathInfo.suffixResource}" 
adaptTo="org.apache.sling.cms.core.models.PageManager" />
-pagemgr=${pageMgr }
-template=${pageMgr.page.template}
-configs=${pageMgr.page.template.componentConfigs }
-<c:set var="configRsrc" 
value="${pageMgr.page.template.componentConfigs['reference/components/general/columncontrol']}"
 />
-config=${configRsrc }
-<c:forEach var="layout" items="${configRsrc.valueMap.columns}">
-       <option ${slingRequest.requestPathInfo.suffixResource.valueMap.layout 
== sling:encode(fn:split(layout,'=')[1],'HTML_ATTR') ? 'selected' : ''} 
value="${sling:encode(fn:split(layout,'=')[1],'HTML_ATTR')}">
-               ${sling:encode(fn:split(layout,'=')[0],'HTML')}
+<c:set var="configRsrc" 
value="${pageMgr.page.template.componentConfigs['reference/components/general/stylewrapper']}"
 />
+<c:forEach var="style" items="${configRsrc.valueMap.styles}">
+       <option ${slingRequest.requestPathInfo.suffixResource.valueMap.style == 
sling:encode(fn:split(style,'=')[1],'HTML_ATTR') ? 'selected' : ''} 
value="${sling:encode(fn:split(style,'=')[1],'HTML_ATTR')}">
+               ${sling:encode(fn:split(style,'=')[0],'HTML')}
        </option>
 </c:forEach>
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/stylewrapper.jsp
similarity index 75%
copy from 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
copy to 
cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/stylewrapper.jsp
index 9e14cfb..84e2083 100644
--- 
a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/stylewrapper/stylewrapper.jsp
@@ -17,10 +17,6 @@
  * under the License.
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
-<div class="row">
-       <c:forEach var="col" items="${fn:split(properties.layout,',')}" 
varStatus="status">
-               <div class="${sling:encode(col,'HTML_ATTR')}">
-                       <sling:include path="col-${status.index}" 
resourceType="sling-cms/components/general/container" />
-               </div>
-       </c:forEach>
+<div class="${properties.style}">
+       <sling:include path="container" 
resourceType="sling-cms/components/general/container" />
 </div>

-- 
To stop receiving notification emails like this one, please contact
dk...@apache.org.

Reply via email to