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/09 22:40:48 UTC

[sling-whiteboard] branch master updated: Adding a new /static directory for static content

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 0e0ef65  Adding a new /static directory for static content
0e0ef65 is described below

commit 0e0ef65715b60ad3d462acee2117c112a9c6b5e6
Author: Dan Klco <dk...@apache.org>
AuthorDate: Wed May 9 18:23:40 2018 -0400

    Adding a new /static directory for static content
---
 cms/builder/src/main/provisioning/repoinit.txt     |   4 +-
 .../org/apache/sling/cms/core/models/Site.java     |   2 +-
 cms/reference/pom.xml                              |   2 +-
 .../apps/reference/components/pages/base/body.jsp  |   6 +-
 .../apps/reference/components/pages/base/head.jsp  |   4 +-
 .../reference/img/SupportApache-small.png          | Bin
 .../clientlibs/reference/img/apache.png            | Bin
 .../clientlibs/reference/img/favicon.ico           | Bin
 .../clientlibs/reference/img/sling.svg             |   0
 .../{etc => static}/clientlibs/reference/site.css  |   0
 .../components/cms/contentnav/contentnav.jsp       |   2 +-
 .../jcr_root/libs/sling-cms/content/start.json     |  13 +-
 .../libs/sling-cms/content/static/content.json     | 253 +++++++++++++++++++++
 13 files changed, 275 insertions(+), 11 deletions(-)

diff --git a/cms/builder/src/main/provisioning/repoinit.txt b/cms/builder/src/main/provisioning/repoinit.txt
index f7f439a..e24e9c5 100644
--- a/cms/builder/src/main/provisioning/repoinit.txt
+++ b/cms/builder/src/main/provisioning/repoinit.txt
@@ -30,9 +30,9 @@
         allow   jcr:read	on /content
     end
     
-    create path (sling:OrderedFolder) /etc/clientlibs
+    create path (sling:OrderedFolder) /static
     set ACL for everyone
-        allow   jcr:read	on /etc/clientlibs
+        allow   jcr:read	on /static
     end
 
     # sling-mapping
diff --git a/cms/core/src/main/java/org/apache/sling/cms/core/models/Site.java b/cms/core/src/main/java/org/apache/sling/cms/core/models/Site.java
index ffe9c9f..80ab164 100644
--- a/cms/core/src/main/java/org/apache/sling/cms/core/models/Site.java
+++ b/cms/core/src/main/java/org/apache/sling/cms/core/models/Site.java
@@ -33,7 +33,7 @@ import org.apache.sling.models.annotations.Optional;
 @Model(adaptables = Resource.class)
 public class Site {
 
-	public static final String PN_CONFIG = CMSConstants.NAMESPACE + ":config";
+	public static final String PN_CONFIG = CMSConstants.NAMESPACE + ":configRef";
 	public static final String PN_URL = CMSConstants.NAMESPACE + ":url";
 
 	private static Resource findSiteResource(Resource resource) {
diff --git a/cms/reference/pom.xml b/cms/reference/pom.xml
index c21af66..7a7cf28 100644
--- a/cms/reference/pom.xml
+++ b/cms/reference/pom.xml
@@ -52,7 +52,7 @@
 						<Sling-Initial-Content>
 							jcr_root,
 							jcr_root/apps/reference;overwrite:=true;uninstall:=true;path:=/apps/reference,
-							jcr_root/etc/clientlibs/reference;overwrite=true;ignoreImportProviders:=xml;path:=/etc/clientlibs/reference
+							jcr_root/static/clientlibs/reference;overwrite=true;ignoreImportProviders:=xml;path:=/static/clientlibs/reference
 						</Sling-Initial-Content>
 					</instructions>
 				</configuration>
diff --git a/cms/reference/src/main/resources/jcr_root/apps/reference/components/pages/base/body.jsp b/cms/reference/src/main/resources/jcr_root/apps/reference/components/pages/base/body.jsp
index 967345a..0d49fac 100644
--- a/cms/reference/src/main/resources/jcr_root/apps/reference/components/pages/base/body.jsp
+++ b/cms/reference/src/main/resources/jcr_root/apps/reference/components/pages/base/body.jsp
@@ -22,19 +22,19 @@
 	<div class="title">
 		<div class="logo">
 			<a href="/">
-				<img border="0" alt="Apache Sling" src="/etc/clientlibs/reference/img/sling.svg"/>
+				<img border="0" alt="Apache Sling" src="/static/clientlibs/reference/img/sling.svg"/>
 			</a>
 		</div>
 		<div class="header">
 			<a href="http://www.apache.org">
-				<img border="0" alt="Apache" src="/etc/clientlibs/reference/img/apache.png"/>
+				<img border="0" alt="Apache" src="/static/clientlibs/reference/img/apache.png"/>
 			</a>
 		</div>
 	</div>
 	<div class="menu">
 		<sling:include path="/content/apache/sling-apache-org/index/jcr:content/menu" resourceType="sling-cms/components/general/container" />
 		<a href="http://apache.org/foundation/contributing.html">
-            <img border="0" alt="Support the Apache Software Foundation!" src="/etc/clientlibs/reference/img/SupportApache-small.png" width="115px">
+            <img border="0" alt="Support the Apache Software Foundation!" src="/static/clientlibs/reference/img/SupportApache-small.png" width="115px">
         </a>
 	</div>
 	<div class="main">
diff --git a/cms/reference/src/main/resources/jcr_root/apps/reference/components/pages/base/head.jsp b/cms/reference/src/main/resources/jcr_root/apps/reference/components/pages/base/head.jsp
index f0d68e6..0d2974a 100644
--- a/cms/reference/src/main/resources/jcr_root/apps/reference/components/pages/base/head.jsp
+++ b/cms/reference/src/main/resources/jcr_root/apps/reference/components/pages/base/head.jsp
@@ -22,8 +22,8 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     <meta name="viewport" content="width=device-width, initial-scale=1" />
     <title>Apache Sling :: ${resource.valueMap['jcr:title']}</title>
-    <link rel="icon" href="/etc/clientlibs/reference/img/favicon.ico"/>
-    <link rel="stylesheet" href="/etc/clientlibs/reference/site.css"/>
+    <link rel="icon" href="/static/clientlibs/reference/img/favicon.ico"/>
+    <link rel="stylesheet" href="/static/clientlibs/reference/site.css"/>
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/>
     <script src='https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js'></script>
     <script>
diff --git a/cms/reference/src/main/resources/jcr_root/etc/clientlibs/reference/img/SupportApache-small.png b/cms/reference/src/main/resources/jcr_root/static/clientlibs/reference/img/SupportApache-small.png
similarity index 100%
rename from cms/reference/src/main/resources/jcr_root/etc/clientlibs/reference/img/SupportApache-small.png
rename to cms/reference/src/main/resources/jcr_root/static/clientlibs/reference/img/SupportApache-small.png
diff --git a/cms/reference/src/main/resources/jcr_root/etc/clientlibs/reference/img/apache.png b/cms/reference/src/main/resources/jcr_root/static/clientlibs/reference/img/apache.png
similarity index 100%
rename from cms/reference/src/main/resources/jcr_root/etc/clientlibs/reference/img/apache.png
rename to cms/reference/src/main/resources/jcr_root/static/clientlibs/reference/img/apache.png
diff --git a/cms/reference/src/main/resources/jcr_root/etc/clientlibs/reference/img/favicon.ico b/cms/reference/src/main/resources/jcr_root/static/clientlibs/reference/img/favicon.ico
similarity index 100%
rename from cms/reference/src/main/resources/jcr_root/etc/clientlibs/reference/img/favicon.ico
rename to cms/reference/src/main/resources/jcr_root/static/clientlibs/reference/img/favicon.ico
diff --git a/cms/reference/src/main/resources/jcr_root/etc/clientlibs/reference/img/sling.svg b/cms/reference/src/main/resources/jcr_root/static/clientlibs/reference/img/sling.svg
similarity index 100%
rename from cms/reference/src/main/resources/jcr_root/etc/clientlibs/reference/img/sling.svg
rename to cms/reference/src/main/resources/jcr_root/static/clientlibs/reference/img/sling.svg
diff --git a/cms/reference/src/main/resources/jcr_root/etc/clientlibs/reference/site.css b/cms/reference/src/main/resources/jcr_root/static/clientlibs/reference/site.css
similarity index 100%
rename from cms/reference/src/main/resources/jcr_root/etc/clientlibs/reference/site.css
rename to cms/reference/src/main/resources/jcr_root/static/clientlibs/reference/site.css
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp
index c16a243..4ba37a0 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/contentnav/contentnav.jsp
@@ -35,5 +35,5 @@
 			</a>
 		</li>
 	</c:forEach>
-<li class="Nav-Item"><a href="${properties.createPath}" title="Create a new ${properties.title}" class="Fetch-Modal" data-title="Create ${properties.title}" data-path=".Main-Content form">+ ${properties.title}</a></li>
+<li class="Nav-Item"><a href="${properties.createPath}" title="Create a new ${not empty properties.createTitle ? properties.createTitle : properties.title}" class="Fetch-Modal" data-title="Create ${not empty properties.createTitle ? properties.createTitle : properties.title}" data-path=".Main-Content form">+ ${not empty properties.createTitle ? properties.createTitle : properties.title}</a></li>
 </ul>
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/start.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/start.json
index 2e52d8a..30e3189 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/start.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/start.json
@@ -22,10 +22,21 @@
 				"jcr:primaryType": "nt:unstructured",
 				"sling:resourceType": "sling-cms/components/cms/contentnav",
 				"createPath": "/cms/site/creategroup.html/content",
+				"createTitle": "Site Group",
 				"prefix": "/cms/site",
 				"itemPrefix": "/cms/site/sites.html",
 				"query": "SELECT * FROM [sling:OrderedFolder] AS s WHERE ISCHILDNODE(s,'/content') ORDER BY NAME()",
-				"title": "Site Group"
+				"title": "Sites"
+			},
+			"staticnav": {
+				"jcr:primaryType": "nt:unstructured",
+				"sling:resourceType": "sling-cms/components/cms/contentnav",
+				"createPath": "/cms/folder/create.html/static",
+				"createTitle": "Folder",
+				"prefix": "/cms/static",
+				"itemPrefix": "/cms/static/content.html",
+				"query": "SELECT * FROM [sling:Folder] AS s WHERE ISCHILDNODE(s,'/static') ORDER BY NAME()",
+				"title": "Static Content"
 			},
 			"taxonomynav": {
 				"jcr:primaryType": "nt:unstructured",
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/static/content.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/static/content.json
new file mode 100644
index 0000000..450bcd8
--- /dev/null
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/static/content.json
@@ -0,0 +1,253 @@
+{
+	"jcr:primaryType": "sling:Page",
+	"jcr:content": {
+		"sling:resourceType": "sling-cms/components/pages/base",
+		"jcr:title": "Static Content",
+		"jcr:primaryType": "nt:unstructured",
+		"container": {
+			"jcr:primaryType": "nt:unstructured",
+			"sling:resourceType": "sling-cms/components/general/container",
+			"contentactions": {
+				"jcr:primaryType": "nt:unstructured",
+				"sling:resourceType": "sling-cms/components/cms/contentactions",
+				"actions": {
+					"file": {
+						"jcr:primaryType": "nt:unstructured",
+						"label": "File",
+						"prefix": "/cms/file/upload.html"
+					},
+					"folder": {
+						"jcr:primaryType": "nt:unstructured",
+						"label": "Folder",
+						"prefix": "/cms/folder/create.html"
+					}
+				}
+			},
+			"contentbreadcrumb": {
+				"jcr:primaryType": "nt:unstructured",
+				"sling:resourceType": "sling-cms/components/cms/contentbreadcrumb",
+				"depth": 2,
+				"prefix": "/cms/static/content.html",
+				"titleProp": "jcr:content/jcr:title"
+			},
+			"contenttable": {
+				"jcr:primaryType": "nt:unstructured",
+				"sling:resourceType": "sling-cms/components/cms/contenttable",
+				"columns": {
+					"jcr:primaryType": "nt:unstructured",
+					"name": {
+						"jcr:primaryType": "nt:unstructured",
+						"title": "Name"
+					},
+					"title": {
+						"jcr:primaryType": "nt:unstructured",
+						"title": "Title"
+					},
+					"published": {
+						"jcr:primaryType": "nt:unstructured",
+						"title": "Published"
+					},
+					"type": {
+						"jcr:primaryType": "nt:unstructured",
+						"title": "Type"
+					},
+					"lastModified": {
+						"jcr:primaryType": "nt:unstructured",
+						"title": "Last Modified"
+					},
+					"actions": {
+						"jcr:primaryType": "nt:unstructured",
+						"title": "Actions"
+					}
+				},
+				"types": {
+					"jcr:primaryType": "nt:unstructured",
+					"sling:File":{
+						"jcr:primaryType": "nt:unstructured",
+						"columns": {
+							"jcr:primaryType": "nt:unstructured",
+							"name": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/name",
+								"link": false
+							},
+							"title": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/text",
+								"link": false,
+								"type": "Name"
+							},
+							"publish": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/publish"
+							},
+							"type": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/static",
+								"value": "File"
+							},
+							"lastModified": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/lastmodified",
+								"subPath": "jcr:content/"
+							},
+							"actions": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/actions",
+								"edit": {
+									"jcr:primaryType": "nt:unstructured",
+									"modal": true,
+									"title": "Edit File",
+									"text": "&#x270f;",
+									"prefix": "/cms/file/edit.html"
+								},
+								"download": {
+									"jcr:primaryType": "nt:unstructured",
+									"modal": false,
+									"title": "Download file",
+									"text": "&#x21e9;"
+								},
+								"movecopy": {
+									"jcr:primaryType": "nt:unstructured",
+									"modal": true,
+									"title": "Move / Copy File",
+									"text": "&#x21c6;",
+									"prefix": "/cms/shared/movecopy.html"
+								},
+								"version": {
+									"jcr:primaryType": "nt:unstructured",
+									"ajaxPath": ".versionmanager",
+									"modal": true,
+									"title": "Manage Versions",
+									"text": "&#10710;",
+									"prefix": "/cms/shared/versions.html"
+								},
+								"delete": {
+									"jcr:primaryType": "nt:unstructured",
+									"modal": true,
+									"title": "Delete File",
+									"text": "&times;",
+									"prefix": "/cms/shared/delete.html"
+								}
+							}
+						}
+					},
+					"sling:OrderedFolder":{
+						"jcr:primaryType": "nt:unstructured",
+						"columns": {
+							"jcr:primaryType": "nt:unstructured",
+							"name": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/name",
+								"link": true,
+								"prefix": "/cms/site/content.html"
+							},
+							"title": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/text",
+								"property": "jcr:content/jcr:title",
+								"type": "String"
+							},
+							"publish": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/publish"
+							},
+							"type": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/static",
+								"value": "Folder"
+							},
+							"lastModified": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/lastmodified",
+								"subPath": "jcr:content/"
+							},
+							"actions": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/actions",
+								"edit": {
+									"jcr:primaryType": "nt:unstructured",
+									"modal": true,
+									"title": "Edit Folder",
+									"text": "&#x270f;",
+									"prefix": "/cms/folder/edit.html"
+								},
+								"movecopy": {
+									"jcr:primaryType": "nt:unstructured",
+									"modal": true,
+									"title": "Move / Copy Folder",
+									"text": "&#x21c6;",
+									"prefix": "/cms/shared/movecopy.html"
+								},
+								"delete": {
+									"jcr:primaryType": "nt:unstructured",
+									"title": "Delete Folder",
+									"text": "&times;",
+									"prefix": "/cms/shared/delete.html",
+									"modal": true
+								}
+							}
+						}
+					},
+					"sling:Folder":{
+						"jcr:primaryType": "nt:unstructured",
+						"columns": {
+							"jcr:primaryType": "nt:unstructured",
+							"name": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/name",
+								"link": true,
+								"prefix": "/cms/site/content.html"
+							},
+							"title": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/text",
+								"property": "jcr:content/jcr:title",
+								"type": "String"
+							},
+							"publish": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/publish"
+							},
+							"type": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/static",
+								"value": "Folder"
+							},
+							"lastModified": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/lastmodified",
+								"subPath": "jcr:content/"
+							},
+							"actions": {
+								"jcr:primaryType": "nt:unstructured",
+								"sling:resourceType": "sling-cms/components/cms/columns/actions",
+								"edit": {
+									"jcr:primaryType": "nt:unstructured",
+									"modal": true,
+									"title": "Edit Folder",
+									"text": "&#x270f;",
+									"prefix": "/cms/folder/edit.html"
+								},
+								"movecopy": {
+									"jcr:primaryType": "nt:unstructured",
+									"modal": true,
+									"title": "Move / Copy Folder",
+									"text": "&#x21c6;",
+									"prefix": "/cms/shared/movecopy.html"
+								},
+								"delete": {
+									"jcr:primaryType": "nt:unstructured",
+									"title": "Delete Folder",
+									"text": "&times;",
+									"prefix": "/cms/shared/delete.html",
+									"modal": true
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}
\ No newline at end of file

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