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/01/29 22:03:42 UTC
[sling-whiteboard] branch master updated: Adding the ability to
configure the components and adding some reference components
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 e924fc9 Adding the ability to configure the components and adding some reference components
e924fc9 is described below
commit e924fc944d2ddce7bf8ed2826032c3869f8e8ac4
Author: Dan Klco <da...@gmail.com>
AuthorDate: Mon Jan 29 17:03:33 2018 -0500
Adding the ability to configure the components and adding some reference components
---
.../apache/sling/cms/core/models/PageTemplate.java | 18 ++++++++++
.../sling/cms/core/models/PageTemplateManager.java | 14 +++++---
.../components/general/columncontrol.json | 5 +++
.../general/columncontrol/columncontrol.jsp | 26 +++++++++++++++
.../components/general/columncontrol/config.json | 12 +++++++
.../components/general/columncontrol/edit.json | 17 ++++++++++
.../components/general/columncontrol/options.jsp | 30 +++++++++++++++++
.../etc/clientlibs/sling-cms/js/scripts.js | 26 ++++++++++++++-
.../availablecomponenttypes.jsp | 20 ++----------
.../sling-cms/components/cms/componentconfig.json | 5 +++
.../cms/componentconfig/componentconfig.jsp | 38 ++++++++++++++++++++++
.../components/cms/componentconfig/edit.json | 21 ++++++++++++
.../components/cms/includeconfig/includeconfig.jsp | 21 ++++++++++++
.../components/cms/pagetemplate/edit.json | 10 ++++--
.../components/cms/pagetemplate/pagetemplate.jsp | 11 ++++++-
.../editor/scripts/componentConfigOptions.jsp | 33 +++++++++++++++++++
16 files changed, 280 insertions(+), 27 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 c621649..61cceef 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
@@ -17,7 +17,9 @@
package org.apache.sling.cms.core.models;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import javax.inject.Inject;
import javax.inject.Named;
@@ -42,6 +44,9 @@ public class PageTemplate {
private String[] availableComponentTypes;
@Inject
+ private List<Resource> componentConfigurations;
+
+ @Inject
private List<Resource> fields;
private Resource resource;
@@ -71,6 +76,19 @@ 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);
+ }
+ return configs;
+ }
/**
* @return the fields
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/models/PageTemplateManager.java b/cms/core/src/main/java/org/apache/sling/cms/core/models/PageTemplateManager.java
index 0839891..1887c79 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/core/models/PageTemplateManager.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/models/PageTemplateManager.java
@@ -43,10 +43,12 @@ public class PageTemplateManager {
List<PageTemplate> availableTemplates = new ArrayList<PageTemplate>();
if (siteConfig != null && siteConfig.getPageTemplates() != null) {
for (PageTemplate template : siteConfig.getPageTemplates()) {
- for (String allowedPath : template.getAllowedPaths()) {
- if (path.matches(allowedPath)) {
- availableTemplates.add(template);
- break;
+ if (template != null && template.getAllowedPaths() != null) {
+ for (String allowedPath : template.getAllowedPaths()) {
+ if (path.matches(allowedPath)) {
+ availableTemplates.add(template);
+ break;
+ }
}
}
}
@@ -54,7 +56,9 @@ public class PageTemplateManager {
return availableTemplates;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#toString()
*/
@Override
diff --git a/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol.json b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol.json
new file mode 100644
index 0000000..d4c890b
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol.json
@@ -0,0 +1,5 @@
+{
+ "jcr:primaryType": "sling:Component",
+ "componentType": "General",
+ "jcr:title": "Column Control"
+}
\ 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/columncontrol/columncontrol.jsp
new file mode 100644
index 0000000..9e14cfb
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/columncontrol.jsp
@@ -0,0 +1,26 @@
+<%-- /*
+ * 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"%>
+<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>
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
new file mode 100644
index 0000000..d825160
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/config.json
@@ -0,0 +1,12 @@
+ {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType" : "sling-cms/components/general/container",
+ "columns": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType" : "sling-cms/components/editor/fields/repeating",
+ "label": "Columns",
+ "name": "columns",
+ "type": "text",
+ "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
new file mode 100644
index 0000000..bbbc269
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/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",
+ "layout": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType" : "sling-cms/components/editor/fields/select",
+ "label": "Layout",
+ "name": "layout",
+ "required": true,
+ "optionsScript": "/apps/reference/components/general/columncontrol/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/columncontrol/options.jsp
new file mode 100644
index 0000000..0047853
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/apps/reference/components/general/columncontrol/options.jsp
@@ -0,0 +1,30 @@
+<%-- /*
+ * 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="${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')}
+ </option>
+</c:forEach>
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms/js/scripts.js b/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms/js/scripts.js
index 9a90519..718c63c 100644
--- a/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms/js/scripts.js
+++ b/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms/js/scripts.js
@@ -163,6 +163,22 @@ Sling.CMS = {
}
};
+ Sling.CMS.ext['includeconfig'] = {
+ decorate: function($ctx){
+ $ctx.find('.Sling-CMS__include-config').each(function(){
+ var $ctr = $(this);
+ var load = function(){
+ var config = $($ctr.data('source')).find('option:selected').data('config');
+ $ctr.load(config + $ctr.parents('form').attr('action'), function(){
+ Sling.CMS.decorate($ctr.children());
+ });
+ };
+ $($ctr.data('source')).change(load);
+ load();
+ });
+ }
+ }
+
Sling.CMS.ext['namehint'] = {
decorate: function($ctx){
$ctx.find('.namehint').each(function(){
@@ -189,6 +205,7 @@ Sling.CMS = {
}
$ctr.find('input,textarea,select').change(updateContent);
$ctr.parents('form').submit(updateContent);
+ Sling.CMS.decorate($ctr.children());
});
});
});
@@ -217,7 +234,14 @@ Sling.CMS = {
Sling.CMS.ext['richtext'] = {
decorate: function($ctx){
$ctx.find('.richtext').summernote({
- height: 200
+ toolbar: [
+ ['style', ['bold', 'italic', 'clear','strikethrough', 'superscript', 'subscript']],
+ ['insert', ['picture', 'link', 'table', 'hr']],
+ ['para', ['style','ul', 'ol', 'paragraph']],
+ ['misc', ['codeview', 'undo','redo','help']]
+ ],
+ dialogsInBody: true,
+ height: 200
});
}
}
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/availablecomponenttypes/availablecomponenttypes.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/availablecomponenttypes/availablecomponenttypes.jsp
index c5c71b3..9ae305f 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/availablecomponenttypes/availablecomponenttypes.jsp
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/availablecomponenttypes/availablecomponenttypes.jsp
@@ -19,26 +19,10 @@
<%@include file="/libs/sling-cms/global.jsp"%>
<div class="Field-Group">
<label for="availableComponentTypes">
- Available Component Types
+ Component Types
</label>
<div class="Field-Input">
- <c:set var="currentTypes" value="|${fn:join(slingRequest.requestPathInfo.suffixResource.valueMap.availableComponentTypes, '|')}|"/>
- <sling:adaptTo var="componentManager" adaptable="${resourceResolver}" adaptTo="org.apache.sling.cms.core.models.ComponentManager" />
- <c:forEach var="type" items="${componentManager.componentTypes}">
- <label class="Checkbox-Label">
- <c:set var="search" value="|${type}|" />
- <c:choose>
- <c:when test="${fn:contains(currentTypes,search)}">
- <c:set var="checked">checked="checked"</c:set>
- </c:when>
- <c:otherwise>
- <c:set var="checked" value="" />
- </c:otherwise>
- </c:choose>
- <input name="availableComponentTypes" type="checkbox" ${checked} value="${sling:encode(type,'HTML_ATTR')}">
- <sling:encode value="${type}" mode="HTML" />
- </label>
- </c:forEach>
+ <select
</div>
<input type="hidden" name="availableComponentTypes@TypeHint" value="String[]" />
</div>
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig.json
new file mode 100644
index 0000000..f4b873e
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig.json
@@ -0,0 +1,5 @@
+{
+ "jcr:primaryType": "sling:Component",
+ "componentType": "SlingCMS-ComponentConfig",
+ "jcr:title": "Sling CMS - Component Configuration"
+}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig/componentconfig.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig/componentconfig.jsp
new file mode 100644
index 0000000..a3d0dc7
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig/componentconfig.jsp
@@ -0,0 +1,38 @@
+<%-- /*
+ * 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"%>
+<dl>
+ <c:forEach var="val" items="${resource.valueMap}">
+ <c:if test="${not fn:contains(val.key,':')}">
+ <dt>
+ <sling:encode value="${val.key}" mode="HTML" />
+ </dt>
+ <dd>
+ <c:catch var="ex">
+ <c:forEach var="item" items="${val.value}">
+ <sling:encode value="${item}" mode="HTML" />
+ </c:forEach>
+ </c:catch>
+ <c:if test="${ex != null}">
+ <sling:encode value="${val.value}" mode="HTML" />
+ </c:if>
+ </dd>
+ </c:if>
+</c:forEach>
+</dl>
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig/edit.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig/edit.json
new file mode 100644
index 0000000..649b7ae
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/componentconfig/edit.json
@@ -0,0 +1,21 @@
+ {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/slingform",
+ "button": "Save Component Config",
+ "fields": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/general/container",
+ "type": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/select",
+ "label": "Component",
+ "name": "type",
+ "optionsScript": "/libs/sling-cms/components/editor/scripts/componentConfigOptions.jsp",
+ "required": true
+ },
+ "includeconfig": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/cms/includeconfig"
+ }
+ }
+}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/includeconfig/includeconfig.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/includeconfig/includeconfig.jsp
new file mode 100644
index 0000000..05264d4
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/includeconfig/includeconfig.jsp
@@ -0,0 +1,21 @@
+<%-- /*
+ * 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"%>
+<div class="Sling-CMS__include-config" data-path="${resource.path}.html" data-source="select[name=type]">
+</div>
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/edit.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/edit.json
index 8410523..3cc8559 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/edit.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/edit.json
@@ -9,7 +9,7 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/fields/text",
"label": "Title",
- "name": "title",
+ "name": "jcr:title",
"required": true
},
"allowedPaths": {
@@ -20,6 +20,12 @@
"name": "allowedPaths",
"required": true
},
+ "allowedPathsTypeHint": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/hidden",
+ "name": "allowedPaths@TypeHint",
+ "value": "String[]"
+ },
"availableComponentTypes": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/cms/availablecomponenttypes"
@@ -27,7 +33,7 @@
"template": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/fields/textarea",
- "defaultValue":"{\r\n \"jcr:primaryType\": \"sling:Page\",\r\n \"jcr:content\": {\r\n \"jcr:primaryType\": \"nt:unstructured\",\r\n \"jcr:title\": \"{{title}}\",\r\n \"sling:template\": \"{{template}}\",\r\n \"sling:resourceType\": \"sling-cms\/components\/page\/base\"\r\n }\r\n}",
+ "defaultValue":"{\r\n \"jcr:primaryType\": \"sling:Page\",\r\n \"jcr:content\": {\r\n \"jcr:primaryType\": \"nt:unstructured\",\r\n \"jcr:title\": \"{{title}}\",\r\n \"sling:template\": \"{{template}}\",\r\n \"sling:resourceType\": \"references\/components\/pages\/base\"\r\n }\r\n}",
"label": "Template",
"name": "template",
"required": true
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/pagetemplate.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/pagetemplate.jsp
index fb8fd3b..af227c5 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/pagetemplate.jsp
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/pagetemplate/pagetemplate.jsp
@@ -25,7 +25,7 @@
Title
</dt>
<dd>
- <sling:encode value="${properties.title}" mode="HTML" />
+ <sling:encode value="${properties['jcr:title']}" mode="HTML" />
</dd>
<dt>
Allowed Paths
@@ -61,6 +61,15 @@
</ul>
</dd>
<dt>
+ Component Configurations
+ </dt>
+ <dd>
+ <c:set var="oldAvailableTypes" value="${availableTypes}" />
+ <c:set var="availableTypes" value="SlingCMS-ComponentConfig" scope="request" />
+ <sling:include path="componentConfigurations" resourceType="sling-cms/components/general/container" />
+ <c:set var="availableTypes" value="${oldAvailableTypes}" scope="request" />
+ </dd>
+ <dt>
Template Content
</dt>
<dd>
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/componentConfigOptions.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/componentConfigOptions.jsp
new file mode 100644
index 0000000..cfe5c00
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/componentConfigOptions.jsp
@@ -0,0 +1,33 @@
+<%-- /*
+ * 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:forEach var="component" items="${sling:findResources(resourceResolver,'SELECT * FROM [sling:Component] WHERE [componentType] IS NOT NULL','JCR-SQL2')}">
+ <c:if test="${sling:getRelativeResource(component,'config') != null}">
+ <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.type ? 'selected' : ''} data-config="${component.path}/config.html"><sling:encode value="${component.valueMap['jcr:title']}" mode="HTML" /></option>
+ </c:if>
+</c:forEach>
\ No newline at end of file
--
To stop receiving notification emails like this one, please contact
dklco@apache.org.