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/05/25 02:22:44 UTC
[sling-whiteboard] branch master updated: Moving all of the create
dialogs to use the name param name generator
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 13e3815 Moving all of the create dialogs to use the name param name generator
13e3815 is described below
commit 13e38155fee4d827f94b4bcb6aafd09df9e9aeec
Author: Dan Klco <dk...@apache.org>
AuthorDate: Thu May 24 22:22:31 2018 -0400
Moving all of the create dialogs to use the name param name generator
---
.../etc/clientlibs/sling-cms-editor/editor.js | 3 --
.../general/namedcontainer/namedcontainer.jsp | 38 --------------------
.../libs/sling-cms/content/config/create.json | 11 ++++--
.../libs/sling-cms/content/editor/add-named.json | 42 ----------------------
.../libs/sling-cms/content/site/create.json | 11 ++++--
.../libs/sling-cms/content/site/creategroup.json | 11 ++++--
.../libs/sling-cms/content/taxonomy/create.json | 9 +++--
.../libs/sling-cms/content/template/create.json | 11 ++++--
8 files changed, 39 insertions(+), 97 deletions(-)
diff --git a/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms-editor/editor.js b/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms-editor/editor.js
index 5fd2b23..9610e48 100644
--- a/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms-editor/editor.js
+++ b/cms/ui/src/main/resources/jcr_root/etc/clientlibs/sling-cms-editor/editor.js
@@ -22,9 +22,6 @@ if(!window.CMSEditor){
$(".Sling-CMS__edit-button[data-sling-cms-action=add]").click(function(){
CMSEditor.ui.showModal('/cms/editor/add.html'+$(this).attr('data-sling-cms-path')+'?availableTypes='+$(this).data('sling-cms-available-types'));
});
- $(".Sling-CMS__edit-button[data-sling-cms-action=add-named]").click(function(){
- CMSEditor.ui.showModal('/cms/editor/add-named.html'+$(this).attr('data-sling-cms-path')+'?availableTypes='+$(this).data('sling-cms-available-types'));
- });
$(".Sling-CMS__edit-button[data-sling-cms-action=delete]").click(function(){
CMSEditor.ui.showModal('/cms/editor/delete.html'+$(this).attr('data-sling-cms-path'));
});
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/general/namedcontainer/namedcontainer.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/general/namedcontainer/namedcontainer.jsp
deleted file mode 100644
index 92ad951..0000000
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/general/namedcontainer/namedcontainer.jsp
+++ /dev/null
@@ -1,38 +0,0 @@
-<%-- /*
- * 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:choose>
- <c:when test="${not empty requestScope.availableTypes}">
- <c:set var="availableTypes" value="${requestScope.availableTypes}" />
- </c:when>
- <c:when test="${empty requestScope.availableTypes}">
- <sling:adaptTo var="pageMgr" adaptable="${resource}" adaptTo="org.apache.sling.cms.core.models.PageManager" />
- <c:set var="availableTypes" value="${pageMgr.page.availableComponents}" />
- </c:when>
-</c:choose>
-<c:forEach var="child" items="${sling:listChildren(resource)}">
- <sling:include resource="${child}" />
-</c:forEach>
-<c:if test="${cmsEditEnabled == 'true'}">
- <div class="Sling-CMS__edit-bar">
- <button class="Sling-CMS__edit-button" data-sling-cms-action="add-named" data-sling-cms-path="${resource.path}" data-sling-cms-available-types="${availableTypes}" title="Add">
- +
- </button>
- </div>
-</c:if>
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/create.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/create.json
index 8ee0460..65707c6 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/create.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/config/create.json
@@ -17,7 +17,7 @@
"sling:resourceType": "sling-cms/components/editor/slingform",
"actionSuffix": "/*",
"button": "Create Site Config",
- "successPrepend":"/libs/sling-cms/content/site/content.html",
+ "successPrepend": "/libs/sling-cms/content/site/content.html",
"fields": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/general/container",
@@ -32,8 +32,13 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/fields/text",
"label": "Name",
- "name": ":name",
- "required": true
+ "name": ":name"
+ },
+ "nameParam": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/hidden",
+ "name": ":nameParam",
+ "value": "jcr:title"
},
"primaryType": {
"jcr:primaryType": "nt:unstructured",
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/editor/add-named.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/editor/add-named.json
deleted file mode 100644
index 66ee093..0000000
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/editor/add-named.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "jcr:primaryType": "sling:Page",
- "jcr:content": {
- "jcr:primaryType": "nt:unstructured",
- "jcr:title": "Edit",
- "sling:resourceType": "sling-cms/components/pages/editor",
- "container": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType": "sling-cms/components/general/container",
- "add": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType": "sling-cms/components/editor/slingform",
- "button": "Add Component",
- "actionSuffix": "/*",
- "fields": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType": "sling-cms/components/general/container",
- "primaryType": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType" : "sling-cms/components/editor/fields/hidden",
- "name": "jcr:primaryType",
- "value": "nt:unstructured"
- },
- "name": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType" : "sling-cms/components/editor/fields/text",
- "name": ":name",
- "label": "Name",
- "required": true
- },
- "type": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType": "sling-cms/components/editor/fields/select",
- "name": "sling:resourceType",
- "optionsScript": "/libs/sling-cms/components/editor/scripts/resourceTypeOptions.jsp",
- "required": true
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
index 5c34ff3..fcaeb9c 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
@@ -17,7 +17,7 @@
"sling:resourceType": "sling-cms/components/editor/slingform",
"actionSuffix": "/*",
"button": "Create Site",
- "successPrepend":"/libs/sling-cms/content/site/content.html",
+ "successPrepend": "/libs/sling-cms/content/site/content.html",
"fields": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/general/container",
@@ -32,8 +32,13 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/fields/text",
"label": "Name",
- "name": ":name",
- "required": true
+ "name": ":name"
+ },
+ "nameParam": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/hidden",
+ "name": ":nameParam",
+ "value": "jcr:title"
},
"url": {
"jcr:primaryType": "nt:unstructured",
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
index 60f1a29..0e86e66 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
@@ -17,7 +17,7 @@
"sling:resourceType": "sling-cms/components/editor/slingform",
"actionSuffix": "/*",
"button": "Create Site Group",
- "successPrepend":"/libs/sling-cms/content/site/content.html",
+ "successPrepend": "/libs/sling-cms/content/site/content.html",
"fields": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/general/container",
@@ -32,8 +32,13 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/fields/text",
"label": "Name",
- "name": ":name",
- "required": true
+ "name": ":name"
+ },
+ "nameParam": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/hidden",
+ "name": ":nameParam",
+ "value": "jcr:content/jcr:title"
},
"config": {
"jcr:primaryType": "nt:unstructured",
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
index 98c5e25..88a7528 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
@@ -31,8 +31,13 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/fields/text",
"label": "Name",
- "name": ":name",
- "required": true
+ "name": ":name"
+ },
+ "nameParam": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/hidden",
+ "name": ":nameParam",
+ "value": "jcr:title"
},
"primaryType": {
"jcr:primaryType": "nt:unstructured",
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
index 851eed0..f5d4a73 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
@@ -17,7 +17,7 @@
"sling:resourceType": "sling-cms/components/editor/slingform",
"actionSuffix": "/templates/",
"button": "Create Template",
- "successPrepend":"/libs/sling-cms/content/site/content.html",
+ "successPrepend": "/libs/sling-cms/content/site/content.html",
"fields": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/general/container",
@@ -32,8 +32,13 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/fields/text",
"label": "Name",
- "name": ":name",
- "required": true
+ "name": ":name"
+ },
+ "nameParam": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/fields/hidden",
+ "name": ":nameParam",
+ "value": "jcr:title"
},
"primaryType": {
"jcr:primaryType": "nt:unstructured",
--
To stop receiving notification emails like this one, please contact
dklco@apache.org.