You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2008/07/30 09:59:47 UTC

svn commit: r680931 - in /tuscany/java/sca/modules: binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/ binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/ domain-manager/src/main/resources/

Author: jsdelfino
Date: Wed Jul 30 00:59:46 2008
New Revision: 680931

URL: http://svn.apache.org/viewvc?rev=680931&view=rev
Log:
Started to refactor the domain manager UI into smaller independently reusable widgets. Tested OK with Firefox 2 and 3 and Safari 3, still debugging a javascript error with IE 7. Changed the HTTP binding to implement OptimizableBinding as was done for the Atom Binding, to allow Widgets to get the correct reference binding URIs from the target services. This is temporary until the domain manager app is migrated from SCADomain to NodeFactory.

Added:
    tuscany/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html
      - copied, changed from r680621, tuscany/java/sca/modules/domain-manager/src/main/resources/cloud.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html
      - copied, changed from r680621, tuscany/java/sca/modules/domain-manager/src/main/resources/composite.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/files-gadget.html
      - copied, changed from r680621, tuscany/java/sca/modules/domain-manager/src/main/resources/files.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/home-gadget.html
      - copied, changed from r680621, tuscany/java/sca/modules/domain-manager/src/main/resources/home.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html
      - copied, changed from r680621, tuscany/java/sca/modules/domain-manager/src/main/resources/home.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html
      - copied, changed from r680621, tuscany/java/sca/modules/domain-manager/src/main/resources/workspace.html
Modified:
    tuscany/java/sca/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java
    tuscany/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
    tuscany/java/sca/modules/domain-manager/src/main/resources/DomainManager.composite
    tuscany/java/sca/modules/domain-manager/src/main/resources/cloud.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/composite.html
    tuscany/java/sca/modules/domain-manager/src/main/resources/files.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/utils.js
    tuscany/java/sca/modules/domain-manager/src/main/resources/workspace.html

Modified: tuscany/java/sca/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java?rev=680931&r1=680930&r2=680931&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java (original)
+++ tuscany/java/sca/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java Wed Jul 30 00:59:46 2008
@@ -100,6 +100,14 @@
         this.intentAttachPointType = intentAttachPointType;
     }
 
+    public void setPolicySets(List<PolicySet> policySets) {
+        this.policySets = policySets; 
+    }
+
+    public void setRequiredIntents(List<Intent> intents) {
+        this.requiredIntents = intents;
+    }
+    
     //FIXME Temporary to get access to the target binding information
     // To be removed when the distributed domain supports wiring of other
     // bindings than the SCA binding
@@ -135,11 +143,4 @@
         this.targetComponentService = service; 
     }
 
-    public void setPolicySets(List<PolicySet> policySets) {
-        this.policySets = policySets; 
-    }
-
-    public void setRequiredIntents(List<Intent> intents) {
-        this.requiredIntents = intents;
-    }
 }

Modified: tuscany/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java?rev=680931&r1=680930&r2=680931&view=diff
==============================================================================
--- tuscany/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java (original)
+++ tuscany/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java Wed Jul 30 00:59:46 2008
@@ -19,6 +19,10 @@
 
 package org.apache.tuscany.sca.binding.http.impl;
 
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.OptimizableBinding;
 import org.apache.tuscany.sca.binding.http.HTTPBinding;
 
 
@@ -27,7 +31,7 @@
  * 
  * @version $Rev$ $Date$
  */
-class HTTPBindingImpl implements HTTPBinding {
+class HTTPBindingImpl implements HTTPBinding, OptimizableBinding {
     
     private String name;
     private String uri;
@@ -61,4 +65,35 @@
         return super.clone();
     }     
 
+    //FIXME Temporary to get access to the target binding information
+    // To be removed when the distributed domain supports wiring of other
+    // bindings than the SCA binding
+    private Binding targetBinding; 
+    private Component targetComponent; 
+    private ComponentService targetComponentService; 
+    
+    public Binding getTargetBinding() {
+        return targetBinding;
+    }
+    
+    public void setTargetBinding(Binding binding) {
+        this.targetBinding = binding;
+    }
+    
+    public Component getTargetComponent() {
+        return targetComponent;
+    }
+    
+    public void setTargetComponent(Component component) {
+        this.targetComponent = component;
+    }
+    
+    public ComponentService getTargetComponentService() {
+        return targetComponentService;
+    }
+    
+    public void setTargetComponentService(ComponentService service) {
+        this.targetComponentService = service; 
+    }
+
 }

Modified: tuscany/java/sca/modules/domain-manager/src/main/resources/DomainManager.composite
URL: http://svn.apache.org/viewvc/tuscany/java/sca/modules/domain-manager/src/main/resources/DomainManager.composite?rev=680931&r1=680930&r2=680931&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/DomainManager.composite (original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/DomainManager.composite Wed Jul 30 00:59:46 2008
@@ -22,38 +22,97 @@
 	targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
     name="DomainManager">
 
-    <component name="HomeUI">
+    <component name="HomePage">
         <t:implementation.widget location="home.html"/>
         <service name="Widget">
         	<t:binding.http uri="http://localhost:9990/ui/home"/>
         </service>
+        <reference name="toolbarGadget" target="ToolbarGadget">
+        	<t:binding.http/>
+        </reference>
+        <reference name="homeGadget" target="HomeGadget">
+        	<t:binding.http/>
+        </reference>
     </component>
     
-    <component name="ContributionUI">
+    <component name="ToolbarGadget">
+        <t:implementation.widget location="toolbar-gadget.html"/>
+        <service name="Widget">
+        	<t:binding.http uri="http://localhost:9990/ui/toolbar-gadget"/>
+        </service>
+    </component>
+    
+    <component name="HomeGadget">
+        <t:implementation.widget location="home-gadget.html"/>
+        <service name="Widget">
+        	<t:binding.http uri="http://localhost:9990/ui/home-gadget"/>
+        </service>
+    </component>
+    
+    <component name="WorkspacePage">
         <t:implementation.widget location="workspace.html"/>
         <service name="Widget">
         	<t:binding.http uri="http://localhost:9990/ui/workspace"/>
         </service>
+        <reference name="toolbarGadget" target="ToolbarGadget">
+        	<t:binding.http/>
+        </reference>
+        <reference name="workspaceGadget" target="WorkspaceGadget">
+        	<t:binding.http/>
+        </reference>
+    </component>
+    
+    <component name="WorkspaceGadget">
+        <t:implementation.widget location="workspace-gadget.html"/>
+        <service name="Widget">
+        	<t:binding.http uri="http://localhost:9990/ui/workspace-gadget"/>
+        </service>
 		 <reference name="workspace" target="ContributionCollectionComponent/ItemCollection">
 		 	<t:binding.atom/>
 		 </reference>
     </component>
     
-    <component name="FilesUI">
+    <component name="FilesPage">
         <t:implementation.widget location="files.html"/>
         <service name="Widget">
         	<t:binding.http uri="http://localhost:9990/ui/files"/>
         </service>
+        <reference name="toolbarGadget" target="ToolbarGadget">
+        	<t:binding.http/>
+        </reference>
+        <reference name="filesGadget" target="FilesGadget">
+        	<t:binding.http/>
+        </reference>
+    </component>
+    
+    <component name="FilesGadget">
+        <t:implementation.widget location="files-gadget.html"/>
+        <service name="Widget">
+        	<t:binding.http uri="http://localhost:9990/ui/files-gadget"/>
+        </service>
 		 <reference name="files" target="FileCollectionComponent">
 		 	<t:binding.atom/>
 		 </reference>
     </component>
     
-    <component name="DomainCompositeUI">
+    <component name="DomainCompositePage">
         <t:implementation.widget location="composite.html"/>
         <service name="Widget">
         	<t:binding.http uri="http://localhost:9990/ui/composite"/>
         </service>
+        <reference name="toolbarGadget" target="ToolbarGadget">
+        	<t:binding.http/>
+        </reference>
+        <reference name="compositeGadget" target="DomainCompositeGadget">
+        	<t:binding.http/>
+        </reference>
+    </component>
+    
+    <component name="DomainCompositeGadget">
+        <t:implementation.widget location="composite-gadget.html"/>
+        <service name="Widget">
+        	<t:binding.http uri="http://localhost:9990/ui/composite-gadget"/>
+        </service>
 		 <reference name="domainComposite" target="DomainCompositeCollectionComponent/ItemCollection">
 		 	<t:binding.atom/>
 		 </reference>
@@ -62,11 +121,24 @@
 		 </reference>
     </component>
 
-    <component name="CloudUI">
+    <component name="CloudPage">
         <t:implementation.widget location="cloud.html"/>
         <service name="Widget">
         	<t:binding.http uri="http://localhost:9990/ui/cloud"/>
         </service>
+        <reference name="toolbarGadget" target="ToolbarGadget">
+        	<t:binding.http/>
+        </reference>
+        <reference name="cloudGadget" target="CloudGadget">
+        	<t:binding.http/>
+        </reference>
+    </component>
+    
+    <component name="CloudGadget">
+        <t:implementation.widget location="cloud-gadget.html"/>
+        <service name="Widget">
+        	<t:binding.http uri="http://localhost:9990/ui/cloud-gadget"/>
+        </service>
 		 <reference name="cloudComposite" target="CloudCollectionComponent/ItemCollection">
 		 	<t:binding.atom/>
 		 </reference>

Copied: tuscany/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html (from r680621, 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-gadget.html?p2=tuscany/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html&p1=tuscany/java/sca/modules/domain-manager/src/main/resources/cloud.html&r1=680621&r2=680931&rev=680931&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/cloud.html (original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html Wed Jul 30 00:59:46 2008
@@ -20,7 +20,7 @@
 <head>
 <title>SCA Domain - Cloud</title>
 
-<script type="text/javascript" src="cloud.js"></script>
+<script type="text/javascript" src="../cloud-gadget/cloud-gadget.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
 <script language="JavaScript">
@@ -303,7 +303,6 @@
 	}
 
 	function init() {
-		toolbar();
 		getNodes();
 		getComposites();
 		suggest(document.newNodeForm.compositeNamespace, suggestCompositeNamespaces);
@@ -317,10 +316,8 @@
 </head>
 
 <body onload="init()">
-  <div id="toolbar"></div>
-
   <div id="cloudComposite">
-  <br>
+  
   <span class=hd1>
   SCA Domain<br><br>
   Cloud</b>&nbsp;<a href="/cloud/"><img src="icons/feed-icon.png" border="0"></a>

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=680931&r1=680930&r2=680931&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 Wed Jul 30 00:59:46 2008
@@ -20,295 +20,35 @@
 <head>
 <title>SCA Domain - Cloud</title>
 
-<script type="text/javascript" src="cloud.js"></script>
-<script type="text/javascript" src="utils.js"></script>
+<script type="text/javascript" src="../cloud/cloud.js"></script>
 
 <script language="JavaScript">
 
 	//@Reference
-	var cloudComposite = new Reference("cloudComposite");
-	
-	//@Reference
-	var domainComposite = new Reference("domainComposite");
-	
-	//@Reference
-	var processCollection = new Reference("processCollection");
-	
-	function getNodes() {
-		cloudComposite.get("", getNodesResponse);
-	}
-	
-	function contributionURI(id) {
-       var i = id.indexOf(';');
-       return id.substring(10, i);
-	}
-	
-	function compositeName(id) {
-       var i = id.indexOf(';');
-       return id.substring(i + 1);
-	}
-	
-	function compositeLocalName(id) {
-		name = compositeName(id); 
-    	var i = name.indexOf(';');
-    	return name.substring(i + 1);
-	}
-	
-	var nodeNames;
-	
-	function getNodesResponse(feed) {
-		nodeNames = new Array();      
-		if (feed != null) {
-			var entries = feed.getElementsByTagName("entry");
-			var composites = "";
-			composites += '<table width="100%">';
-			composites += '<tr><th>Node</th><th>Status</th><th>Composite</th>' +
-			'<th>Contribution</th><th>Node Config</th></tr>';
-			
-			for (var i=0; i<entries.length; i++) {
-				var nodeId = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
-				var links = entries[i].getElementsByTagName("link");
-				var nodeLink = undefined;
-				var compositeLink = undefined;
-				var compositeId = "composite:undefined;undefined;undefined";
-				var uri = '<span style="color: red">unknown</span>';
-				var qname = undefined;
-				for (var l = 0; l < links.length; l++) {
-					var a = links[l].getAttribute('rel');
-					if (a == undefined) {
-					  nodeLink = links[l].getAttribute('href');
-					} else if (a == 'related') {
-					  compositeLink = links[l].getAttribute('href');
-					  var c = compositeLink.indexOf('composite:');
-					  compositeId = compositeLink.substring(c);
-					  uri = contributionURI(compositeId);
-					  qname = compositeName(compositeId);
-					}
-				}
-
-				var nodeName = compositeLocalName(nodeId);
-				nodeNames[i] = nodeName;
-				
-				var content = "";
-				if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
-					content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
-				}
-
-				composites += '<tr>'
-				if (content.indexOf('<span id="problem"') != -1) {
-					composites += '<td><input name="composites" type="checkbox" value="' + nodeId + '">' +
-											'<a href=\"' + nodeLink + '\">' + nodeName + '</a></td>';
-					composites += '<td><span id="status_' + nodeName + '">unknown</span></td>';
-					composites += '<td>' + content + '</td>';
-					composites += '<td>' + uri + '</td>';
-				} else {
-					composites += '<td><input name="composites" type="checkbox" value="' + nodeId + '">' +
-											'<a href=\"' + nodeLink + '\">' + nodeName + '</a></td>';
-					composites += '<td><span id="status_' + nodeName + '">unknown</span></td>';
-					composites += '<td><a href=\"' + compositeLink + '\">' + qname + '</a></td>';
-					composites += '<td><a href="/contribution/' + uri + '">' + uri + '</a></td>';
-				}
-				composites += '<td><a href="/node-config/' + nodeName + '"><img src="icons/feed-icon.png" border="0"></a></td>';
-				composites += '</tr>';
-			}
-			composites += '</table>';
-			document.getElementById("composites").innerHTML = composites;
-
-			processCollection.get("", getProcessesResponse);
-		}
-	}
-	
-	function getProcessesResponse(feed) {
-		if (feed != null) {
-			var nodeStatus = new Array();
-			
-			var entries = feed.getElementsByTagName("entry");
-			for (var i=0; i<entries.length; i++) {
-				var nodeName = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
-				nodeStatus[nodeName] = 'started';
-			}
-
-			for (var i = 0; i < nodeNames.length; i++) {
-				var element = document.getElementById('status_' + nodeNames[i]);
-				var nodeName = nodeNames[i];
-				if (nodeStatus[nodeName] == null) {
-					element.innerHTML = '<span>stopped</span>';
-				} else {
-					element.innerHTML = '<span><a style="color: green" href="/processes/?node=' + nodeName + '">started</a></span>';
-				}
-			}
-		}
-	}
-
-	function deleteNode() {
-		var composites  = array(document.cloudCompositeForm.composites);
-		for (var i = 0; i < composites.length; i++) {
-			if (composites[i].checked) {
-			    var id = composites[i].value;
-				cloudComposite.del(id, deleteNodeResponse);
-			}
-		}
-	}
-
-	function deleteNodeResponse() {
-	    getNodes();
-	}	
-
-	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 id  = 'composite:' +
-			'http://tuscany.apache.org/cloud' + ';' +
-			'http://tuscany.apache.org/cloud' + ';' +
-			nodeName;
-			
-		var entry = '<entry xmlns="http://www.w3.org/2005/Atom">\n' +
-              	'<id>' + id + '</id>\n' +
-              	'<content type="text/xml">\n' + 
-  				'<composite	xmlns="http://www.osoa.org/xmlns/sca/1.0"\n' +
-				'	xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"\n' +
-				'	targetNamespace="http://tuscany.apache.org/cloud"\n' +
-				'	xmlns:c="' + compositeNamespace + '"\n' +
-				'	name="' + nodeName + '">\n' +
-				'\n' +
-				'	<component name="' + nodeName + '">\n' +
-				'		<t:implementation.node uri="' + contributionURI + '" composite="c:' + compositeName + '"/>\n' +
-				'		<service name="Node">\n' +
-				'			<binding.ws uri="' + nodeURI + '"/>\n' +
-				'			<t:binding.http uri="' + nodeURI + '"/>\n' +
-				'			<t:binding.jsonrpc uri="' + nodeURI + '"/>\n' +
-				'			<t:binding.atom uri="' + nodeURI + '"/>\n' +
-				'		</service>\n' +
-				'	</component>\n' + 
-				'</composite>' +
-              	'</content>' +
-               	'</entry>';
-		cloudComposite.post(entry, addNodeResponse);
-	}
+	var toolbarGadget = new Reference("toolbarGadget");
 
-	function addNodeResponse() {
-		document.newNodeForm.nodeName.value = "";
-		document.newNodeForm.nodeURI.value = "";
-		document.newNodeForm.compositeNamespace.value = "";
-		document.newNodeForm.compositeName.value = "";
-		document.newNodeForm.contributionURI.value = "";
-	    getNodes();
-	}	
-
-	function startNode() {
-		var composites  = array(document.cloudCompositeForm.composites);
-		for (var i = 0; i < composites.length; i++) {
-			if (composites[i].checked) {
-			    var id = nodeNames[i];
-			    
-				var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
-              	'<id>' + id + '</id>' +
-               	'</entry>';
-				processCollection.post(entry, startNodeResponse);
-			}
-		}
-	}
-
-	function startNodeResponse() {
-		processCollection.get("", getProcessesResponse);
-		
-		var composites  = array(document.cloudCompositeForm.composites);
-		for (var i = 0; i < composites.length; i++) {
-			if (composites[i].checked) {
-			  composites[i].checked = false;
-			}
-		}
-	}	
-
-	function stopNode() {
-		var composites  = array(document.cloudCompositeForm.composites);
-		for (var i = 0; i < composites.length; i++) {
-			if (composites[i].checked) {
-			    var id = nodeNames[i];
-				processCollection.del(id, stopNodeResponse);
-			}
-		}
-	}
-
-	function stopNodeResponse() {
-		processCollection.get("", getProcessesResponse);
-		
-		var composites  = array(document.cloudCompositeForm.composites);
-		for (var i = 0; i < composites.length; i++) {
-			if (composites[i].checked) {
-			  composites[i].checked = false;
-			}
-		}
-	}	
-
-	var deployedComposites = new Array();
-	
-	function getComposites() {
-		domainComposite.get("", getCompositesResponse);
-	}
-	
-	function getCompositesResponse(feed) {
-		if (feed != null) {
-			var entries = feed.getElementsByTagName("entry");              
-			for (var i=0; i<entries.length; i++) {
-				var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
-				deployedComposites[id] = id;
-			}
-		}
-	}
-
-	function suggestCompositeNamespaces() {
-		var namespaces = new Array();
-		for (var uri in deployedComposites) {
-			var qname = compositeName(uri);
-			var ns = qname.substring(0, qname.indexOf(';'));
-			namespaces[ns] = ns;
-		}
-		return array(namespaces);
-	}	
-
-	function suggestCompositeNames() {
-		var inputns = document.newNodeForm.compositeNamespace.value;
-		var names = new Array();
-		for (var uri in deployedComposites) {
-			var qname = compositeName(uri);
-			var sc = qname.indexOf(';');
-			var ns = qname.substring(0, sc);
-			var name = qname.substring(sc + 1);
-			if (ns == inputns || inputns == "") {
-				names[name] = name;
-			}
-		}
-		return array(names);
-	}	
+	//@Reference
+	var cloudGadget = new Reference("cloudGadget");
 
-	function suggestContributionURIs() {
-		var inputns = document.newNodeForm.compositeNamespace.value;
-		var inputname = document.newNodeForm.compositeName.value;
-		var uris = new Array();
-		for (var uri in deployedComposites) {
-			var qname = compositeName(uri);
-			var sc = qname.indexOf(';');
-			var ns = qname.substring(0, sc);
-			var name = qname.substring(sc + 1);
-			if ((ns == inputns || inputns == "") && (name == inputname || inputname == "")) {
-				var curi = contributionURI(uri);
-				uris[curi] = curi;
-			}
-		}
-		return array(uris);
+	function toolbarGadget_getResponse(html) {
+		var gadget = document.getElementById('toolbarGadget');
+		var content = gadget.contentWindow.document;
+		content.open();
+		content.write(html);
+		content.close();
+	}
+
+	function cloudGadget_getResponse(html) {
+		var gadget = document.getElementById('cloudGadget');
+		var content = gadget.contentWindow.document;
+		content.open();
+		content.write(html);
+		content.close();
 	}
 
 	function init() {
-		toolbar();
-		getNodes();
-		getComposites();
-		suggest(document.newNodeForm.compositeNamespace, suggestCompositeNamespaces);
-		suggest(document.newNodeForm.compositeName, suggestCompositeNames);
-		suggest(document.newNodeForm.contributionURI, suggestContributionURIs);
+		toolbarGadget.get('', toolbarGadget_getResponse);
+		cloudGadget.get('', cloudGadget_getResponse);
 	}
 
 </script>
@@ -317,46 +57,8 @@
 </head>
 
 <body onload="init()">
-  <div id="toolbar"></div>
-
-  <div id="cloudComposite">
+  <iframe id="toolbarGadget" style="top: 0px; left: 0px; width: 100%;"></iframe>
   <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><br>
-  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>
+  <iframe id="cloudGadget" style="left: 0px; width: 100%; height: 100%;"></iframe>
 </body>
-
 </html>

Copied: tuscany/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html (from r680621, 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-gadget.html?p2=tuscany/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html&p1=tuscany/java/sca/modules/domain-manager/src/main/resources/composite.html&r1=680621&r2=680931&rev=680931&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/composite.html (original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html Wed Jul 30 00:59:46 2008
@@ -20,7 +20,7 @@
 <head>
 <title>SCA Domain - Domain Composite</title>
 
-<script type="text/javascript" src="composite.js"></script>
+<script type="text/javascript" src="../composite-gadget/composite-gadget.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
 <script language="JavaScript">
@@ -204,7 +204,6 @@
 	}
 
 	function init() {
-		toolbar();
 		getComposites();
 		getContributions();
 		suggest(document.newCompositeForm.compositeNamespace, suggestCompositeNamespaces);
@@ -218,10 +217,8 @@
 </head>
 
 <body onload="init()">
-  <div id="toolbar"></div>
-
   <div id="domainComposite">
-  <br>
+  
   <span class=hd1>
   SCA Domain<br><br>
   Domain Composite&nbsp;<a href="/composite/"><img src="icons/feed-icon.png" border="0"></a>

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=680931&r1=680930&r2=680931&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 Wed Jul 30 00:59:46 2008
@@ -20,238 +20,45 @@
 <head>
 <title>SCA Domain - Domain Composite</title>
 
-<script type="text/javascript" src="composite.js"></script>
-<script type="text/javascript" src="utils.js"></script>
+<script type="text/javascript" src="../composite/composite.js"></script>
 
 <script language="JavaScript">
 
 	//@Reference
-	var domainComposite = new Reference("domainComposite");
-	
-	//@Reference
-	var workspace = new Reference("workspace");
-	
-	function getComposites() {
-		domainComposite.get("", getCompositesResponse);
-	}
-	
-	function contributionURI(id) {
-	       var i = id.indexOf(';');
-	       return id.substring(10, i);
-	}
-	
-	function compositeName(id) {
-	       var i = id.indexOf(';');
-	       return id.substring(i + 1);
-	}
-		
-	function getCompositesResponse(feed) {
-		if (feed != null) {
-			var entries = feed.getElementsByTagName("entry");              
-			var composites = "";
-			composites += '<table width="100%">';
-			composites += '<tr><th>Composite</th>' +
-			'<th>Contribution</th>' +
-			'<th>Components</th>' +
-			'</tr>';
-			//'<th>Composite Configuration</th>' +
-			
-			for (var i=0; i<entries.length; i++) {
-				var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
-				var link = entries[i].getElementsByTagName("link")[0].getAttribute("href");
-				var uri = contributionURI(id);
-				var qname = compositeName(id);
-
-				var content = "";
-				if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
-					content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
-				}
-				var components = '';
-				var bs = content.indexOf('<span id="components">');
-				if (bs != -1) {
-					var es = content.indexOf('</span>', bs); 
-					components = content.substring(bs, es + 7);
-				} else {
-					bs = content.indexOf('<span id="problem"');
-					if (bs != -1) {
-						var es = content.indexOf('</span>', bs); 
-						components = content.substring(bs, es + 7);
-					}
-				}
-				
-				composites += '<tr>'
-				composites += '<td><input name="composites" type="checkbox" value="' + id + '">';
-				composites += '<a href=\"' + link + '\">' + qname + '</a></td>';
-				composites += '<td><a href="/contribution/' + uri + '">' + uri + '</a></td>';
-				composites += '<td class=tdw>' + components + '</td>';
-				//composites += '<td><a href="/composite-config/?composite=' + id + '"><img src="icons/feed-icon.png" border="0"></a></td>';
-				composites += '</tr>';
-			}
-			composites += '</table>';
-			document.getElementById("composites").innerHTML = composites;
-		}
-	}
-
-	function deleteComposite() {
-		var composites  = array(document.domainCompositeForm.composites);
-		for (var i = 0; i < composites.length; i++) {
-			if (composites[i].checked) {
-			    var id = composites[i].value;
-				domainComposite.del(id, deleteCompositeResponse);
-			}
-		}
-	}
+	var toolbarGadget = new Reference("toolbarGadget");
 
-	function deleteCompositeResponse() {
-	    getComposites();
-	}	
-
-	function addComposite() {
-		var id  = 'composite:' +
-			document.newCompositeForm.contributionURI.value + ';' +
-			document.newCompositeForm.compositeNamespace.value + ';' +
-			document.newCompositeForm.compositeName.value;
-		var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
-				'<title>' + id +'</title>' +
-              	'<id>' + id + '</id>' +
-               	'</entry>';
-		domainComposite.post(entry, addCompositeResponse);
-	}
+	//@Reference
+	var compositeGadget = new Reference("compositeGadget");
 
-	function addCompositeResponse() {
-		document.newCompositeForm.compositeNamespace.value = "";
-		document.newCompositeForm.compositeName.value = "";
-		document.newCompositeForm.contributionURI.value = "";
-	    getComposites();
-	}
-	
-	var contributedComposites = new Array();
-	
-	function getContributions() {
-		workspace.get("", getContributionsResponse);
-	}
-	
-	function getContributionsResponse(feed) {
-		if (feed != null) {
-			contributedComposites = new Array();
-			var entries = feed.getElementsByTagName("entry");              
-			for (var i=0; i<entries.length; i++) {
-				if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
-					var content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
-					var bs = content.indexOf('<span id="deployables">');
-					if (bs != -1) {
-						var es = content.indexOf('</span>', bs); 
-						content = content.substring(bs, es + 7);
-						for (;;) {
-							var bc = content.indexOf('composite:');
-							if (bc == -1) {
-								break;
-							}
-							var ec = content.indexOf('">', bc);
-							if (ec == -1) {
-								break;
-							}
-							var uri = content.substring(bc, ec);
-							contributedComposites[uri] = uri;
-							content = content.substring(ec +1);
-						}
-					}
-				}
-			}
-		}
-	}
-	
-	function suggestCompositeNamespaces() {
-		var namespaces = new Array();
-		for (var uri in contributedComposites) {
-			var qname = compositeName(uri);
-			var ns = qname.substring(0, qname.indexOf(';'));
-			namespaces[ns] = ns;
-		}
-		return array(namespaces);
-	}	
-
-	function suggestCompositeNames() {
-		var inputns = document.newCompositeForm.compositeNamespace.value;
-		var names = new Array();
-		for (var uri in contributedComposites) {
-			var qname = compositeName(uri);
-			var sc = qname.indexOf(';');
-			var ns = qname.substring(0, sc);
-			var name = qname.substring(sc + 1);
-			if (ns == inputns || inputns == "") {
-				names[name] = name;
-			}
-		}
-		return array(names);
-	}	
-
-	function suggestContributionURIs() {
-		var inputns = document.newCompositeForm.compositeNamespace.value;
-		var inputname = document.newCompositeForm.compositeName.value;
-		var uris = new Array();
-		for (var uri in contributedComposites) {
-			var qname = compositeName(uri);
-			var sc = qname.indexOf(';');
-			var ns = qname.substring(0, sc);
-			var name = qname.substring(sc + 1);
-			if ((ns == inputns || inputns == "") && (name == inputname || inputname == "")) {
-				var curi = contributionURI(uri);
-				uris[curi] = curi;
-			}
-		}
-		return array(uris);
+	function toolbarGadget_getResponse(html) {
+		var gadget = document.getElementById('toolbarGadget');
+		var content = gadget.contentWindow.document;
+		content.open();
+		content.write(html);
+		content.close();
+	}
+
+	function compositeGadget_getResponse(html) {
+		var gadget = document.getElementById('compositeGadget');
+		var content = gadget.contentWindow.document;
+		content.open();
+		content.write(html);
+		content.close();
 	}
 
 	function init() {
-		toolbar();
-		getComposites();
-		getContributions();
-		suggest(document.newCompositeForm.compositeNamespace, suggestCompositeNamespaces);
-		suggest(document.newCompositeForm.compositeName, suggestCompositeNames);
-		suggest(document.newCompositeForm.contributionURI, suggestContributionURIs);
+		toolbarGadget.get('', toolbarGadget_getResponse);
+		compositeGadget.get('', compositeGadget_getResponse);
 	}
-		
+
 </script>
 
 <link rel="stylesheet" type="text/css" href="manager.css">
 </head>
 
 <body onload="init()">
-  <div id="toolbar"></div>
-
-  <div id="domainComposite">
+  <iframe id="toolbarGadget" style="top: 0px; left: 0px; width: 100%;"></iframe>
   <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><br>
-  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>
+  <iframe id="compositeGadget" style="left: 0px; width: 100%; height: 100%;"></iframe>
 </body>
 </html>

Copied: tuscany/java/sca/modules/domain-manager/src/main/resources/files-gadget.html (from r680621, 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-gadget.html?p2=tuscany/java/sca/modules/domain-manager/src/main/resources/files-gadget.html&p1=tuscany/java/sca/modules/domain-manager/src/main/resources/files.html&r1=680621&r2=680931&rev=680931&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/files.html (original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/files-gadget.html Wed Jul 30 00:59:46 2008
@@ -20,7 +20,7 @@
 <head>
 <title>SCA Domain - Contribution File Server</title>
 
-<script type="text/javascript" src="files.js"></script>
+<script type="text/javascript" src="../files-gadget/files-gadget.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
 <script language="JavaScript">
@@ -66,7 +66,6 @@
 	}
 
 	function init() {
-		toolbar();	
 		getFiles();
 	}
 
@@ -76,10 +75,8 @@
 </head>
 
 <body onload="init()">
-  <div id="toolbar"></div>
-
   <div id="fileServer">
-  <br>
+  
   <span class=hd1>
   SCA Domain<br><br>
   File Server&nbsp;<a href="/feed/files/"><img src="icons/feed-icon.png" border="0"></a>

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=680931&r1=680930&r2=680931&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 Wed Jul 30 00:59:46 2008
@@ -20,54 +20,35 @@
 <head>
 <title>SCA Domain - Contribution File Server</title>
 
-<script type="text/javascript" src="files.js"></script>
-<script type="text/javascript" src="utils.js"></script>
+<script type="text/javascript" src="../files/files.js"></script>
 
 <script language="JavaScript">
 
 	//@Reference
-	var files = new Reference("files");
-	
-	function getFiles() {
-		files.get("", getFilesResponse);
-	}
-	
-	function getFilesResponse(feed) {
-		if (feed != null) {
-			var entries = feed.getElementsByTagName("entry");              
-			var list = '<table width="100%"><tr><th>Files</th></tr>';
-			for (var i=0; i<entries.length; i++) {
-				var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
-				var location = entries[i].getElementsByTagName("link")[0].getAttribute("href");
-				list += '<tr><td><input name="files" type="checkbox" value="' + id + '">' +
-											'<a href=\"' + location + '\">' + id + '</a></td></tr>';
-			}
-			list += "</table>";
-			document.getElementById("files").innerHTML = list;
-		}
-	}				
-
-	function deleteFile() {
-		var list = array(document.filesForm.files);
-		for (var i=0; i < list.length; i++) {
-			if (list[i].checked) {
-			    var id = list[i].value;
-				files.del(id, deleteFileResponse);
-			}
-		}
-	}
+	var toolbarGadget = new Reference("toolbarGadget");
 
-	function deleteFileResponse() {
-	    getFiles();
+	//@Reference
+	var filesGadget = new Reference("filesGadget");
+
+	function toolbarGadget_getResponse(html) {
+		var gadget = document.getElementById('toolbarGadget');
+		var content = gadget.contentWindow.document;
+		content.open();
+		content.write(html);
+		content.close();
 	}
 
-	function uploadFile() {
-		document.uploadFileForm.submit();
+	function filesGadget_getResponse(html) {
+		var gadget = document.getElementById('filesGadget');
+		var content = gadget.contentWindow.document;
+		content.open();
+		content.write(html);
+		content.close();
 	}
 
 	function init() {
-		toolbar();	
-		getFiles();
+		toolbarGadget.get('', toolbarGadget_getResponse);
+		filesGadget.get('', filesGadget_getResponse);
 	}
 
 </script>
@@ -76,39 +57,8 @@
 </head>
 
 <body onload="init()">
-  <div id="toolbar"></div>
-
-  <div id="fileServer">
+  <iframe id="toolbarGadget" style="top: 0px; left: 0px; width: 100%;"></iframe>
   <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><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>
-  
-  <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>
+  <iframe id="filesGadget" style="left: 0px; width: 100%; height: 100%;"></iframe>
 </body>
 </html>

Copied: tuscany/java/sca/modules/domain-manager/src/main/resources/home-gadget.html (from r680621, 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-gadget.html?p2=tuscany/java/sca/modules/domain-manager/src/main/resources/home-gadget.html&p1=tuscany/java/sca/modules/domain-manager/src/main/resources/home.html&r1=680621&r2=680931&rev=680931&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/home.html (original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/home-gadget.html Wed Jul 30 00:59:46 2008
@@ -20,25 +20,22 @@
 <head>
 <title>SCA Domain - Home</title>
 
-<script type="text/javascript" src="home.js"></script>
+<script type="text/javascript" src="../home-gadget/home-gadget.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
 <script language="JavaScript">
 
 	function init() {
-		toolbar();
 	}
 
-
 </script>
 
 <link rel="stylesheet" type="text/css" href="manager.css">
 </head>
 
 <body onload="init()">
-  <div id="toolbar"></div>
+  <div id="home">
   
-  <br>
   <span class=hd1>
   SCA Domain
   </span>
@@ -55,5 +52,6 @@
   <br><br><br><br><br><br><br>
   <center>This page is under construction, searching the domain is not implemented yet.</center>
   
+  </div>
 </body>
 </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=680931&r1=680930&r2=680931&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 Wed Jul 30 00:59:46 2008
@@ -20,15 +20,36 @@
 <head>
 <title>SCA Domain - Home</title>
 
-<script type="text/javascript" src="home.js"></script>
-<script type="text/javascript" src="utils.js"></script>
+<script type="text/javascript" src="../home/home.js"></script>
 
 <script language="JavaScript">
 
-	function init() {
-		toolbar();
+	//@Reference
+	var toolbarGadget = new Reference("toolbarGadget");
+
+	//@Reference
+	var homeGadget = new Reference("homeGadget");
+
+	function toolbarGadget_getResponse(html) {
+		var gadget = document.getElementById('toolbarGadget');
+		var content = gadget.contentWindow.document;
+		content.open();
+		content.write(html);
+		content.close();
 	}
 
+	function homeGadget_getResponse(html) {
+		var gadget = document.getElementById('homeGadget');
+		var content = gadget.contentWindow.document;
+		content.open();
+		content.write(html);
+		content.close();
+	}
+
+	function init() {
+		toolbarGadget.get('', toolbarGadget_getResponse);
+		homeGadget.get('', homeGadget_getResponse);
+	}
 
 </script>
 
@@ -36,24 +57,8 @@
 </head>
 
 <body onload="init()">
-  <div id="toolbar"></div>
-  
+  <iframe id="toolbarGadget" style="top: 0px; left: 0px; width: 100%;"></iframe>
   <br>
-  <span class=hd1>
-  SCA Domain
-  </span>
-  
-  <br><br><br><br><br>
-  
-  <form>
-  <table border="0" align="center">
-  <tr><td valign="top"><span style="font-size:150%; color: blue">Search:</span></td><td><input type="text" name="search" size="50"/></td></tr>
-  <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>
-  
+  <iframe id="homeGadget" style="left: 0px; width: 100%; height: 100%;"></iframe>
 </body>
 </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=680931&r1=680930&r2=680931&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 Wed Jul 30 00:59:46 2008
@@ -18,7 +18,7 @@
  */
 
 body {
-	white-space: nowrap
+	white-space: nowrap; overflow: hidden;
 }
 
 table {
@@ -36,6 +36,10 @@
 	padding-left: 2px; padding-top: 2px; padding-right: 20px; white-space: nowrap; vertical-align: text-top
 }
 
+iframe {
+	border: 0px; margin: 0px; padding: 0px; position: absolute; overflow: hidden;
+}
+
 input {
 	vertical-align: middle
 }
@@ -97,3 +101,4 @@
 	padding-left: 2px; padding-top: 0px; padding-bottom: 0px; padding-right: 2px; white-space: nowrap; vertical-align: text-top;
 	background-color: #598edd; color: #e5ecf9;
 }
+

Copied: tuscany/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html (from r680621, 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/toolbar-gadget.html?p2=tuscany/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html&p1=tuscany/java/sca/modules/domain-manager/src/main/resources/home.html&r1=680621&r2=680931&rev=680931&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/home.html (original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html Wed Jul 30 00:59:46 2008
@@ -18,18 +18,24 @@
 -->
 <html>
 <head>
-<title>SCA Domain - Home</title>
+<title>SCA Domain - Toolbar</title>
 
-<script type="text/javascript" src="home.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
 <script language="JavaScript">
 
 	function init() {
-		toolbar();
+		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">
@@ -37,23 +43,5 @@
 
 <body onload="init()">
   <div id="toolbar"></div>
-  
-  <br>
-  <span class=hd1>
-  SCA Domain
-  </span>
-  
-  <br><br><br><br><br>
-  
-  <form>
-  <table border="0" align="center">
-  <tr><td valign="top"><span style="font-size:150%; color: blue">Search:</span></td><td><input type="text" name="search" size="50"/></td></tr>
-  <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>
-  
 </body>
 </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=680931&r1=680930&r2=680931&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 Wed Jul 30 00:59:46 2008
@@ -141,7 +141,7 @@
 Tool.prototype.print = function() {
     var loc = '' + location;
 	if (loc.match(this.href) == null) {
-		return '<a href="' + this.href + '">' + this.name + '</a>';
+		return '<a href="' + this.href + '" target="_parent">' + this.name + '</a>';
 	} else {
 		return '<span>' + this.name + '</span>';
 	}
@@ -150,7 +150,7 @@
 /**
  * Initialize the toolbar
  */
-function toolbar() {
+function toolbar(home, tools) {
 	var toolbar = '<table width="100%" cellpadding="0" cellspacing="0" class=tbar><tr>' +
 	'<td class=ltbar><table border="0" cellspacing="0" cellpadding="0"><tr>';
    
@@ -163,7 +163,7 @@
    	'<td class=rtbar>' + home.print() + '</td></tr></table></td>' +
    	'</tr></table>';
 
-	document.getElementById('toolbar').innerHTML = toolbar;
+   	return toolbar;
 }
 
 /**
@@ -184,14 +184,3 @@
   		return a;
   	}
 }
-
-/**
- * Populate the default toolbar
- */
-var tools = new Array();
-tools[0] = new Tool("Contributions", "/ui/workspace");
-tools[1] = new Tool("Composites", "/ui/composite");
-tools[2] = new Tool("Cloud", "/ui/cloud");
-tools[3] = new Tool("Files", "/ui/files");
-
-var home = new Tool("Home", "/ui/home");

Copied: tuscany/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html (from r680621, 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-gadget.html?p2=tuscany/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html&p1=tuscany/java/sca/modules/domain-manager/src/main/resources/workspace.html&r1=680621&r2=680931&rev=680931&view=diff
==============================================================================
--- tuscany/java/sca/modules/domain-manager/src/main/resources/workspace.html (original)
+++ tuscany/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html Wed Jul 30 00:59:46 2008
@@ -20,7 +20,7 @@
 <head>
 <title>SCA Domain - Contributions</title>
 
-<script type="text/javascript" src="workspace.js"></script>
+<script type="text/javascript" src="../workspace-gadget/workspace-gadget.js"></script>
 <script type="text/javascript" src="utils.js"></script>
 
 <script language="JavaScript">
@@ -156,7 +156,6 @@
 	}
 
 	function init() {
-		toolbar();
 		getContributions();
 		getSuggestedContributions();
 		suggest(document.newContributionForm.contributionID, suggestContributionIDs);
@@ -169,10 +168,8 @@
 </head>
 
 <body onload="init()">
-  <div id="toolbar"></div>
-
   <div id="workspace">
-  <br>
+  
   <span class=hd1>
   SCA Domain<br><br>
   Contributions</b>&nbsp;<a href="/workspace/"><img src="icons/feed-icon.png" border="0"></a>  </span>

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=680931&r1=680930&r2=680931&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 Wed Jul 30 00:59:46 2008
@@ -20,187 +20,45 @@
 <head>
 <title>SCA Domain - Contributions</title>
 
-<script type="text/javascript" src="workspace.js"></script>
-<script type="text/javascript" src="utils.js"></script>
+<script type="text/javascript" src="../workspace/workspace.js"></script>
 
 <script language="JavaScript">
 
 	//@Reference
-	var workspace = new Reference("workspace");
-	
-	function getContributions() {
-		workspace.get("", getContributionsResponse);
-	}
-	
-	function getContributionsResponse(feed) {
-		if (feed != null) {
-			var entries = feed.getElementsByTagName("entry");              
-			var contributions = "";
-			contributions += '<table width="100%">';
-			contributions += '<tr><th>Contribution</th><th>Dependencies</td><th>Deployable Composites</th></tr>';
-			for (var i=0; i<entries.length; i++) {
-				var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
-				var location = entries[i].getElementsByTagName("link")[0].getAttribute("href");
-				var content = '';
-				if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
-					content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
-				}
-				
-				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) {
-					var es = content.indexOf('</span>', bs); 
-					dependencies = content.substring(bs, es + 7);
-				}
-											
-				var deployables = '';
-				var bs = content.indexOf('<span id="deployables">');
-				if (bs != -1) {
-					var es = content.indexOf('</span>', bs); 
-					deployables = content.substring(bs, es + 7);
-				}
-				
-				var problems = "";
-				var bs = content.indexOf('<span id="problems" ');
-				if (bs != -1) {
-					var es = content.indexOf('</span>', bs);
-					if (dependencies.length != 0) {
-					  problems = '<br>';
-					} 
-					problems += content.substring(bs, es + 7);
-				}
-											
-				contributions += '<td class=tdw>' + dependencies + problems + ' </td>';
-				contributions += '<td class=tdw>' + deployables + '</td>';
-				contributions += '</tr>';
-			}
-			contributions += '</table>';
-			document.getElementById("contributions").innerHTML = contributions;
-		}
-	}				
-
-	var suggestedContributions = new Array();
-	
-	function getSuggestedContributions() {
-		workspace.get("?suggestions=true", getSuggestedContributionsResponse);
-	}
-	
-	function getSuggestedContributionsResponse(feed) {
-		suggestedContributions = new Array();
-		if (feed != null) {
-			var entries = feed.getElementsByTagName("entry");              
-			for (var i=0; i<entries.length; i++) {
-				var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
-				var location = entries[i].getElementsByTagName("link")[1].getAttribute("href");
-				suggestedContributions[i] = id + ':' + location;	
-			}
-		}
-	}				
-
-	function deleteContribution() {
-		var contributions  = array(document.workspaceForm.contributions);
-		for (var i=0; i < contributions.length; i++) {
-			if (contributions[i].checked) {
-			    var id = contributions[i].value;
-				workspace.del(id, deleteContributionResponse);
-			}
-		}
-	}
+	var toolbarGadget = new Reference("toolbarGadget");
 
-	function deleteContributionResponse() {
-	    getContributions();
-	}	
-
-	function addContribution() {
-		var id  = document.newContributionForm.contributionID.value;
-		var location  = document.newContributionForm.contributionLocation.value;
-		var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
-				'<title>Contribution - ' + id +'</title>' +
-              	'<id>' + id + '</id>' +
-              	'<link href="' + location + '" />' +
-               	'</entry>';
-		workspace.post(entry, addContributionResponse);
-	}
-
-	function addContributionResponse() {
-		document.newContributionForm.contributionID.value = "";
-		document.newContributionForm.contributionLocation.value = "";
-	    getContributions();
-	}
-
-	function suggestContributionIDs() {
-		var ids = new Array();
-		for (var i=0; i<suggestedContributions.length; i++) {
-			var uri = suggestedContributions[i];
-			var id = uri.substring(0, uri.indexOf(':'));
-			ids[id] = id;
-		}
-		return array(ids);
-	}
+	//@Reference
+	var workspaceGadget = new Reference("workspaceGadget");
 
-	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) {
-				var location = uri.substring(uri.indexOf(':') +1);
-				locations[location] = location;
-			}
-		}
-		return array(locations);
+	function toolbarGadget_getResponse(html) {
+		var gadget = document.getElementById('toolbarGadget');
+		var content = gadget.contentWindow.document;
+		content.open();
+		content.write(html);
+		content.close();
+	}
+
+	function workspaceGadget_getResponse(html) {
+		var gadget = document.getElementById('workspaceGadget');
+		var content = gadget.contentWindow.document;
+		content.open();
+		content.write(html);
+		content.close();
 	}
 
 	function init() {
-		toolbar();
-		getContributions();
-		getSuggestedContributions();
-		suggest(document.newContributionForm.contributionID, suggestContributionIDs);
-		suggest(document.newContributionForm.contributionLocation, suggestContributionLocations);
+		toolbarGadget.get('', toolbarGadget_getResponse);
+		workspaceGadget.get('', workspaceGadget_getResponse);
 	}
-	
+
 </script>
 
 <link rel="stylesheet" type="text/css" href="manager.css">
 </head>
 
 <body onload="init()">
-  <div id="toolbar"></div>
-
-  <div id="workspace">
+  <iframe id="toolbarGadget" style="top: 0px; left: 0px; width: 100%;"></iframe>
   <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><br>
-  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>
+  <iframe id="workspaceGadget" style="left: 0px; width: 100%; height: 100%;"></iframe>
 </body>
 </html>