From 744d23fe6f4a293015272943f90b78a8825a5f16 Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Wed, 30 Jul 2008 07:59:46 +0000 Subject: 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. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@680931 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/binding/atom/impl/AtomBindingImpl.java | 15 +- .../sca/binding/http/impl/HTTPBindingImpl.java | 37 ++- .../src/main/resources/DomainManager.composite | 82 ++++- .../src/main/resources/cloud-gadget.html | 359 +++++++++++++++++++++ .../domain-manager/src/main/resources/cloud.html | 340 ++----------------- .../src/main/resources/composite-gadget.html | 254 +++++++++++++++ .../src/main/resources/composite.html | 235 ++------------ .../src/main/resources/files-gadget.html | 111 +++++++ .../domain-manager/src/main/resources/files.html | 90 ++---- .../src/main/resources/home-gadget.html | 57 ++++ .../domain-manager/src/main/resources/home.html | 49 +-- .../domain-manager/src/main/resources/manager.css | 7 +- .../src/main/resources/toolbar-gadget.html | 47 +++ .../domain-manager/src/main/resources/utils.js | 17 +- .../src/main/resources/workspace-gadget.html | 203 ++++++++++++ .../src/main/resources/workspace.html | 186 ++--------- 16 files changed, 1272 insertions(+), 817 deletions(-) create mode 100644 java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html create mode 100644 java/sca/modules/domain-manager/src/main/resources/composite-gadget.html create mode 100644 java/sca/modules/domain-manager/src/main/resources/files-gadget.html create mode 100644 java/sca/modules/domain-manager/src/main/resources/home-gadget.html create mode 100644 java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html create mode 100644 java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html (limited to 'java/sca') diff --git a/java/sca/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java b/java/sca/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java index 39db5e5865..04f1412fd8 100644 --- a/java/sca/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java +++ b/java/sca/modules/binding-atom/src/main/java/org/apache/tuscany/sca/binding/atom/impl/AtomBindingImpl.java @@ -100,6 +100,14 @@ class AtomBindingImpl implements AtomBinding, OptimizableBinding, PolicySetAttac this.intentAttachPointType = intentAttachPointType; } + public void setPolicySets(List policySets) { + this.policySets = policySets; + } + + public void setRequiredIntents(List 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 @@ class AtomBindingImpl implements AtomBinding, OptimizableBinding, PolicySetAttac this.targetComponentService = service; } - public void setPolicySets(List policySets) { - this.policySets = policySets; - } - - public void setRequiredIntents(List intents) { - this.requiredIntents = intents; - } } diff --git a/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java b/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java index ced0d79887..19fd0e5665 100644 --- a/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java +++ b/java/sca/modules/binding-http/src/main/java/org/apache/tuscany/sca/binding/http/impl/HTTPBindingImpl.java @@ -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 @@ import org.apache.tuscany.sca.binding.http.HTTPBinding; * * @version $Rev$ $Date$ */ -class HTTPBindingImpl implements HTTPBinding { +class HTTPBindingImpl implements HTTPBinding, OptimizableBinding { private String name; private String uri; @@ -61,4 +65,35 @@ class HTTPBindingImpl implements HTTPBinding { 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; + } + } diff --git a/java/sca/modules/domain-manager/src/main/resources/DomainManager.composite b/java/sca/modules/domain-manager/src/main/resources/DomainManager.composite index 8744223b41..8ab19462c9 100644 --- a/java/sca/modules/domain-manager/src/main/resources/DomainManager.composite +++ b/java/sca/modules/domain-manager/src/main/resources/DomainManager.composite @@ -22,37 +22,96 @@ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0" name="DomainManager"> - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - + + + + + + + + + + + + + + @@ -62,10 +121,23 @@ - + + + + + + + + + + + + + + diff --git a/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html b/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html new file mode 100644 index 0000000000..c3be5e08eb --- /dev/null +++ b/java/sca/modules/domain-manager/src/main/resources/cloud-gadget.html @@ -0,0 +1,359 @@ + + + +SCA Domain - Cloud + + + + + + + + + + +
+ + + SCA Domain

+ Cloud  +
+

+ Here is the list of SCA nodes configured in your SCA domain cloud. +

+ +
+
+
+ + +    + +
+ +

+ +
+ + + +
Add a Node
Add a node to the cloud. The node will run the SCA components declared in the specified composite.
+
+ + + + + + +
Node name:e.g. YourNode
Node URI:e.g. http://yourhost:8080
Composite namespace:e.g. http://your/namespace
Composite name:e.g. yourcomposite
Contribution URI:e.g. yourcontrib, http://yourcontrib
+ +
+ +
+ + + diff --git a/java/sca/modules/domain-manager/src/main/resources/cloud.html b/java/sca/modules/domain-manager/src/main/resources/cloud.html index 2564322ec9..20794e7b6d 100644 --- a/java/sca/modules/domain-manager/src/main/resources/cloud.html +++ b/java/sca/modules/domain-manager/src/main/resources/cloud.html @@ -20,295 +20,35 @@ SCA Domain - Cloud - - + @@ -317,46 +57,8 @@ -
- -
+
- - SCA Domain

- Cloud  -
-

- Here is the list of SCA nodes configured in your SCA domain cloud. -

- -
-
-
- - -    - -
- -

- -
- - - -
Add a Node
Add a node to the cloud. The node will run the SCA components declared in the specified composite.
-
- - - - - - -
Node name:e.g. YourNode
Node URI:e.g. http://yourhost:8080
Composite namespace:e.g. http://your/namespace
Composite name:e.g. yourcomposite
Contribution URI:e.g. yourcontrib, http://yourcontrib
- -
- -
+ - diff --git a/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html b/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html new file mode 100644 index 0000000000..1c78db7597 --- /dev/null +++ b/java/sca/modules/domain-manager/src/main/resources/composite-gadget.html @@ -0,0 +1,254 @@ + + + +SCA Domain - Domain Composite + + + + + + + + + + +
+ + + SCA Domain

+ Domain Composite  +
+

+ Here is the list of SCA composites currently included as top-level composites in your SCA domain. +

+ +
+
+
+ +
+ +

+ +
+ + + +
Add Composite
Add an SCA composite describing your SCA service components.
+
+ + + + +
Composite namespace:e.g. http://your/namespace
Composite name:e.g. yourcomposite
Contribution URI:e.g. yourcontrib, http://yourcontrib
+ +
+ +
+ + diff --git a/java/sca/modules/domain-manager/src/main/resources/composite.html b/java/sca/modules/domain-manager/src/main/resources/composite.html index 9a873d42d2..bbf2b172b6 100644 --- a/java/sca/modules/domain-manager/src/main/resources/composite.html +++ b/java/sca/modules/domain-manager/src/main/resources/composite.html @@ -20,238 +20,45 @@ SCA Domain - Domain Composite - - + -
- -
+
- - SCA Domain

- Domain Composite  -
-

- Here is the list of SCA composites currently included as top-level composites in your SCA domain. -

- -
-
-
- -
- -

- -
- - - -
Add Composite
Add an SCA composite describing your SCA service components.
-
- - - - -
Composite namespace:e.g. http://your/namespace
Composite name:e.g. yourcomposite
Contribution URI:e.g. yourcontrib, http://yourcontrib
- -
- -
+ diff --git a/java/sca/modules/domain-manager/src/main/resources/files-gadget.html b/java/sca/modules/domain-manager/src/main/resources/files-gadget.html new file mode 100644 index 0000000000..d4231ee21a --- /dev/null +++ b/java/sca/modules/domain-manager/src/main/resources/files-gadget.html @@ -0,0 +1,111 @@ + + + +SCA Domain - Contribution File Server + + + + + + + + + + +
+ + + SCA Domain

+ File Server  +
+

+ This is a simple ATOM-based file server useful to share files if you don't have an FTP, SVN or Maven repository. +

+ +
+
+
+ +
+ +

+ +
+ + + +
Upload File
Upload a file to the server.
+
+ + +
File:
+
+ +
+ +
+ + diff --git a/java/sca/modules/domain-manager/src/main/resources/files.html b/java/sca/modules/domain-manager/src/main/resources/files.html index 1a7460df11..71b543477a 100644 --- a/java/sca/modules/domain-manager/src/main/resources/files.html +++ b/java/sca/modules/domain-manager/src/main/resources/files.html @@ -20,54 +20,35 @@ SCA Domain - Contribution File Server - - + @@ -76,39 +57,8 @@ -
- -
+
- - SCA Domain

- File Server  -
-

- This is a simple ATOM-based file server useful to share files if you don't have an FTP, SVN or Maven repository. -

- -
-
-
- -
- -

- -
- - - -
Upload File
Upload a file to the server.
-
- - -
File:
-
- -
- -
+ diff --git a/java/sca/modules/domain-manager/src/main/resources/home-gadget.html b/java/sca/modules/domain-manager/src/main/resources/home-gadget.html new file mode 100644 index 0000000000..ce7cd08fdf --- /dev/null +++ b/java/sca/modules/domain-manager/src/main/resources/home-gadget.html @@ -0,0 +1,57 @@ + + + +SCA Domain - Home + + + + + + + + + + +
+ + + SCA Domain + + +




+ +
+ + + +
Search:
+
+ +






+
This page is under construction, searching the domain is not implemented yet.
+ +
+ + diff --git a/java/sca/modules/domain-manager/src/main/resources/home.html b/java/sca/modules/domain-manager/src/main/resources/home.html index 88f190336d..0adf5cbcb7 100644 --- a/java/sca/modules/domain-manager/src/main/resources/home.html +++ b/java/sca/modules/domain-manager/src/main/resources/home.html @@ -20,15 +20,36 @@ SCA Domain - Home - - + @@ -36,24 +57,8 @@ -
- +
- - SCA Domain - - -




- -
- - - -
Search:
-
- -






-
This page is under construction, searching the domain is not implemented yet.
- + diff --git a/java/sca/modules/domain-manager/src/main/resources/manager.css b/java/sca/modules/domain-manager/src/main/resources/manager.css index 5f4166876d..7eb10ee318 100644 --- a/java/sca/modules/domain-manager/src/main/resources/manager.css +++ b/java/sca/modules/domain-manager/src/main/resources/manager.css @@ -18,7 +18,7 @@ */ body { - white-space: nowrap + white-space: nowrap; overflow: hidden; } table { @@ -36,6 +36,10 @@ td { 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 @@ suggestTable { padding-left: 2px; padding-top: 0px; padding-bottom: 0px; padding-right: 2px; white-space: nowrap; vertical-align: text-top; background-color: #598edd; color: #e5ecf9; } + diff --git a/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html b/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html new file mode 100644 index 0000000000..1ea1e1f8fd --- /dev/null +++ b/java/sca/modules/domain-manager/src/main/resources/toolbar-gadget.html @@ -0,0 +1,47 @@ + + + +SCA Domain - Toolbar + + + + + + + + + +
+ + diff --git a/java/sca/modules/domain-manager/src/main/resources/utils.js b/java/sca/modules/domain-manager/src/main/resources/utils.js index a75bc45a13..c382ab9e5a 100644 --- a/java/sca/modules/domain-manager/src/main/resources/utils.js +++ b/java/sca/modules/domain-manager/src/main/resources/utils.js @@ -141,7 +141,7 @@ function Tool(name, href) { Tool.prototype.print = function() { var loc = '' + location; if (loc.match(this.href) == null) { - return '' + this.name + ''; + return '' + this.name + ''; } else { return '' + this.name + ''; } @@ -150,7 +150,7 @@ Tool.prototype.print = function() { /** * Initialize the toolbar */ -function toolbar() { +function toolbar(home, tools) { var toolbar = '' + '' + '
'; @@ -163,7 +163,7 @@ function toolbar() { '
' + home.print() + '
'; - document.getElementById('toolbar').innerHTML = toolbar; + return toolbar; } /** @@ -184,14 +184,3 @@ function array(obj) { 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"); diff --git a/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html b/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html new file mode 100644 index 0000000000..41e5d6b475 --- /dev/null +++ b/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html @@ -0,0 +1,203 @@ + + + +SCA Domain - Contributions + + + + + + + + + + +
+ + + SCA Domain

+ Contributions 
+

+ Here is the list of SCA contributions currently available in your SCA domain. +

+ +
+
+
+ +
+ +

+ +
+ + + +
Add Contribution
Add an SCA contribution containing your application artifacts to the SCA domain.
+
+ + + +
Contribution URI:e.g. yourcontrib, http://yourcontrib
Location:e.g. http://host/yourjar.jar, file:/yourdir, file:/yourjar.jar
+ +
+ +
+ + diff --git a/java/sca/modules/domain-manager/src/main/resources/workspace.html b/java/sca/modules/domain-manager/src/main/resources/workspace.html index db3b4ac560..9c9a1dc005 100644 --- a/java/sca/modules/domain-manager/src/main/resources/workspace.html +++ b/java/sca/modules/domain-manager/src/main/resources/workspace.html @@ -20,187 +20,45 @@ SCA Domain - Contributions - - + -
- -
+
- - SCA Domain

- Contributions 
-

- Here is the list of SCA contributions currently available in your SCA domain. -

- -
-
-
- -
- -

- -
- - - -
Add Contribution
Add an SCA contribution containing your application artifacts to the SCA domain.
-
- - - -
Contribution URI:e.g. yourcontrib, http://yourcontrib
Location:e.g. http://host/yourjar.jar, file:/yourdir, file:/yourjar.jar
- -
- -
+ -- cgit v1.2.3