incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1375983 - in /sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal: RuntimeScriptResource.java ScriptConsolePlugin.java
Date Wed, 22 Aug 2012 11:03:01 GMT
Author: cziegeler
Date: Wed Aug 22 11:03:00 2012
New Revision: 1375983

URL: http://svn.apache.org/viewvc?rev=1375983&view=rev
Log:
Extend from AbstractResource

Modified:
    sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal/RuntimeScriptResource.java
    sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal/ScriptConsolePlugin.java

Modified: sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal/RuntimeScriptResource.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal/RuntimeScriptResource.java?rev=1375983&r1=1375982&r2=1375983&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal/RuntimeScriptResource.java
(original)
+++ sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal/RuntimeScriptResource.java
Wed Aug 22 11:03:00 2012
@@ -14,7 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.sling.scripting.console.internal;
 
 import java.io.ByteArrayInputStream;
@@ -23,24 +22,18 @@ import java.io.UnsupportedEncodingExcept
 import java.util.Collections;
 import java.util.Iterator;
 
-import org.apache.sling.adapter.SlingAdaptable;
+import org.apache.sling.api.resource.AbstractResource;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
 import org.apache.sling.api.resource.ResourceResolver;
 
-/**
- * User: chetanm
- * Date: 5/1/12
- * Time: 12:20 PM
- */
-class RuntimeScriptResource extends SlingAdaptable implements Resource {
+class RuntimeScriptResource extends AbstractResource implements Resource {
+
     private ResourceMetadata metadata = new ResourceMetadata();
-    private final String extension;
     private final String path;
     private final byte[] scriptContent;
 
     public RuntimeScriptResource(String extension, String scriptText) {
-        this.extension = extension;
         this.scriptContent = getScriptContent(scriptText);
         this.path = "script." + extension;
     }

Modified: sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal/ScriptConsolePlugin.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal/ScriptConsolePlugin.java?rev=1375983&r1=1375982&r2=1375983&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal/ScriptConsolePlugin.java
(original)
+++ sling/trunk/contrib/scripting/script-console/src/main/java/org/apache/sling/scripting/console/internal/ScriptConsolePlugin.java
Wed Aug 22 11:03:00 2012
@@ -14,13 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.sling.scripting.console.internal;
 
-import java.io.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+
 import javax.script.ScriptEngineFactory;
 import javax.script.ScriptEngineManager;
 import javax.servlet.ServletException;
@@ -29,7 +33,12 @@ import javax.servlet.http.HttpServletRes
 
 import org.apache.commons.fileupload.FileItem;
 import org.apache.commons.io.IOUtils;
-import org.apache.felix.scr.annotations.*;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.felix.webconsole.AbstractWebConsolePlugin;
 import org.apache.felix.webconsole.DefaultVariableResolver;
 import org.apache.felix.webconsole.SimpleWebConsolePlugin;
@@ -43,15 +52,11 @@ import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/**
- * User: chetanm
- * Date: 4/30/12
- * Time: 9:06 PM
- */
 @Component
 @Service
 @Property(name = "felix.webconsole.label", value = ScriptConsolePlugin.NAME)
 public class ScriptConsolePlugin extends SimpleWebConsolePlugin {
+
     private Logger log = LoggerFactory.getLogger(getClass());
     public static final String NAME = "scriptconsole";
     private static final String TITLE = "%script.title";
@@ -97,8 +102,6 @@ public class ScriptConsolePlugin extends
         //enclosing OSGi container
         bindings.put("bundleContext", bundleContext);
 
-
-
         final String lang = WebConsoleUtil.getParameter(req, "lang");
         final Resource resource = new RuntimeScriptResource(lang, script);
         final boolean webClient = "webconsole".equals(WebConsoleUtil.getParameter(req,"client"));
@@ -241,6 +244,4 @@ public class ScriptConsolePlugin extends
     public void deactivate() {
         super.deactivate();
     }
-
-
 }



Mime
View raw message