You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2017/03/24 15:09:47 UTC

svn commit: r1788464 [2/2] - in /sling/trunk/contrib/scripting/esx: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/sling/ src/main/java/org/apache/sling/scripting/ src/main/java/org/apache/sling/s...

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/helper/pathinfo/index.js Fri Mar 24 15:09:46 2017
@@ -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.
+ */
+var _ = require('underscore');
+var pathInfo = sling.request.requestPathInfo;
+
+/**
+ *
+ * @param {string} selector to be searched for
+ * @return {boolean}
+ */
+function hasSelector(selector) {
+    return _.contains(pathInfo.selectors, selector);
+}
+
+exports.extension = pathInfo.extension;
+exports.hasSelector = hasSelector;
\ No newline at end of file

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/page.esx
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/page.esx?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/page.esx (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/page.esx Fri Mar 24 15:09:46 2017
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+var math = require("calculator");
+var pathInfo = require("./helper/pathinfo");
+var moment = require("moment");
+var _ = require('underscore');
+
+var BlogComponent = require("BlogComponent");
+
+function PageComponent() {
+    BlogComponent.call(this);
+    this.partialContentTemplateURL = __dirname + "/templates/listing.html"
+}
+PageComponent.prototype = Object.create(BlogComponent.prototype);
+
+PageComponent.prototype.init = function () {
+    var list = [];
+    var posts = require("resource!" + this.basePath + "/posts").simpleResource.children;
+    for each(var post in posts) {
+        var blogPostModel = {};
+        var createdAt = parseInt(post.getDateTimeProperty("jcr:created"));
+        blogPostModel.content = this.transformMarkdown(post.properties.content);
+        blogPostModel.properties = post.properties;
+        blogPostModel.path = post.path;
+        blogPostModel.date = moment(createdAt).format('MMMM Do YYYY, h:mm:ss a');
+        list.push(blogPostModel);
+    }
+
+    this.model.posts = list;
+}
+
+module.exports = new PageComponent();
\ No newline at end of file

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/templates/listing.html
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/templates/listing.html?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/templates/listing.html (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/templates/listing.html Fri Mar 24 15:09:46 2017
@@ -0,0 +1,29 @@
+{{!--/*
+ * 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.
+ */--}}
+{{#each posts}}
+<div class="row">
+<div class="card">
+<div class="card-block">
+    <h4 class="card-title">{{this.properties.jcr:title}}</h4>
+    <h6 class="card-subtitle mb-2 text-muted">{{date}}</h6>
+    <p class="card-text">{{{this.content}}}</p>
+    <a href="{{this.path}}.html" class="card-link">more</a>
+</div>
+</div>
+</div>
+<div class="row">&nbsp;</div>
+{{/each}}

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/templates/mobile.html
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/templates/mobile.html?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/templates/mobile.html (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/page/templates/mobile.html Fri Mar 24 15:09:46 2017
@@ -0,0 +1,17 @@
+{{!--/*
+ * 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.
+ */--}}
+ mobile selector

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/post/post.esx
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/post/post.esx?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/post/post.esx (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/post/post.esx Fri Mar 24 15:09:46 2017
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+var moment = require("moment");
+var _ = require('underscore');
+var BlogComponent = require("BlogComponent");
+
+function BlogPostComponent() {
+    BlogComponent.call(this);
+    this.partialContentTemplateURL = __dirname + "/templates/detail.html"
+}
+BlogPostComponent.prototype = Object.create(BlogComponent.prototype);
+
+BlogPostComponent.prototype.init = function () {
+    var createdAt = parseInt(simpleResource.getDateTimeProperty("jcr:created"));
+    this.model.blogpost = this.transformMarkdown(currentNode.properties.content);
+    this.model.date = moment(createdAt).format('MMMM Do YYYY');
+}
+
+module.exports = new BlogPostComponent();
\ No newline at end of file

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/post/templates/detail.html
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/post/templates/detail.html?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/post/templates/detail.html (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/components/post/templates/detail.html Fri Mar 24 15:09:46 2017
@@ -0,0 +1,17 @@
+{{!--/*
+ * 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.
+ */--}}
+{{{blogpost}}}

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/content/demo.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/content/demo.xml?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/content/demo.xml (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/content/demo.xml Fri Mar 24 15:09:46 2017
@@ -0,0 +1,175 @@
+<!--
+/*
+ * 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.
+ */
+-->
+<node>
+  <primaryNodeType>sling:Folder</primaryNodeType>
+  <property>
+      <name>sling:resourceType</name>
+      <value>esx/demo/components/page</value>
+  </property>
+  <property>
+      <name>jcr:title</name>
+      <value>ESX Demo</value>
+  </property>
+  <property>
+    <name>pageTitle</name>
+    <value>This is an Apache Sling ESX Scripting Demo</value>
+  </property>
+  <property>
+      <name>navTitle</name>
+      <value>Home</value>
+  </property>
+  <property>
+    <name>content</name>
+    <value># header 1
+      ## header 2</value>
+  </property>
+  <node>
+      <primaryNodeType>sling:Folder</primaryNodeType>
+      <name>posts</name>
+      <node>
+            <primaryNodeType>sling:Folder</primaryNodeType>
+            <name>post1</name>
+            <property>
+                <name>sling:resourceType</name>
+                <value>esx/demo/components/post</value>
+            </property>
+            <property>
+              <name>order</name>
+              <value>100</value>
+            </property>
+                <property>
+                  <name>jcr:title</name>
+                  <value>post one</value>
+                </property>
+                <property>
+                  <name>content</name>
+                  <value>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
+## Lorem ipsu
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
+
+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
+### Lorem ipsu
+Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
+
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.
+
+### Lorem ipsu
+*At* vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.
+
+Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus.
+
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
+
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
+
+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </value>
+</property>
+      </node>
+<node>
+            <primaryNodeType>sling:Folder</primaryNodeType>
+            <name>post2</name>
+            <property>
+                <name>sling:resourceType</name>
+                <value>esx/demo/components/post</value>
+            </property>
+                <property>
+                  <name>jcr:title</name>
+                  <value>second blog post</value>
+                </property>
+                <property>
+                  <name>order</name>
+                  <value>50</value>
+                </property>
+
+                <property>
+                  <name>content</name>
+                  <value>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam vehicula, mi id suscipit efficitur, mauris felis porttitor neque, eget tempus metus urna vel urna. Quisque in elit massa. Donec tempus, elit in vulputate auctor, ante arcu feugiat enim, eu condimentum purus leo id metus. In auctor sodales nulla sit amet volutpat. In egestas ex lectus, non dapibus lectus dapibus id. Nullam vulputate nec urna in pretium. Ut mattis sodales rutrum. Morbi a dolor laoreet, auctor nisl non, aliquet odio. Vestibulum sollicitudin sapien vel viverra molestie. Curabitur vitae volutpat ex, nec dictum nisi. Nulla auctor orci ultricies dolor commodo, id efficitur erat faucibus. Nulla eu scelerisque leo. Integer non convallis purus. Etiam urna felis, efficitur nec finibus ut, blandit et mi.
+## js cloudflare
+
+```javascript
+  render: function () {
+      currentNode.mathVersion = math.VERSION;
+      currentNode.result = math.math(2,2);
+      currentNode.demoResource = demoResource;
+      currentNode.mdcontent = marked(currentNode.properties.content);
+      currentNode.style = stylesheet;
+```
+
+```java
+  class Test {
+    public Test() {
+      super();
+    }
+
+
+  }
+```
+
+> Proin sed pharetra nulla. Proin dui elit, pellentesque ac dolor a, imperdiet fermentum lorem. Integer tempus cursus sagittis. Donec quis aliquet ante. Nunc efficitur elementum consectetur. Maecenas ornare pulvinar feugiat. Nulla iaculis ultrices elit, eu dapibus diam facilisis nec. Pellentesque sit amet augue dui. In nec varius magna. Sed suscipit dignissim mollis. Pellentesque ultricies finibus consectetur. Phasellus dictum ligula mauris, sed dictum ipsum facilisis at. Sed vitae libero eu lectus lobortis eleifend. Sed vel metus sit amet ex blandit sodales. Quisque nec blandit velit. Donec mattis odio in velit porttitor, et facilisis velit vehicula.
+
+Praesent euismod eget mi nec porta. Donec auctor finibus enim. Pellentesque ut sollicitudin tellus. Fusce placerat aliquet nibh et placerat. Mauris eget metus ipsum. Suspendisse congue elit a justo fringilla, sed varius purus volutpat. Nam ac massa enim. Phasellus posuere, magna sed elementum feugiat, velit ex volutpat quam, et ultricies metus lectus quis lectus.</value>
+</property>
+      </node>
+  </node>
+  <node>
+      <primaryNodeType>sling:Folder</primaryNodeType>
+      <name>pages</name>
+      <node>
+            <primaryNodeType>sling:Folder</primaryNodeType>
+            <name>About</name>
+            <property>
+                <name>sling:resourceType</name>
+                <value>esx/demo/components/post</value>
+            </property>
+            <property>
+              <name>order</name>
+              <value>100</value>
+            </property>
+                <property>
+                  <name>jcr:title</name>
+                  <value>About this Blog</value>
+                </property>
+                <property>
+                  <name>content</name>
+                  <value>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
+## Lorem ipsu
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
+
+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
+### Lorem ipsu
+Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
+
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis.
+
+### Lorem ipsu
+*At* vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, At accusam aliquyam diam diam dolore dolores duo eirmod eos erat, et nonumy sed tempor et et invidunt justo labore Stet clita ea et gubergren, kasd magna no rebum. sanctus sea sed takimata ut vero voluptua. est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat.
+
+Consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus.
+
+Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
+
+Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
+
+Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. </value>
+</property>
+      </node>
+</node>
+
+
+</node>

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/package.json
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/package.json?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/package.json (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/demo/package.json Fri Mar 24 15:09:46 2017
@@ -0,0 +1,17 @@
+{
+  "name": "esxdemo",
+  "version": "1.0.0",
+  "description": "Apache Sling ESX Demo",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "author": "",
+  "license": "ISC",
+  "dependencies": {
+    "handlebars": "^4.0.6",
+    "marked": "^0.3.6",
+    "moment": "^2.18.0",
+    "underscore": "^1.8.3"
+  }
+}

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/fs/index.js
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/fs/index.js?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/fs/index.js (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/fs/index.js Fri Mar 24 15:09:46 2017
@@ -0,0 +1,16 @@
+/*
+ * 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.
+ */

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/path/index.js
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/path/index.js?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/path/index.js (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/path/index.js Fri Mar 24 15:09:46 2017
@@ -0,0 +1,210 @@
+
+/*
+ * 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.
+ */
+/*
+The path module provides utilities for working with file and directory paths. It can be accessed using:
+
+const path = require('path');
+@see https://nodejs.org/api/path.html
+
+*/
+// using posix
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_delimiter
+ */
+var delimiter = ":";
+
+var sep = "/";
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_basename_path_ext
+ */
+function basename(path, ext) {
+  var startPosition = path.lastIndexOf("/") + 1;
+  var endPosition = (ext) ? (path.length-ext.length) : path.length;
+  return path.substring(startPosition, endPosition);
+}
+
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_dirname_path
+ */
+function dirname(path) {
+  if(path) {
+    var dirname = "";
+    var parts = path.split("/");
+    var endPosition = (parts[parts.length-1] == 0) ? parts.length-2 : parts.length-1;
+    for(var i=0; i < endPosition; i++){
+      var part = parts[i].trim();
+      if(part.length > 0)
+        dirname += "/" + part;
+    }
+    return dirname;
+  }
+  return ".";
+}
+
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_extname_path
+ */
+function extname(path) {
+  var lastPosition = path.lastIndexOf(".");
+  var baseName = basename(path);
+  if(lastPosition == -1 || baseName.startsWith("."))  {
+    return "";
+  }
+  return baseName.substring(baseName.lastIndexOf("."), baseName.length);
+}
+
+/*
+@see https://nodejs.org/api/path.html#path_path_format_pathobject
+pathObject <Object>
+dir <String>
+root <String>
+base <String>
+name <String>
+ext <String>
+Returns: <String>
+*/
+function format(pathObject){
+  var dir = pathObject.dir;
+  var root = pathObject.root;
+  var base = pathObject.base;
+  var name = pathObject.name;
+  var ext = pathObject.ext;
+  var first = dir;
+  var middle = sep;
+  var end = base;
+
+  if(dir && root && base) {
+    first = dir;
+    middle = sep;
+    end = base;
+  }
+  if(!dir) {
+      first = root;
+  }
+
+  if(!dir || dir == root) {
+    middle = "";
+  }
+
+  if(!base) {
+    middle = "";
+    end = name + ext;
+  }
+
+  return  first.middle.end;// for es6: `${first}${middle}${end}`
+}
+
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_isabsolute_path
+ */
+function isAbsolute(path) {
+  if(path && path.length == 0) {
+    return false;
+  }
+
+  return path.startsWith("/");
+}
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_join_paths
+ */
+function join() {
+  var path = "";
+  var max = arguments.length - 1;
+  for(key in arguments) {
+    var value = arguments[key];
+
+    if((value instanceof Object)) {
+      throw "TypeError: Arguments to path.join must be strings"
+    }
+    if(value && value.length > 0) {
+      path +=  value;
+      if(key < max) {
+        path += sep;
+      }
+    }
+  }
+  return (path.length == 0) ? "." : normalize(path);
+}
+
+
+/**
+ * @see https://nodejs.org/api/path.html#path_path_normalize_path
+ */
+function normalize(path) {
+  if(path.length == 0) {
+    return ".";
+  }
+
+  var parts = path.split(sep);
+  var normalizedPath = "";
+  for(i in parts) {
+    var dir = parts[i];
+    var a = parseInt(i) + 1;
+
+
+    if(parts[a] == ".." || dir == ".." || dir == ".") {
+      i=i+2;
+      continue;
+    }
+
+    if(dir.length > 0 && dir != sep) {
+      normalizedPath += sep;
+      normalizedPath += dir;
+    }
+  }
+  return normalizedPath;
+}
+
+
+/*
+
+path.parse(path)
+path.posix
+path.relative(from, to)
+path.resolve([...paths])
+
+*/
+
+exports.basename = basename;
+exports.delimiter = delimiter;
+exports.dirname = dirname;
+exports.extname = extname;
+exports.format = format;
+exports.sep = sep;
+exports.isAbsolute = isAbsolute;
+exports.join = join;
+exports.normalize = normalize;
+
+exports.posix = {};
+exports.posix.basename = basename;
+exports.posix.delimiter = delimiter;
+exports.posix.dirname = dirname;
+exports.posix.extname = extname;
+
+exports.win32 = {};
+// actually not implemented yet
+exports.win32.basename = basename;
+exports.win32.delimiter = delimiter;
+exports.win32.dirname = dirname;
+exports.win32.extname = extname;
\ No newline at end of file

Added: sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/url/index.js
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/url/index.js?rev=1788464&view=auto
==============================================================================
--- sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/url/index.js (added)
+++ sling/trunk/contrib/scripting/esx/src/main/resources/libs/esx/esx_modules/url/index.js Fri Mar 24 15:09:46 2017
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+/**
+ * URL Module
+ * only Sling specific functions are implemented from:
+ * org.apache.sling.api.request Interface RequestPathInfo
+ *
+ * needs to be extended to support full: https://nodejs.org/api/url.html
+ * This Function should return an annotated URL element including
+ * sling specific informatin like suffix, resourcePath, selectors, selector string
+ * @param link (location.href for instance or resoruce path)
+ * @returns {URL}
+ * not implemented yet.
+ * adopt: https://github.com/labertasch/slingui/blob/master/stream/src/main/resources/SLING-INF/libs/slingui/client/src/utils/URL.js
+ */
+
+ function getAbsoluteParent(path, level){
+     var idx = 0;
+     var len = path.length;
+     while (level >= 0 && idx < len) {
+            idx = path.indexOf('/', idx + 1);
+            if (idx < 0) {
+                  idx = len;
+             }
+            level--;
+      }
+     return level >= 0 ? "" : path.substring(0, idx);
+ }
+
+
+ function getRelativeParent(path, level) {
+     var idx = path.length;
+     while (level > 0) {
+             idx = path.lastIndexOf('/', idx - 1);
+            if (idx < 0) {
+                     return "";
+                 }
+             level--;
+         }
+     return (idx == 0) ? "/" : path.substring(0, idx);
+ }
+
+ function getRelativeParent(path, level) {
+     var idx = path.length;
+     while (level > 0) {
+             idx = path.lastIndexOf('/', idx - 1);
+            if (idx < 0) {
+                     return "";
+                 }
+             level--;
+         }
+     return (idx == 0) ? "/" : path.substring(0, idx);
+ }
+
+exports.getAbsoluteParent = getAbsoluteParent;
+exports.getRelativeParent = getRelativeParent;