incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r600516 - /incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java
Date Mon, 03 Dec 2007 13:07:41 GMT
Author: bdelacretaz
Date: Mon Dec  3 05:07:40 2007
New Revision: 600516

URL: http://svn.apache.org/viewvc?rev=600516&view=rev
Log:
SLING-114 - EctScriptEngine adapted to Sling API changes

Modified:
    incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java

Modified: incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java?rev=600516&r1=600515&r2=600516&view=diff
==============================================================================
--- incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java
(original)
+++ incubator/sling/trunk/microsling/microsling-core/src/main/java/org/apache/sling/microsling/experimental/EctScriptEngine.java
Mon Dec  3 05:07:40 2007
@@ -32,7 +32,6 @@
 
 import org.apache.sling.api.HttpStatusCodeException;
 import org.apache.sling.api.SlingException;
-import org.apache.sling.api.resource.NodeProvider;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.scripting.SlingScript;
 import org.apache.sling.api.scripting.SlingScriptEngine;
@@ -70,11 +69,11 @@
         try {
             // access our data (need a Node)
             final Resource r = (Resource)props.get(SlingScriptEngine.RESOURCE);
-            if( !(r instanceof NodeProvider) ) {
+            final Node n = r.adaptTo(Node.class);
+            if(n == null) {
                 throw new HttpStatusCodeException(
-                        HttpServletResponse.SC_NOT_FOUND,"Resource is not a NodeProvider,
cannot render");
+                        HttpServletResponse.SC_NOT_FOUND,"Resource does not provide a Node,
cannot render");
             }
-            final Node n = ((NodeProvider)r).getNode();
             
             // output HEAD with javascript initializations
             w.println("<html><head><title id=\"EctPageTitle\">");



Mime
View raw message