Author: jsdelfino
Date: Thu Jul 31 01:04:20 2008
New Revision: 681295

URL: http://svn.apache.org/viewvc?rev=681295&view=rev
Log:
Improved the Domain Manager widgets to use HTML divs for presentation and 
iframes for script isolation. This provides better control and performance of 
the layout while preserving isolation between the scripts of the individual 
widgets.

Modified:
    tuscany/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/cloud.html
    
tuscany/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/composite.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/files-gadget.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/files.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/home-gadget.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/home.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/manager.css
    
tuscany/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/utils.js
    
tuscany/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/workspace.html

Modified: 
tuscany/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- 
tuscany/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html 
(original)
+++ 
tuscany/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html 
Thu Jul 31 01:04:20 2008
@@ -23,7 +23,44 @@
 <script type="text/javascript" src="../cloud-gadget/cloud-gadget.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
-<script language="JavaScript">
+<link rel="stylesheet" type="text/css" href="manager.css">
+</head>
+
+<body>
+  <div id="cloudComposite">
+  
+  <form name="cloudCompositeForm">
+    <div id="composites" ></div>
+    <br>
+    <input type="button" onClick="startNode()"  value="Start" />
+    <input type="button" onClick="stopNode()"  value="Stop" />
+    &nbsp;&nbsp;
+    <input type="button" onClick="deleteNode()"  value="Delete" />
+  </form>
+
+  <br><br>
+  
+  <form name="newNodeForm">
+    <table width="100%">
+    <tr><th>Add a Node</th></tr>
+    <tr><td>Add a node to the cloud. The node will run the SCA components 
declared in the specified composite.</td></tr>
+    </table>
+    <br>
+    <table>
+    <tr><td>Node name:</td><td><input type="text" name="nodeName" 
size="50"/></td><td>e.g. YourNode</td></tr>
+    <tr><td>Node URI:</td><td><input type="text" name="nodeURI" 
size="50"/></td></td><td>e.g. http://yourhost:8080</td></tr>
+    <tr><td>Composite namespace:</td><td><input type="text" 
name="compositeNamespace" size="50"/></td></td><td>e.g. 
http://your/namespace</td></tr>
+    <tr><td>Composite name:</td><td><input type="text" name="compositeName" 
size="50"/></td></td><td>e.g. yourcomposite</td></tr>
+    <tr><td>Contribution URI:</td><td><input type="text" 
name="contributionURI" size="50"/></td></td><td>e.g. yourcontrib, 
http://yourcontrib</td></tr>
+    </table>
+    <input type="button" onClick="addNode()" value="Add" />
+  </form>
+  
+  </div>
+</body>
+
+<script type="text/javascript">
+       var gadget = gadget(window, document);
 
        //@Reference
        var cloudComposite = new Reference("cloudComposite");
@@ -112,7 +149,7 @@
                                composites += '</tr>';
                        }
                        composites += '</table>';
-                       document.getElementById("composites").innerHTML = 
composites;
+                       gadget.getElementById("composites").innerHTML = 
composites;
 
                        processCollection.get("", getProcessesResponse);
                }
@@ -129,7 +166,7 @@
                        }
 
                        for (var i = 0; i < nodeNames.length; i++) {
-                               var element = document.getElementById('status_' 
+ nodeNames[i]);
+                               var element = gadget.getElementById('status_' + 
nodeNames[i]);
                                var nodeName = nodeNames[i];
                                if (nodeStatus[nodeName] == null) {
                                        element.innerHTML = 
'<span>stopped</span>';
@@ -141,7 +178,7 @@
        }
 
        function deleteNode() {
-               var composites  = array(document.cloudCompositeForm.composites);
+               var composites  = array(gadget.cloudCompositeForm.composites);
                for (var i = 0; i < composites.length; i++) {
                        if (composites[i].checked) {
                            var id = composites[i].value;
@@ -155,11 +192,11 @@
        }       
 
        function addNode() {
-               var nodeName = document.newNodeForm.nodeName.value;
-               var nodeURI = document.newNodeForm.nodeURI.value;               
        
-               var compositeNamespace = 
document.newNodeForm.compositeNamespace.value;
-               var compositeName = document.newNodeForm.compositeName.value;
-               var contributionURI = 
document.newNodeForm.contributionURI.value;
+               var nodeName = gadget.newNodeForm.nodeName.value;
+               var nodeURI = gadget.newNodeForm.nodeURI.value;                 
+               var compositeNamespace = 
gadget.newNodeForm.compositeNamespace.value;
+               var compositeName = gadget.newNodeForm.compositeName.value;
+               var contributionURI = gadget.newNodeForm.contributionURI.value;
                var id  = 'composite:' +
                        'http://tuscany.apache.org/cloud' + ';' +
                        'http://tuscany.apache.org/cloud' + ';' +
@@ -190,16 +227,16 @@
        }
 
        function addNodeResponse() {
-               document.newNodeForm.nodeName.value = "";
-               document.newNodeForm.nodeURI.value = "";
-               document.newNodeForm.compositeNamespace.value = "";
-               document.newNodeForm.compositeName.value = "";
-               document.newNodeForm.contributionURI.value = "";
+               gadget.newNodeForm.nodeName.value = "";
+               gadget.newNodeForm.nodeURI.value = "";
+               gadget.newNodeForm.compositeNamespace.value = "";
+               gadget.newNodeForm.compositeName.value = "";
+               gadget.newNodeForm.contributionURI.value = "";
            getNodes();
        }       
 
        function startNode() {
-               var composites  = array(document.cloudCompositeForm.composites);
+               var composites  = array(gadget.cloudCompositeForm.composites);
                for (var i = 0; i < composites.length; i++) {
                        if (composites[i].checked) {
                            var id = nodeNames[i];
@@ -215,7 +252,7 @@
        function startNodeResponse() {
                processCollection.get("", getProcessesResponse);
                
-               var composites  = array(document.cloudCompositeForm.composites);
+               var composites  = array(gadget.cloudCompositeForm.composites);
                for (var i = 0; i < composites.length; i++) {
                        if (composites[i].checked) {
                          composites[i].checked = false;
@@ -224,7 +261,7 @@
        }       
 
        function stopNode() {
-               var composites  = array(document.cloudCompositeForm.composites);
+               var composites  = array(gadget.cloudCompositeForm.composites);
                for (var i = 0; i < composites.length; i++) {
                        if (composites[i].checked) {
                            var id = nodeNames[i];
@@ -236,7 +273,7 @@
        function stopNodeResponse() {
                processCollection.get("", getProcessesResponse);
                
-               var composites  = array(document.cloudCompositeForm.composites);
+               var composites  = array(gadget.cloudCompositeForm.composites);
                for (var i = 0; i < composites.length; i++) {
                        if (composites[i].checked) {
                          composites[i].checked = false;
@@ -271,7 +308,7 @@
        }       
 
        function suggestCompositeNames() {
-               var inputns = document.newNodeForm.compositeNamespace.value;
+               var inputns = gadget.newNodeForm.compositeNamespace.value;
                var names = new Array();
                for (var uri in deployedComposites) {
                        var qname = compositeName(uri);
@@ -286,8 +323,8 @@
        }       
 
        function suggestContributionURIs() {
-               var inputns = document.newNodeForm.compositeNamespace.value;
-               var inputname = document.newNodeForm.compositeName.value;
+               var inputns = gadget.newNodeForm.compositeNamespace.value;
+               var inputname = gadget.newNodeForm.compositeName.value;
                var uris = new Array();
                for (var uri in deployedComposites) {
                        var qname = compositeName(uri);
@@ -302,53 +339,11 @@
                return array(uris);
        }
 
-       function init() {
-               getNodes();
-               getComposites();
-               suggest(document.newNodeForm.compositeNamespace, 
suggestCompositeNamespaces);
-               suggest(document.newNodeForm.compositeName, 
suggestCompositeNames);
-               suggest(document.newNodeForm.contributionURI, 
suggestContributionURIs);
-       }
-
+       getNodes();
+       getComposites();
+       suggest(gadget.newNodeForm.compositeNamespace, 
suggestCompositeNamespaces);
+       suggest(gadget.newNodeForm.compositeName, suggestCompositeNames);
+       suggest(gadget.newNodeForm.contributionURI, suggestContributionURIs);
+       
 </script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body onload="init()">
-  <div id="cloudComposite">
-  
-  Here is the list of SCA nodes configured in your SCA domain cloud.
-  <br><br>
-
-  <form name="cloudCompositeForm">
-    <div id="composites" ></div>
-    <br>
-    <input type="button" onClick="startNode()"  value="Start" />
-    <input type="button" onClick="stopNode()"  value="Stop" />
-    &nbsp;&nbsp;
-    <input type="button" onClick="deleteNode()"  value="Delete" />
-  </form>
-
-  <br><br>
-  
-  <form name="newNodeForm">
-    <table width="100%">
-    <tr><th>Add a Node</th></tr>
-    <tr><td>Add a node to the cloud. The node will run the SCA components 
declared in the specified composite.</td></tr>
-    </table>
-    <br>
-    <table>
-    <tr><td>Node name:</td><td><input type="text" name="nodeName" 
size="50"/></td><td>e.g. YourNode</td></tr>
-    <tr><td>Node URI:</td><td><input type="text" name="nodeURI" 
size="50"/></td></td><td>e.g. http://yourhost:8080</td></tr>
-    <tr><td>Composite namespace:</td><td><input type="text" 
name="compositeNamespace" size="50"/></td></td><td>e.g. 
http://your/namespace</td></tr>
-    <tr><td>Composite name:</td><td><input type="text" name="compositeName" 
size="50"/></td></td><td>e.g. yourcomposite</td></tr>
-    <tr><td>Contribution URI:</td><td><input type="text" 
name="contributionURI" size="50"/></td></td><td>e.g. yourcontrib, 
http://yourcontrib</td></tr>
-    </table>
-    <input type="button" onClick="addNode()" value="Add" />
-  </form>
-  
-  </div>
-</body>
-
 </html>

Modified: tuscany/java/sca/modules/domain-manager/src/main/resources/cloud.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/cloud.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/cloud.html 
(original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/cloud.html Thu 
Jul 31 01:04:20 2008
@@ -20,19 +20,37 @@
 <head>
 <title>SCA Domain - Cloud</title>
 
+<script type="text/javascript" src="utils.js"></script>
+
 <link rel="stylesheet" type="text/css" href="manager.css">
 </head>
 
 <body>
-  <iframe id="toolbarGadget" src="toolbar-gadget.html" style="top: 0px; left: 
0px; width: 100%;"></iframe>
-  <br><br>
+  <div id="toolbarGadgetDiv"></div>
+  <br>
   
   <span class=hd1>
   SCA Domain<br><br>
   Cloud</b>&nbsp;<a href="/cloud/"><img src="icons/feed-icon.png" 
border="0"></a>
   </span>
   <br>
+  Here is the list of SCA nodes configured in your SCA domain cloud.
+  <br><br>
+  
+  <div id="cloudGadgetDiv"></div>
   
-  <iframe id="cloudGadget" src="cloud-gadget.html" style="left: 0px; width: 
100%; height: 100%;"></iframe>
+  <iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
+  <iframe id="cloudGadget" src="cloud-gadget.html"></iframe>
 </body>
+
+<script type="text/javascript">
+       function ongadget(win, doc) {
+               if (doc == content(toolbarGadget)) {
+                       toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
+               } else if (doc == content(cloudGadget)) {
+                       cloudGadgetDiv.innerHTML = doc.body.innerHTML;
+               }
+               return document;
+       }
+</script>
 </html>

Modified: 
tuscany/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- 
tuscany/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html
 (original)
+++ 
tuscany/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html
 Thu Jul 31 01:04:20 2008
@@ -23,7 +23,39 @@
 <script type="text/javascript" 
src="../composite-gadget/composite-gadget.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
-<script language="JavaScript">
+<link rel="stylesheet" type="text/css" href="manager.css">
+</head>
+
+<body>
+  <div id="domainComposite">
+  
+  <form name="domainCompositeForm">
+    <div id="composites" ></div>
+    <br>
+    <input type="button" onClick="deleteComposite()"  value="Delete" />
+  </form>
+  
+  <br><br>
+  
+  <form name="newCompositeForm">
+    <table width="100%">
+    <tr><th>Add Composite</th></tr>
+    <tr><td>Add an SCA composite describing your SCA service 
components.</td></tr>
+    </table>
+    <br>
+       <table>    
+    <tr><td>Composite namespace:</td><td><input type="text" 
name="compositeNamespace" size="50"/></td><td>e.g. 
http://your/namespace</td></tr> 
+    <tr><td>Composite name:</td><td><input type="text" name="compositeName" 
size="50"/></td><td>e.g. yourcomposite</td></tr>
+    <tr><td>Contribution URI:</td><td><input type="text" 
name="contributionURI" size="50"/></td><td>e.g. yourcontrib, 
http://yourcontrib</td></tr>
+    </table>
+    <input type="button" onClick="addComposite()" value="Add" />
+  </form>
+  
+  </div>
+</body>
+
+<script type="text/javascript">
+       var gadget = gadget(window, document);
 
        //@Reference
        var domainComposite = new Reference("domainComposite");
@@ -88,12 +120,12 @@
                                composites += '</tr>';
                        }
                        composites += '</table>';
-                       document.getElementById("composites").innerHTML = 
composites;
+                       gadget.getElementById("composites").innerHTML = 
composites;
                }
        }
 
        function deleteComposite() {
-               var composites  = 
array(document.domainCompositeForm.composites);
+               var composites  = array(gadget.domainCompositeForm.composites);
                for (var i = 0; i < composites.length; i++) {
                        if (composites[i].checked) {
                            var id = composites[i].value;
@@ -108,9 +140,9 @@
 
        function addComposite() {
                var id  = 'composite:' +
-                       document.newCompositeForm.contributionURI.value + ';' +
-                       document.newCompositeForm.compositeNamespace.value + 
';' +
-                       document.newCompositeForm.compositeName.value;
+                       gadget.newCompositeForm.contributionURI.value + ';' +
+                       gadget.newCompositeForm.compositeNamespace.value + ';' +
+                       gadget.newCompositeForm.compositeName.value;
                var entry = '<entry xmlns="http://www.w3.org/2005/Atom";>' +
                                '<title>' + id +'</title>' +
                '<id>' + id + '</id>' +
@@ -119,9 +151,9 @@
        }
 
        function addCompositeResponse() {
-               document.newCompositeForm.compositeNamespace.value = "";
-               document.newCompositeForm.compositeName.value = "";
-               document.newCompositeForm.contributionURI.value = "";
+               gadget.newCompositeForm.compositeNamespace.value = "";
+               gadget.newCompositeForm.compositeName.value = "";
+               gadget.newCompositeForm.contributionURI.value = "";
            getComposites();
        }
        
@@ -172,7 +204,7 @@
        }       
 
        function suggestCompositeNames() {
-               var inputns = 
document.newCompositeForm.compositeNamespace.value;
+               var inputns = gadget.newCompositeForm.compositeNamespace.value;
                var names = new Array();
                for (var uri in contributedComposites) {
                        var qname = compositeName(uri);
@@ -187,8 +219,8 @@
        }       
 
        function suggestContributionURIs() {
-               var inputns = 
document.newCompositeForm.compositeNamespace.value;
-               var inputname = document.newCompositeForm.compositeName.value;
+               var inputns = gadget.newCompositeForm.compositeNamespace.value;
+               var inputname = gadget.newCompositeForm.compositeName.value;
                var uris = new Array();
                for (var uri in contributedComposites) {
                        var qname = compositeName(uri);
@@ -203,47 +235,11 @@
                return array(uris);
        }
 
-       function init() {
-               getComposites();
-               getContributions();
-               suggest(document.newCompositeForm.compositeNamespace, 
suggestCompositeNamespaces);
-               suggest(document.newCompositeForm.compositeName, 
suggestCompositeNames);
-               suggest(document.newCompositeForm.contributionURI, 
suggestContributionURIs);
-       }
+       getComposites();
+       getContributions();
+       suggest(gadget.newCompositeForm.compositeNamespace, 
suggestCompositeNamespaces);
+       suggest(gadget.newCompositeForm.compositeName, suggestCompositeNames);
+       suggest(gadget.newCompositeForm.contributionURI, 
suggestContributionURIs);
                
 </script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body onload="init()">
-  <div id="domainComposite">
-  
-  Here is the list of SCA composites currently included as top-level 
composites in your SCA domain.
-  <br><br>
-  
-  <form name="domainCompositeForm">
-    <div id="composites" ></div>
-    <br>
-    <input type="button" onClick="deleteComposite()"  value="Delete" />
-  </form>
-  
-  <br><br>
-  
-  <form name="newCompositeForm">
-    <table width="100%">
-    <tr><th>Add Composite</th></tr>
-    <tr><td>Add an SCA composite describing your SCA service 
components.</td></tr>
-    </table>
-    <br>
-       <table>    
-    <tr><td>Composite namespace:</td><td><input type="text" 
name="compositeNamespace" size="50"/></td><td>e.g. 
http://your/namespace</td></tr> 
-    <tr><td>Composite name:</td><td><input type="text" name="compositeName" 
size="50"/></td><td>e.g. yourcomposite</td></tr>
-    <tr><td>Contribution URI:</td><td><input type="text" 
name="contributionURI" size="50"/></td><td>e.g. yourcontrib, 
http://yourcontrib</td></tr>
-    </table>
-    <input type="button" onClick="addComposite()" value="Add" />
-  </form>
-  
-  </div>
-</body>
 </html>

Modified: 
tuscany/java/sca/modules/domain-manager/src/main/resources/composite.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/composite.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/composite.html 
(original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/composite.html 
Thu Jul 31 01:04:20 2008
@@ -20,19 +20,37 @@
 <head>
 <title>SCA Domain - Domain Composite</title>
 
+<script type="text/javascript" src="utils.js"></script>
+
 <link rel="stylesheet" type="text/css" href="manager.css">
 </head>
 
 <body>
-  <iframe id="toolbarGadget" src="toolbar-gadget.html" style="top: 0px; left: 
0px; width: 100%;"></iframe>
-  <br><br>
+  <div id="toolbarGadgetDiv"></div>
+  <br>
   
   <span class=hd1>
   SCA Domain<br><br>
   Domain Composite&nbsp;<a href="/composite/"><img src="icons/feed-icon.png" 
border="0"></a>
   </span>
   <br>
+  Here is the list of SCA composites currently included as top-level 
composites in your SCA domain.
+  <br><br>
+  
+  <div id="compositeGadgetDiv"></div>
   
-  <iframe id="compositeGadget" src="composite-gadget.html" style="left: 0px; 
width: 100%; height: 100%;"></iframe>
+  <iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
+  <iframe id="compositeGadget" src="composite-gadget.html"></iframe>
 </body>
+
+<script type="text/javascript">
+       function ongadget(win, doc) {
+               if (doc == content(toolbarGadget)) {
+                       toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
+               } else if (doc == content(compositeGadget)) {
+                       compositeGadgetDiv.innerHTML = doc.body.innerHTML;
+               }
+               return document;
+       }
+</script>
 </html>

Modified: 
tuscany/java/sca/modules/domain-manager/src/main/resources/files-gadget.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/files-gadget.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- 
tuscany/java/sca/modules/domain-manager/src/main/resources/files-gadget.html 
(original)
+++ 
tuscany/java/sca/modules/domain-manager/src/main/resources/files-gadget.html 
Thu Jul 31 01:04:20 2008
@@ -23,7 +23,38 @@
 <script type="text/javascript" src="../files-gadget/files-gadget.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
-<script language="JavaScript">
+<link rel="stylesheet" type="text/css" href="manager.css">
+</head>
+
+<body>
+  <div id="fileServer">
+  
+  <form name="filesForm">
+    <div id="files" ></div>
+    <br/>
+    <input type="button" onClick="deleteFile()"  value="Delete" />
+  </form>
+
+  <br><br>
+  
+  <form method="post" name="uploadFileForm" enctype='multipart/form-data' 
action='/files'>
+    <table width="100%">
+    <tr><th>Upload File</th></tr>
+    <tr><td>Upload a file to the server.</td></tr>
+    </table>
+    <br>
+    <table border="0">
+    <tr><td>File:</td><td><input type="file" name="file" size="50"/></td></tr>
+    </table>
+    <br/>
+    <input type="button" onClick="uploadFile()" value="Upload" />
+  </form>    
+      
+  </div>
+</body>
+
+<script type="text/javascript">
+       var gadget = gadget(window, document);
 
        //@Reference
        var files = new Reference("files");
@@ -43,12 +74,12 @@
                                                                                
        '<a href=\"' + location + '\">' + id + '</a></td></tr>';
                        }
                        list += "</table>";
-                       document.getElementById("files").innerHTML = list;
+                       gadget.getElementById("files").innerHTML = list;
                }
        }                               
 
        function deleteFile() {
-               var list = array(document.filesForm.files);
+               var list = array(gadget.filesForm.files);
                for (var i=0; i < list.length; i++) {
                        if (list[i].checked) {
                            var id = list[i].value;
@@ -62,45 +93,10 @@
        }
 
        function uploadFile() {
-               document.uploadFileForm.submit();
+               gadget.uploadFileForm.submit();
        }
 
-       function init() {
-               getFiles();
-       }
+       getFiles();
 
 </script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body onload="init()">
-  <div id="fileServer">
-  
-  This is a simple ATOM-based file server useful to share files if you don't 
have an FTP, SVN or Maven repository.
-  <br><br>
-  
-  <form name="filesForm">
-    <div id="files" ></div>
-    <br/>
-    <input type="button" onClick="deleteFile()"  value="Delete" />
-  </form>
-
-  <br><br>
-  
-  <form method="post" name="uploadFileForm" enctype='multipart/form-data' 
action='/files'>
-    <table width="100%">
-    <tr><th>Upload File</th></tr>
-    <tr><td>Upload a file to the server.</td></tr>
-    </table>
-    <br>
-    <table border="0">
-    <tr><td>File:</td><td><input type="file" name="file" size="50"/></td></tr>
-    </table>
-    <br/>
-    <input type="button" onClick="uploadFile()" value="Upload" />
-  </form>    
-      
-  </div>
-</body>
 </html>

Modified: tuscany/java/sca/modules/domain-manager/src/main/resources/files.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/files.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/files.html 
(original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/files.html Thu 
Jul 31 01:04:20 2008
@@ -20,19 +20,37 @@
 <head>
 <title>SCA Domain - Contribution File Server</title>
 
+<script type="text/javascript" src="utils.js"></script>
+
 <link rel="stylesheet" type="text/css" href="manager.css">
 </head>
 
 <body>
-  <iframe id="toolbarGadget" src="toolbar-gadget.html" style="top: 0px; left: 
0px; width: 100%;"></iframe>
-  <br><br>
+  <div id="toolbarGadgetDiv"></div>
+  <br>
 
   <span class=hd1>
   SCA Domain<br><br>
   File Server&nbsp;<a href="/feed/files/"><img src="icons/feed-icon.png" 
border="0"></a>
   </span>
   <br>
+  This is a simple ATOM-based file server useful to share files if you don't 
have an FTP, SVN or Maven repository.
+  <br><br>
+  
+  <div id="filesGadgetDiv"></div>
   
-  <iframe id="filesGadget" src="files-gadget.html" style="left: 0px; width: 
100%; height: 100%;"></iframe>
+  <iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
+  <iframe id="filesGadget" src="files-gadget.html"></iframe>
 </body>
+
+<script type="text/javascript">
+       function ongadget(win, doc) {
+               if (doc == content(toolbarGadget)) {
+                       toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
+               } else if (doc == content(filesGadget)) {
+                       filesGadgetDiv.innerHTML = doc.body.innerHTML;
+               }
+               return document;
+       }
+</script>
 </html>

Modified: 
tuscany/java/sca/modules/domain-manager/src/main/resources/home-gadget.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/home-gadget.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/home-gadget.html 
(original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/home-gadget.html 
Thu Jul 31 01:04:20 2008
@@ -23,17 +23,10 @@
 <script type="text/javascript" src="../home-gadget/home-gadget.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
-<script language="JavaScript">
-
-       function init() {
-       }
-
-</script>
-
 <link rel="stylesheet" type="text/css" href="manager.css">
 </head>
 
-<body onload="init()">
+<body>
   <div id="home">
   
   <form>
@@ -42,10 +35,11 @@
   <tr><td></td><td align="center"><input type="button" name="search" 
value="Search" /></td></tr>
   </table>
   </form>
-
-  <br><br><br><br><br><br><br>
-  <center>This page is under construction, searching the domain is not 
implemented yet.</center>
   
   </div>
 </body>
+
+<script type="text/javascript">
+       var gadget = gadget(window, document);
+</script>
 </html>

Modified: tuscany/java/sca/modules/domain-manager/src/main/resources/home.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/home.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/home.html 
(original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/home.html Thu 
Jul 31 01:04:20 2008
@@ -20,20 +20,38 @@
 <head>
 <title>SCA Domain - Home</title>
 
-<script type="text/javascript" src="../home/home.js"></script>
+<script type="text/javascript" src="utils.js"></script>
 
 <link rel="stylesheet" type="text/css" href="manager.css">
 </head>
 
 <body>
-  <iframe id="toolbarGadget" src="toolbar-gadget.html" style="top: 0px; left: 
0px; width: 100%;"></iframe>
-  <br><br>
+  <div id="toolbarGadgetDiv"></div>
+  <br>
   
   <span class=hd1>
   SCA Domain
   </span>
   <br><br><br><br><br><br>
   
-  <iframe id="homeGadget" src="home-gadget.html" style="left: 0px; width: 
100%; height: 100%;"></iframe>
+  <div id="homeGadgetDiv"></div>
+  
+  <br><br><br><br><br><br><br>
+  <center>This page is under construction, searching the domain is not 
implemented yet.</center>
+  
+  <iframe id="toolbarGadget" src="toolbar-gadget.html" style="visibility: 
hidden;"></iframe>
+  <iframe id="homeGadget" src="home-gadget.html" style="visibility: 
hidden;"></iframe>
 </body>
+
+<script type="text/javascript">
+       function ongadget(win, doc) {
+               if (doc == content(toolbarGadget)) {
+                       toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
+               } else if (doc == content(homeGadget)) {
+                       homeGadgetDiv.innerHTML = doc.body.innerHTML;
+               }
+               return document;
+       }
+</script>
+
 </html>

Modified: tuscany/java/sca/modules/domain-manager/src/main/resources/manager.css
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/manager.css?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/manager.css 
(original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/manager.css Thu 
Jul 31 01:04:20 2008
@@ -18,7 +18,7 @@
  */
 
 body {
-       white-space: nowrap; overflow: hidden;
+       white-space: nowrap; margin: 2px;
 }
 
 table {
@@ -37,7 +37,7 @@
 }
 
 iframe {
-       border: 0px; margin: 0px; padding: 0px; position: absolute; overflow: 
hidden;
+       visibility: hidden;
 }
 
 input {

Modified: 
tuscany/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- 
tuscany/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html 
(original)
+++ 
tuscany/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html 
Thu Jul 31 01:04:20 2008
@@ -22,26 +22,25 @@
 
 <script type="text/javascript" src="utils.js"></script>
 
-<script language="JavaScript">
-
-       function init() {
-               var tools = new Array();
-               tools[0] = new Tool("Contributions", "../workspace");
-               tools[1] = new Tool("Composites", "../composite");
-               tools[2] = new Tool("Cloud", "../cloud");
-               tools[3] = new Tool("Files", "../files");
-               
-               var home = new Tool("Home", "../home");
-                       
-               document.getElementById('toolbar').innerHTML = toolbar(home, 
tools);
-       }
-
-</script>
-
 <link rel="stylesheet" type="text/css" href="manager.css">
 </head>
 
-<body onload="init()">
+<body>
   <div id="toolbar"></div>
 </body>
+
+<script type="text/javascript">
+       var gadget = gadget(window, document);
+
+       var tools = new Array();
+       tools[0] = new Tool("Contributions", "../workspace");
+       tools[1] = new Tool("Composites", "../composite");
+       tools[2] = new Tool("Cloud", "../cloud");
+       tools[3] = new Tool("Files", "../files");
+       
+       var home = new Tool("Home", "../home");
+               
+       gadget.getElementById('toolbar').innerHTML = toolbar(home, tools);
+
+</script>
 </html>

Modified: tuscany/java/sca/modules/domain-manager/src/main/resources/utils.js
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/utils.js?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/utils.js 
(original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/utils.js Thu Jul 
31 01:04:20 2008
@@ -184,3 +184,33 @@
                return a;
        }
 }
+
+/**
+ * Utility function thats dumps a Javascript object to the console
+ */
+function dump(o) {
+       for (f in o) {
+               try {
+                       console.log(f + '=' + o[f]);
+               } catch (e) {}
+       }
+}
+
+function content(win) {
+       if (win.document != 'undefined' && win.document != null) {
+               return win.document;
+       } else if (win.contentDocument != 'undefined' && win.contentDocument != 
null) {
+               return win.contentDocument;
+       } else {
+               return null;
+       }
+}
+
+function gadget(win, doc) {
+       if (win.parent.ongadget != null && win.parent.ongadget != 'undefined') {
+               return win.parent.ongadget(win, doc);
+       } else {
+               return doc;
+       }
+}
+ 
\ No newline at end of file

Modified: 
tuscany/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- 
tuscany/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html
 (original)
+++ 
tuscany/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html
 Thu Jul 31 01:04:20 2008
@@ -23,11 +23,42 @@
 <script type="text/javascript" 
src="../workspace-gadget/workspace-gadget.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
-<script language="JavaScript">
+<link rel="stylesheet" type="text/css" href="manager.css">
+</head>
+
+<body>
+  <div id="workspace">
+  
+  <form name="workspaceForm">
+    <div id="contributions" ></div>
+    <br>
+    <input type="button" onClick="deleteContribution()"  value="Delete" />
+  </form>
+
+  <br><br>
+  
+  <form name="newContributionForm">
+    <table width="100%">
+    <tr><th>Add Contribution</th></tr>
+    <tr><td>Add an SCA contribution containing your application artifacts to 
the SCA domain.</td></tr>
+    </table>
+    <br>
+    <table>
+    <tr><td>Contribution URI:</td><td><input type="text" name="contributionID" 
size="50"/></td></td><td>e.g. yourcontrib, http://yourcontrib</td></tr> 
+    <tr><td>Location:</td><td><input type="text" name="contributionLocation" 
size="50"/></td></td><td>e.g. http://host/yourjar.jar, file:/yourdir, 
file:/yourjar.jar</td></tr>
+    </table>
+    <input type="button" onClick="addContribution()" value="Add" />
+  </form>
+  
+  </div>
+</body>
 
+<script type="text/javascript">
+       var gadget = gadget(window, document);
+       
        //@Reference
        var workspace = new Reference("workspace");
-       
+
        function getContributions() {
                workspace.get("", getContributionsResponse);
        }
@@ -49,7 +80,7 @@
                                contributions += '<tr>';
                                contributions += '<td><input 
name="contributions" type="checkbox" value="' + id + '">' +
                                                                                
        '<a href=\"' + location + '\">' + id + '</a></td>';
-
+       
                                var dependencies = '';
                                var bs = content.indexOf('<span 
id="dependencies">');
                                if (bs != -1) {
@@ -79,10 +110,10 @@
                                contributions += '</tr>';
                        }
                        contributions += '</table>';
-                       document.getElementById("contributions").innerHTML = 
contributions;
+                       gadget.getElementById('contributions').innerHTML = 
contributions;
                }
        }                               
-
+       
        var suggestedContributions = new Array();
        
        function getSuggestedContributions() {
@@ -100,9 +131,9 @@
                        }
                }
        }                               
-
+       
        function deleteContribution() {
-               var contributions  = 
array(document.workspaceForm.contributions);
+               var contributions  = array(gadget.workspaceForm.contributions);
                for (var i=0; i < contributions.length; i++) {
                        if (contributions[i].checked) {
                            var id = contributions[i].value;
@@ -110,28 +141,28 @@
                        }
                }
        }
-
+       
        function deleteContributionResponse() {
            getContributions();
        }       
-
+       
        function addContribution() {
-               var id  = document.newContributionForm.contributionID.value;
-               var location  = 
document.newContributionForm.contributionLocation.value;
+               var id  = gadget.newContributionForm.contributionID.value;
+               var location  = 
gadget.newContributionForm.contributionLocation.value;
                var entry = '<entry xmlns="http://www.w3.org/2005/Atom";>' +
                                '<title>Contribution - ' + id +'</title>' +
-               '<id>' + id + '</id>' +
-               '<link href="' + location + '" />' +
-                       '</entry>';
+                       '<id>' + id + '</id>' +
+                       '<link href="' + location + '" />' +
+                       '</entry>';
                workspace.post(entry, addContributionResponse);
        }
-
+       
        function addContributionResponse() {
-               document.newContributionForm.contributionID.value = "";
-               document.newContributionForm.contributionLocation.value = "";
+               gadget.newContributionForm.contributionID.value = "";
+               gadget.newContributionForm.contributionLocation.value = "";
            getContributions();
        }
-
+       
        function suggestContributionIDs() {
                var ids = new Array();
                for (var i=0; i<suggestedContributions.length; i++) {
@@ -141,13 +172,13 @@
                }
                return array(ids);
        }
-
+       
        function suggestContributionLocations() {
                var locations = new Array();
                for (var i=0; i<suggestedContributions.length; i++) {
                        var uri = suggestedContributions[i];
                        var id = uri.substring(0, uri.indexOf(':'));
-                       if (id == 
document.newContributionForm.contributionID.value) {
+                       if (id == 
gadget.newContributionForm.contributionID.value) {
                                var location = uri.substring(uri.indexOf(':') 
+1);
                                locations[location] = location;
                        }
@@ -155,45 +186,10 @@
                return array(locations);
        }
 
-       function init() {
-               getContributions();
-               getSuggestedContributions();
-               suggest(document.newContributionForm.contributionID, 
suggestContributionIDs);
-               suggest(document.newContributionForm.contributionLocation, 
suggestContributionLocations);
-       }
+       getContributions();
+       getSuggestedContributions();
+       suggest(gadget.newContributionForm.contributionID, 
suggestContributionIDs);
+       suggest(gadget.newContributionForm.contributionLocation, 
suggestContributionLocations);
        
 </script>
-
-<link rel="stylesheet" type="text/css" href="manager.css">
-</head>
-
-<body onload="init()">
-  <div id="workspace">
-
-  Here is the list of SCA contributions currently available in your SCA domain.
-  <br><br>
-  
-  <form name="workspaceForm">
-    <div id="contributions" ></div>
-    <br>
-    <input type="button" onClick="deleteContribution()"  value="Delete" />
-  </form>
-
-  <br><br>
-  
-  <form name="newContributionForm">
-    <table width="100%">
-    <tr><th>Add Contribution</th></tr>
-    <tr><td>Add an SCA contribution containing your application artifacts to 
the SCA domain.</td></tr>
-    </table>
-    <br>
-    <table>
-    <tr><td>Contribution URI:</td><td><input type="text" name="contributionID" 
size="50"/></td></td><td>e.g. yourcontrib, http://yourcontrib</td></tr> 
-    <tr><td>Location:</td><td><input type="text" name="contributionLocation" 
size="50"/></td></td><td>e.g. http://host/yourjar.jar, file:/yourdir, 
file:/yourjar.jar</td></tr>
-    </table>
-    <input type="button" onClick="addContribution()" value="Add" />
-  </form>
-  
-  </div>
-</body>
 </html>

Modified: 
tuscany/java/sca/modules/domain-manager/src/main/resources/workspace.html
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/workspace.html?rev=681295&r1=681294&r2=681295&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/workspace.html 
(original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/workspace.html 
Thu Jul 31 01:04:20 2008
@@ -20,18 +20,36 @@
 <head>
 <title>SCA Domain - Contributions</title>
 
+<script type="text/javascript" src="utils.js"></script>
+
 <link rel="stylesheet" type="text/css" href="manager.css">
 </head>
 
 <body>
-  <iframe id="toolbarGadget" src="toolbar-gadget.html" style="top: 0px; left: 
0px; width: 100%;"></iframe>
-  <br><br>
+  <div id="toolbarGadgetDiv"></div>
+  <br>
   
   <span class=hd1>
   SCA Domain<br><br>
   Contributions</b>&nbsp;<a href="/workspace/"><img src="icons/feed-icon.png" 
border="0"></a>  </span>
   <br>
+  Here is the list of SCA contributions currently available in your SCA domain.
+  <br><br>
+  
+  <div id="workspaceGadgetDiv"></div>
   
-  <iframe id="workspaceGadget" src="workspace-gadget.html" style="left: 0px; 
width: 100%; height: 100%;"></iframe>
+  <iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
+  <iframe id="workspaceGadget" src="workspace-gadget.html"></iframe>
 </body>
+
+<script type="text/javascript">
+       function ongadget(win, doc) {
+               if (doc == content(toolbarGadget)) {
+                       toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
+               } else if (doc == content(workspaceGadget)) {
+                       workspaceGadgetDiv.innerHTML = doc.body.innerHTML;
+               }
+               return document;
+       }
+</script>
 </html>


Reply via email to