summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/node-manager/src
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2011-04-21 00:17:48 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2011-04-21 00:17:48 +0000
commitafbc2cad2eed7adbf26a4a375f6865b2e553d6e7 (patch)
treef79a5d1156343b0646c1629d7ae1c4756a590fcc /sca-java-2.x/trunk/modules/node-manager/src
parent82b04d51fa2430391ec37c0f1fd9d25d7673067a (diff)
Adding more artifacts to the domain artifact tree
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1095575 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/node-manager/src')
-rw-r--r--sca-java-2.x/trunk/modules/node-manager/src/test/resources/ui/index.html56
1 files changed, 44 insertions, 12 deletions
diff --git a/sca-java-2.x/trunk/modules/node-manager/src/test/resources/ui/index.html b/sca-java-2.x/trunk/modules/node-manager/src/test/resources/ui/index.html
index 32cee911bb..39d6482e7d 100644
--- a/sca-java-2.x/trunk/modules/node-manager/src/test/resources/ui/index.html
+++ b/sca-java-2.x/trunk/modules/node-manager/src/test/resources/ui/index.html
@@ -16,7 +16,7 @@ body,html {
margin-left: 16px;
width: 16px;
height: 16px;
- background: url('/manager/ui/component.gif') no-repeat;
+ background: url('component.gif') no-repeat;
}
.serviceIcon {
@@ -89,7 +89,7 @@ body,html {
identifier: 'id',
label: 'label',
type: 'type',
- items: []
+ items: [ ]
}
});
treeModel = new dijit.tree.ForestStoreModel({
@@ -100,16 +100,17 @@ body,html {
model: treeModel,
showRoot: false,
getIconClass: function(/*dojo.data.Item*/ item, /*Boolean*/ opened) {
+ console.log("##" + item.type);
if(item.type != undefined) {
if(item.type == 'component') {
return "componentIcon";
- } else if(item.type == 'service') {
+ } else if(item.type == 'service' || item.type == 'service-binding') {
return "serviceIcon";
- } else if(item.type == 'reference') {
+ } else if(item.type == 'reference' || item.type == 'reference-binding') {
return "referenceIcon";
- }
+ }
}
- return "componentIcon";
+ return "serviceIcon";
},
onClick: showArtifactDocumentation,
_createTreeNode: function(/*Object*/ args) {
@@ -131,7 +132,6 @@ body,html {
return;
}
-
var componentNode = xmlResponse.getElementsByTagName ("component");
//loop trough all components
for (c = 0; c < componentNode.length; c++) {
@@ -151,11 +151,20 @@ body,html {
var serviceItem = store.newItem({id:serviceId, label:serviceAttributes['name'].value, type:'service'}, parentInfo);
- var bindingNode = serviceNode[s].getElementsByTagName ("binding.*");
- for(sb = 0; sb < bindingNode.length; sb++) {
- alert(bindingNode[sb].attributes['name'].value);
- }
-
+ //loop trough children to find bindings
+ for(b=0; b < serviceNode[s].childNodes.length; b ++) {
+ var childNode = serviceNode[s].childNodes[b];
+ if(childNode.nodeName.indexOf('binding') == 0) {
+ var bindingId = serviceId + "/" + childNode.nodeName;
+
+ var parentInfo={
+ parent: serviceItem,
+ attribute: "children"
+ };
+
+ var bindingItem = store.newItem({id:bindingId, label:childNode.nodeName, type:'service-binding'}, parentInfo);
+ }
+ }
}
@@ -171,6 +180,22 @@ body,html {
};
var referenceItem = store.newItem({id:serviceId, label:referenceAttributes['name'].value, type:'reference'}, parentInfo);
+
+ //loop trough children to find bindings
+ for(b=0; b < referenceNode[s].childNodes.length; b ++) {
+ var childNode = referenceNode[s].childNodes[b];
+ if(childNode.nodeName.indexOf('binding') == 0) {
+ var bindingId = serviceId + "/" + childNode.nodeName;
+
+ var parentInfo={
+ parent: serviceItem,
+ attribute: "children"
+ };
+
+ var bindingItem = store.newItem({id:bindingId, label:childNode.nodeName, type:'reference-binding'}, parentInfo);
+ }
+ }
+
}
@@ -209,6 +234,13 @@ body,html {
alert('showing documentation for' + item.id);
}
+ function guidGenerator() {
+ var S4 = function() {
+ return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
+ };
+ return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
+ }
+
dojo.addOnLoad(prepare);
</script>