1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Tuscany Extensions</title>
<script type="text/javascript" src="/dojo/dojo.js"></script>
<style type="text/css">
body,html {
font-family: helvetica, arial, sans-serif;
font-size: 90%;
}
</style>
</head>
<body>
<div id="bodydiv" style="position: absolute; top: 0px; left: 0px; right: 0px;">
<div style="position:absolute; top: 40px; left: 240px; right: 0px; height: 5000px;">
<iframe id="dataFrame" class="databg" style="position: relative; height: 5000px; width: 100%; border: 0px;" scrolling="no" frameborder="0"></iframe>
</div>
</div>
<script type="text/javascript">
dojo.require("dojox.xml.parser");
dojo.require("tuscany.RestService");
dojo.require("tuscany.Composite");
var composite;
function composite_getResponse(xmlResponse, exception) {
if(exception){
alert(exception.message);
return;
}
composite = tuscany.Composite(xmlResponse);
alert(composite.components())
/*
var itemTags = xmlResponse.getElementsByTagName ("component");
for (i = 0; i < itemTags.length; i++) {
var attributes = itemTags[i].attributes;
alert(attributes[0].name);
var recordNode = itemTags[i].getElementsByTagName ("name")[0];
if (recordNode.textContent != undefined) {
alert(recordNode.textContent);
}
else {
alert(recordNode.text);
}
}
*/
compositeXML = dojox.xml.parser.innerXML(xmlResponse);
alert(compositeXML);
}
var restClient = new tuscany.RestService("http://localhost:8080/domain","text/plain");
restClient.get("default").addCallback(composite_getResponse);
// Create editor graph area
var g = graph.mkgraph(graph.mkpath().move(0,40), 'Domain', 'propValue');
var bg = graph.mkgroup(graph.mkpath());
graph.edit(name, composite, graph.composite('domain', graph.mkpath().move(palcx,0)), oncomposchange, oncompselect, g);
//graph.composite('domain', graph.mkpath().move(palcx,0));
</script>
</body>
</html>
|