You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by bu...@apache.org on 2013/07/22 10:13:03 UTC

svn commit: r870548 - in /websites/staging/felix/trunk/content: ./ documentation/subprojects/apache-felix-script-console-plugin.html

Author: buildbot
Date: Mon Jul 22 08:13:03 2013
New Revision: 870548

Log:
Staging update by buildbot for felix

Modified:
    websites/staging/felix/trunk/content/   (props changed)
    websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-script-console-plugin.html

Propchange: websites/staging/felix/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Jul 22 08:13:03 2013
@@ -1 +1 @@
-1505620
+1505621

Modified: websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-script-console-plugin.html
==============================================================================
--- websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-script-console-plugin.html (original)
+++ websites/staging/felix/trunk/content/documentation/subprojects/apache-felix-script-console-plugin.html Mon Jul 22 08:13:03 2013
@@ -80,11 +80,10 @@ features</p>
 <li>Hot key support</li>
 <li>Execute remote testcase via evaluating test scripts</li>
 </ul>
-<p>A collection of useful scripts is maintained in <a href="https://gist.github.com/3748614">this gist</a></p>
 <h3 id="installation">Installation</h3>
 <p>Untill the bundle is released you would need to build it and deploy</p>
 <h3 id="usage">Usage</h3>
-<p>After installing it you would see a new tab "Script Console" in <a href="http://localhost:4502/system/console">Felix Web Console</a>.
+<p>After installing it you would see a new tab "Script Console" in Felix Web Console.
 The plugin screen provides a textarea to author script code. One can select the language via the given dropdown. The generated
 output is shown in pane below.</p>
 <p>The script exposes following variables</p>
@@ -127,26 +126,25 @@ output is shown in pane below.</p>
 </li>
 </ul>
 <p>If any exception occurs while evaluating the script then it would return the exception message with status set to 500. Scripts can control what output they want to emit.</p>
-<h3 id="screenshots">Screenshots</h3>
-<p><img src="script-console-1.png"></p>
 <h3 id="sample-scripts">Sample Scripts</h3>
 <p>Following are some sample scripts in Groovy. Note the scripts might be depending on implementation details to access the
 relevant data structures</p>
-<p>1 Script to find out servlets which are registered problematically with Felix HTTP Service</p>
-<div class="codehilite"><pre>    :::groovy
-    import org.osgi.service.http.HttpService
-    import org.osgi.framework.FrameworkUtil
-    import org.osgi.framework.Bundle
-
-    def httpService = osgi.getService(HttpService.class)
-    httpService.handlerRegistry.aliasMap.each{alias,servlet -&gt;
-        Bundle bnd = FrameworkUtil.getBundle(servlet.class)
-        println &quot;<span class="nv">$alias</span> : <span class="cp">${</span><span class="n">servlet</span><span class="o">.</span><span class="n">class</span><span class="o">.</span><span class="n">name</span><span class="cp">}</span> (<span class="nv">$bnd.symbolicName</span>)&quot;
-    }
+<ol>
+<li>
+<p>Script to find out servlets which are registered problematically with Felix HTTP Service</p>
+<div class="codehilite"><pre><span class="kn">import</span> <span class="nn">org.osgi.service.http.HttpService</span>
+<span class="kn">import</span> <span class="nn">org.osgi.framework.FrameworkUtil</span>
+<span class="kn">import</span> <span class="nn">org.osgi.framework.Bundle</span>
+
+<span class="kt">def</span> <span class="n">httpService</span> <span class="o">=</span> <span class="n">osgi</span><span class="o">.</span><span class="na">getService</span><span class="o">(</span><span class="n">HttpService</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+<span class="n">httpService</span><span class="o">.</span><span class="na">handlerRegistry</span><span class="o">.</span><span class="na">aliasMap</span><span class="o">.</span><span class="na">each</span><span class="o">{</span><span class="n">alias</span><span class="o">,</span><span class="n">servlet</span> <span class="o">-&gt;</span>
+    <span class="n">Bundle</span> <span class="n">bnd</span> <span class="o">=</span> <span class="n">FrameworkUtil</span><span class="o">.</span><span class="na">getBundle</span><span class="o">(</span><span class="n">servlet</span><span class="o">.</span><span class="na">class</span><span class="o">)</span>
+    <span class="n">println</span> <span class="s2">&quot;$alias : ${servlet.class.name} ($bnd.symbolicName)&quot;</span>
+<span class="o">}</span>
 </pre></div>
 
 
-<ol>
+</li>
 <li>
 <p>Script to load a class which is not exported and then invoke some static method on that class. At times you need to
 access some private class to see the runtime state.</p>
@@ -200,8 +198,10 @@ access some private class to see the run
 
 </li>
 </ol>
+<h3 id="screenshots">Screenshots</h3>
+<p><img src="script-console-1.png"></p>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1505620 by chetanm on Mon, 22 Jul 2013 08:10:39 +0000
+        Rev. 1505621 by chetanm on Mon, 22 Jul 2013 08:12:54 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Felix, Felix, Apache, the Apache feather logo, and the Apache Felix project