incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r591638 - in /incubator/sling/trunk/microsling/microsling-core: ./ src/main/java/org/apache/sling/microsling/slingservlets/ src/main/webapp/ src/main/webapp/WEB-INF/
Date Sat, 03 Nov 2007 15:47:30 GMT
Author: bdelacretaz
Date: Sat Nov  3 08:47:30 2007
New Revision: 591638

URL: http://svn.apache.org/viewvc?rev=591638&view=rev
Log:
Mount microsling webapp on the root, and update examples for the latest changes

Modified:
    incubator/sling/trunk/microsling/microsling-core/pom.xml
    incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/slingservlets/MicrojaxPostServlet.java
    incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/web.xml
    incubator/sling/trunk/microsling/microsling-core/src/main/webapp/erb-scripts.html
    incubator/sling/trunk/microsling/microsling-core/src/main/webapp/freemarker-scripts.html
    incubator/sling/trunk/microsling/microsling-core/src/main/webapp/velocity-scripts.html

Modified: incubator/sling/trunk/microsling/microsling-core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/pom.xml?rev=591638&r1=591637&r2=591638&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/pom.xml (original)
+++ incubator/sling/trunk/microsling/microsling-core/pom.xml Sat Nov  3 08:47:30 2007
@@ -177,7 +177,7 @@
             -->
             <property>
               <name>microsling.http.server.url</name>
-              <value>http://localhost:8080/microsling</value>
+              <value>http://localhost:8080</value>
             </property>
             <property>
               <name>microsling.webdav.server.url</name>
@@ -232,7 +232,7 @@
                     -->
                     <property>
                       <name>microsling.http.server.url</name>
-                      <value>http://localhost:8080/microsling-core-1.0-incubator-SNAPSHOT/microsling</value>
+                      <value>http://localhost:8080/microsling-core-1.0-incubator-SNAPSHOT</value>
                     </property>
                     <property>
                       <name>microsling.webdav.server.url</name>

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/slingservlets/MicrojaxPostServlet.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/slingservlets/MicrojaxPostServlet.java?rev=591638&r1=591637&r2=591638&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/slingservlets/MicrojaxPostServlet.java
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/slingservlets/MicrojaxPostServlet.java
Sat Nov  3 08:47:30 2007
@@ -119,22 +119,19 @@
             final String savePrefix = getSavePrefix(request);
             
             // compute the path of the node to process, and deep-create if if needed
+            // TODO how to differentiate "create node" and "update node"?
+            // for now we always create a new node
             final Set<Node> changedNodes = new HashSet<Node>();
             String pathToCreate = null;
-            if(currentNode == null) {
+            if(currentNode!=null) {
+                pathToCreate = currentPath;
+            } else {
                 pathToCreate = request.getPathInfo();
-                if(!pathToCreate.endsWith("/")) {
-                    pathToCreate += "/";
-                }
-                pathToCreate += (createNodeCounter++) + System.currentTimeMillis();
-                
-            } else if(request.getRequestPathInfo().getSuffix() != null) {
-                // we have a suffix, that means our Resource is higher in
-                // the hierarchy than what the request path points to, we
-                // need to create the Node that the request meant to find
-                pathToCreate += request.getRequestPathInfo().getSuffix();
-                
             }
+            if(!pathToCreate.endsWith("/")) {
+                pathToCreate += "/";
+            }
+            pathToCreate += (createNodeCounter++) + System.currentTimeMillis();
             if(pathToCreate!=null) {
                 newNode = currentNode = deepCreateNode(s,pathToCreate, changedNodes);
             }

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/web.xml?rev=591638&r1=591637&r2=591638&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/webapp/WEB-INF/web.xml Sat Nov
 3 08:47:30 2007
@@ -142,7 +142,7 @@
 
   <servlet-mapping>
     <servlet-name>Microsling</servlet-name>
-    <url-pattern>/microsling/*</url-pattern>
+    <url-pattern>/*</url-pattern>
   </servlet-mapping>
   <servlet-mapping>
     <servlet-name>Webdav</servlet-name>

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/webapp/erb-scripts.html
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/webapp/erb-scripts.html?rev=591638&r1=591637&r2=591638&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/webapp/erb-scripts.html (original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/webapp/erb-scripts.html Sat
Nov  3 08:47:30 2007
@@ -21,19 +21,19 @@
     Here's an example HTML template. See the <a href="http://www.ruby-doc.org/stdlib/libdoc/erb/rdoc/">Erb
docs</a> website 
     more info about the syntax.
     <pre>
-      &lt;html>
-        &lt;body>
-          &lt;p>&lt;span>This is an example Erb template &lt;%= Time.now
%>&lt;/span>&lt;/p>
-          &lt;p>&lt;span>&lt;%= resource.getItem().getProperty("text").getString()
%>&lt;/span>&lt;/p>
-          &lt;% unless props.nil? or props.empty? %>
-            &lt;table>
-              &lt;% for prop, val in props %>
-                &lt;tr>&lt;td>&lt;b>&lt;%= prop %>&lt;/b>:&lt;/td>&lt;td>&lt;%=
val %>&lt;/td>&lt;/tr>
-              &lt;% end %>
-            &lt;/table>
-          &lt;% end %>
-        &lt;/body>
-      &lt;/html></pre>  
+&lt;html>
+  &lt;body>
+    &lt;p>&lt;span>This is an example Erb template &lt;%= Time.now %>&lt;/span>&lt;/p>
+    &lt;p>&lt;span>&lt;%= resource.getRawData().getProperty("text").getString()
%>&lt;/span>&lt;/p>
+    &lt;% unless props.nil? or props.empty? %>
+      &lt;table>
+        &lt;% for prop, val in props %>
+          &lt;tr>&lt;td>&lt;b>&lt;%= prop %>&lt;/b>:&lt;/td>&lt;td>&lt;%=
val %>&lt;/td>&lt;/tr>
+        &lt;% end %>
+      &lt;/table>
+    &lt;% end %>
+  &lt;/body>
+&lt;/html></pre>  
   </p>
 </body>
 </html>

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/webapp/freemarker-scripts.html
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/webapp/freemarker-scripts.html?rev=591638&r1=591637&r2=591638&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/webapp/freemarker-scripts.html
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/webapp/freemarker-scripts.html
Sat Nov  3 08:47:30 2007
@@ -27,9 +27,9 @@
   The current resource URI is &lt;b>${resource.URI}&lt;/b>
 &lt;/p>
 
-&lt;h2>${resource.getItem().getProperty("title").getString()}&lt;/h2>
+&lt;h2>${resource.getRawData().getProperty("title").getString()}&lt;/h2>
 &lt;p>
-  ${resource.getItem().getProperty("text").getString()}
+  ${resource.getRawData().getProperty("text").getString()}
 &lt;/p>
 
 &lt;/body></pre>  

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/webapp/velocity-scripts.html
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/webapp/velocity-scripts.html?rev=591638&r1=591637&r2=591638&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/webapp/velocity-scripts.html
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/webapp/velocity-scripts.html
Sat Nov  3 08:47:30 2007
@@ -50,9 +50,9 @@
   The current resource URI is &lt;b>$resource.URI&lt;/b>
 &lt;/p>
 
-&lt;h2>$resource.getItem().getProperty("title").getString()&lt;/h2>
+&lt;h2>$resource.getRawData().getProperty("title").getString()&lt;/h2>
 &lt;p>
-  $resource.getItem().getProperty("text").getString()
+  $resource.getRawData().getProperty("text").getString()
 &lt;/p>
 
 &lt;/body>



Mime
View raw message