Added: 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/iframe_history.html
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/iframe_history.html?rev=652919&view=auto
==============================================================================
--- 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/iframe_history.html
 (added)
+++ 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/iframe_history.html
 Fri May  2 14:31:11 2008
@@ -0,0 +1,84 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+
+<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
+<head>
+       <title></title>
+       <meta http-equiv="Content-Type" content="text/html; 
charset=utf-8"></meta>
+       <script type="text/javascript">
+       // <!--
+       var noInit = false;
+       var domain = "";
+       // document.domain = "localhost";
+       
+       function defineParams(sparams){
+               if(sparams){
+                       var ss = (sparams.indexOf("&amp;") >= 0) ? "&amp;" : 
"&";
+                       sparams = sparams.split(ss);
+                       for(var x=0; x<sparams.length; x++){
+                               var tp = sparams[x].split("=");
+                               if(typeof window[tp[0]] != "undefined"){
+                                       window[tp[0]] = 
((tp[1]=="true")||(tp[1]=="false")) ? eval(tp[1]) : tp[1];
+                               }
+                       }
+               }
+       }
+       
+       function init(){
+               // parse the query string if there is one to try to get params 
that
+               // we can act on. Also allow params to be in a fragment 
identifier.
+               var query = null;
+               var frag = null;
+               var url = document.location.href;
+               var hashIndex = url.indexOf("#");
+               
+               //Extract fragment identifier
+               if(hashIndex != -1){
+                       frag = url.substring(hashIndex + 1, url.length);
+                       url = url.substring(0, hashIndex);
+               }
+
+               //Extract querystring
+               var parts = url.split("?");
+               if(parts.length == 2){
+                       query = parts[1];
+               }
+
+               defineParams(query);
+               defineParams(frag);
+
+               if(noInit){ return; }
+               if(domain.length > 0){
+                       document.domain = domain;
+               }
+               var hasParentDojo = false;
+               try{
+                       hasParentDojo = window.parent != window && 
window.parent["dojo"];
+               }catch(e){
+                       alert("Initializing iframe_history.html failed. If you 
are using a cross-domain Dojo build,"
+                               + " please save iframe_history.html to your 
domain and set djConfig.dojoIframeHistoryUrl"
+                               + " to the path on your domain to 
iframe_history.html");
+                       throw e;
+               }
+
+               if(hasParentDojo){
+                       //Set the page title so IE history shows up with a 
somewhat correct name.
+                       document.title = window.parent.document.title;
+                       
+                       //Notify parent that we are loaded.
+                       var pdj = window.parent.dojo;
+                       if(pdj["undo"] && pdj["undo"]["browser"]){
+                               pdj.undo.browser.iframeLoaded(null, 
window.location);
+                       }
+               }
+
+       }
+       // -->
+       </script>
+</head>
+<body onload="try{ init(); }catch(e){ alert(e); }">
+       <h4>The Dojo Toolkit -- iframe_history.html</h4>
+
+       <p>This file is used in Dojo's back/fwd button management.</p>
+</body>
+</html>

Added: 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/main.css
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/main.css?rev=652919&view=auto
==============================================================================
--- 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/main.css
 (added)
+++ 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/main.css
 Fri May  2 14:31:11 2008
@@ -0,0 +1,39 @@
+.right {
+       clear: both;
+       float: right;
+}
+
+.left {
+       clear: both;
+       float: left;
+}
+
+.bundleDetails td {
+       border: 1px solid #C8C8C8;
+}
+
+.rowTitle {
+       width: 141px;
+       font-weight: bold;
+}
+
+
+table.properties {
+       border-style: solid;
+       border-width: 1px;
+       border-color: #3366CC;
+}
+
+table.properties td {
+    border-style: solid;
+    border-width: 1px;
+    border-color: #3366CC;
+}
+
+table.properties td.name {
+       background-color: #C3D9FF;
+}
+
+table.properties th {
+    background-color: #C3D9FF;
+}
\ No newline at end of file

Added: 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/shell.css
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/shell.css?rev=652919&view=auto
==============================================================================
--- 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/shell.css
 (added)
+++ 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/shell.css
 Fri May  2 14:31:11 2008
@@ -0,0 +1,40 @@
+/*
+ * $Id: webconsole.css 590812 2007-10-31 20:32:54Z apetrelli $
+ *
+ * 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.
+ */
+
+.wc-results {
+    overflow: auto; 
+    margin: 0px; 
+    padding: 5px; 
+    font-family: courier; 
+    color: white; 
+    background-color: black; 
+    height: 400px;
+}
+.wc-results pre {
+    display: inline;
+}
+.wc-command {
+    margin: 0px; 
+    font-family: courier; 
+    color: white; 
+    background-color: black; 
+    width: 100%;
+}

Added: 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/shell.js
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/shell.js?rev=652919&view=auto
==============================================================================
--- 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/shell.js
 (added)
+++ 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/static/shell.js
 Fri May  2 14:31:11 2008
@@ -0,0 +1,81 @@
+/*
+ * $Id: webconsole.js 590812 2007-10-31 20:32:54Z apetrelli $
+ *
+ * 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.
+ */
+
+  function printResult(result_string)
+  {
+      var result_div = document.getElementById('wc-result');
+      var result_array = result_string.split('\n');
+
+      var new_command = document.getElementById('wc-command').value;
+      result_div.appendChild(document.createTextNode(new_command));
+      result_div.appendChild(document.createElement('br'));
+
+      for (var line_index in result_array) {
+          var result_wrap = document.createElement('pre')
+          line = document.createTextNode(result_array[line_index]);
+          result_wrap.appendChild(line);
+          result_div.appendChild(result_wrap);
+          result_div.appendChild(document.createElement('br'));
+
+      }
+      result_div.appendChild(document.createTextNode(':-> '));
+
+      result_div.scrollTop = result_div.scrollHeight;
+      document.getElementById('wc-command').value = '';
+  }
+
+  function keyEvent(event, url)
+  {
+      switch(event.keyCode){
+          case 13:
+              var the_shell_command = 
document.getElementById('wc-command').value;
+              if (the_shell_command) {
+                  commands_history[commands_history.length] = 
the_shell_command;
+                  history_pointer = commands_history.length;
+                  dojo.io.bind({
+                        url: url,
+                        formNode: dojo.byId("wc-form"),
+                        load: function(type, data, evt){
+                            printResult(data);
+                        },
+                        mimetype: "text/plain"
+                    });
+              }
+              break;
+          case 38: // this is the arrow up
+              if (history_pointer > 0) {
+                  history_pointer--;
+                  document.getElementById('wc-command').value = 
commands_history[history_pointer];
+              }
+              break;
+          case 40: // this is the arrow down
+              if (history_pointer < commands_history.length - 1 ) {
+                  history_pointer++;
+                  document.getElementById('wc-command').value = 
commands_history[history_pointer];
+              }
+              break;
+          default:
+              break;
+      }
+  }
+
+  var commands_history = new Array();
+  var history_pointer;

Modified: 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/struts.xml
URL: 
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/struts.xml?rev=652919&r1=652918&r2=652919&view=diff
==============================================================================
--- 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/struts.xml
 (original)
+++ 
struts/sandbox/trunk/struts2-osgi-plugin/admin-bundle/src/main/resources/struts.xml
 Fri May  2 14:31:11 2008
@@ -3,14 +3,24 @@
     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
     "http://struts.apache.org/dtds/struts-2.0.dtd";>
 
-<struts>
+<struts>
     <package name="bundle-admin" namespace="/osgi/admin" 
extends="struts-default">
-        <action name="bundle_*!*" 
class="org.apache.struts2.osgi.admin.BundlesAction" method="{2}">
+        <action name="bundle_*!*" 
class="org.apache.struts2.osgi.admin.actions.BundlesAction" method="{2}">
             <param name="id">{1}</param>
             <result type="velocity">viewBundle.vm</result>
-        </action>
-        <action name="bundles" 
class="org.apache.struts2.osgi.admin.BundlesAction" method="index">
+        </action>
+
+        <action name="bundles" 
class="org.apache.struts2.osgi.admin.actions.BundlesAction" method="index">
             <result type="velocity">viewBundles.vm</result>
-        </action>
+        </action>
+
+
+        <action name="execCommand" 
class="org.apache.struts2.osgi.admin.actions.ShellAction">
+            <result type="freemarker">commandResult.ftl</result>
+        </action>
+
+        <action name="shell">
+            <result type="freemarker">shell.ftl</result>
+        </action>
     </package>
 </struts>


Reply via email to