summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2011-09-19 22:55:55 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2011-09-19 22:55:55 +0000
commitdd4799a9809cd2ffaa2e9598a8c1408405e25202 (patch)
tree3389c495a9645b22f9d4ce174ca9a8849abcd689 /sca-java-2.x/trunk/modules
parent9bd25321d03e2577f115597742f4c2c48ddcd9cc (diff)
Add the support to generate the SCA diagram for a given node configuration
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1172882 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/output/CalculatorTest_diagram.svg1
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/output/Calculator_diagram.html22
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/output/Calculator_diagram.svg1
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/output/IdleTest_diagram.svg1
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/output/MyValueComposite2_diagram.html10
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/output/MyValueComposite2_diagram.svg1
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/output/store_diagram.html10
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/output/store_diagram.svg1
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/output/supplychain_diagram.html22
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/output/supplychain_diagram.svg1
-rw-r--r--sca-java-2.x/trunk/modules/composite-diagram/pom.xml133
-rw-r--r--sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/artifacts/Artifact.java36
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/generator/DiagramGenerator.java11
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/Entity.java7
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/EntityBuilder.java16
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/TuscanyCompositeEntityBuilder.java50
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/main/Main.java56
-rw-r--r--sca-java-2.x/trunk/modules/composite-diagram/src/main/resources/org/apache/tuscany/sca/diagram/artifacts/composite-diagram.css2
-rw-r--r--sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java21
-rw-r--r--sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorld.java37
-rw-r--r--sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorld2Impl.java39
-rw-r--r--sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorldImpl.java42
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/contribution/helloworld.composite34
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/Calculator.xml (renamed from sca-java-2.x/trunk/modules/composite-diagram/input/Calculator.xml)2
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/MyValueComposite2.xml (renamed from sca-java-2.x/trunk/modules/composite-diagram/input/MyValueComposite2.xml)0
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite.xml (renamed from sca-java-2.x/trunk/modules/composite-diagram/input/composite.xml)2
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite1.xml (renamed from sca-java-2.x/trunk/modules/composite-diagram/input/composite1.xml)2
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite2.xml (renamed from sca-java-2.x/trunk/modules/composite-diagram/input/composite2.xml)2
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite3.xml (renamed from sca-java-2.x/trunk/modules/composite-diagram/input/composite3.xml)2
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite_idle.xml (renamed from sca-java-2.x/trunk/modules/composite-diagram/input/composite_idle.xml)2
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite_with_compositeService.xml (renamed from sca-java-2.x/trunk/modules/composite-diagram/input/composite_with_compositeService.xml)0
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/store.xml (renamed from sca-java-2.x/trunk/modules/composite-diagram/input/store.xml)2
-rwxr-xr-xsca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/supplychain.xml (renamed from sca-java-2.x/trunk/modules/composite-diagram/input/supplychain.xml)2
33 files changed, 364 insertions, 206 deletions
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/output/CalculatorTest_diagram.svg b/sca-java-2.x/trunk/modules/composite-diagram/output/CalculatorTest_diagram.svg
deleted file mode 100755
index 76052e23f7..0000000000
--- a/sca-java-2.x/trunk/modules/composite-diagram/output/CalculatorTest_diagram.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" contentScriptType="text/ecmascript" zoomAndPan="magnify" contentStyleType="text/css" preserveAspectRatio="xMidYMid meet" version="1.0"><rect x="0" y="0" alignment-baseline="central" fill="#E5E5D0" width="1400" rx="20" ry="20" height="1340" stroke="#919191"/><rect x="200" y="100" alignment-baseline="central" fill="#E5E5E5" width="1000" rx="20" ry="20" height="1140" stroke="#919191"/><text x="700" font-size="20" y="120" dominant-baseline="mathematical">CalculatorTest</text><rect x="400" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="20" y="350" dominant-baseline="mathematical">CalculatorServiceComponent</text><polygon fill="#00CD66" points="380,210 410,210 425,225 410,240 380,240 395,225 " stroke="#008B45"/><text x="380" font-size="20" y="225" dominant-baseline="mathematical">CalculatorService</text><polygon fill="#BF3EFF" points="586,210 608,210 619,221 608,232 586,232 597,221 " stroke="#68228B"/><text x="586" font-size="20" y="221" dominant-baseline="mathematical">addService</text><polygon fill="#BF3EFF" points="586,242 608,242 619,253 608,264 586,264 597,253 " stroke="#68228B"/><text x="586" font-size="20" y="253" dominant-baseline="mathematical">subtractService</text><polygon fill="#BF3EFF" points="586,274 608,274 619,285 608,296 586,296 597,285 " stroke="#68228B"/><text x="586" font-size="20" y="285" dominant-baseline="mathematical">multiplyService</text><polygon fill="#BF3EFF" points="586,306 608,306 619,317 608,328 586,328 597,317 " stroke="#68228B"/><text x="586" font-size="20" y="317" dominant-baseline="mathematical">divideService</text><rect x="800" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="20" y="350" dominant-baseline="mathematical">AddServiceComponent</text><polygon fill="#00CD66" points="780,210 810,210 825,225 810,240 780,240 795,225 " stroke="#008B45"/><text x="780" font-size="20" y="225" dominant-baseline="mathematical">AddService</text><rect x="800" y="460" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="20" y="610" dominant-baseline="mathematical">SubtractServiceComponent</text><polygon fill="#00CD66" points="780,470 810,470 825,485 810,500 780,500 795,485 " stroke="#008B45"/><text x="780" font-size="20" y="485" dominant-baseline="mathematical">SubtractService</text><rect x="800" y="720" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="20" y="870" dominant-baseline="mathematical">MultiplyServiceComponent</text><polygon fill="#00CD66" points="780,730 810,730 825,745 810,760 780,760 795,745 " stroke="#008B45"/><text x="780" font-size="20" y="745" dominant-baseline="mathematical">MultiplyService</text><rect x="800" y="980" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="20" y="1130" dominant-baseline="mathematical">DivideServiceComponent</text><polygon fill="#00CD66" points="780,990 810,990 825,1005 810,1020 780,1020 795,1005 " stroke="#008B45"/><text x="780" font-size="20" y="1005" dominant-baseline="mathematical">DivideService</text><polyline fill="none" stroke-width="2" points="619,221 639,221 639,225 795,225" stroke="black"/><polyline fill="none" stroke-width="2" points="619,317 639,317 639,1005 795,1005" stroke="black"/><polyline fill="none" stroke-width="2" points="619,285 639,285 639,745 795,745" stroke="black"/><polyline fill="none" stroke-width="2" points="619,253 639,253 639,485 795,485" stroke="black"/></svg> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/output/Calculator_diagram.html b/sca-java-2.x/trunk/modules/composite-diagram/output/Calculator_diagram.html
deleted file mode 100755
index 9788bbce0a..0000000000
--- a/sca-java-2.x/trunk/modules/composite-diagram/output/Calculator_diagram.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<html>
-<head>
-<h1 align='center'>Apache Tuscany - Composite Diagram Generator</h1>
-<h2 align='center'>Calculator</h2>
-</br>
-<script type="text/javascript" src="/media/798D-18B1/GSoC-2011/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/resources/rgbcolor.js"></script>
-<script type="text/javascript" src="/media/798D-18B1/GSoC-2011/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/resources/canvg-1.0.js"></script>
-<script type="text/javascript">
-window.onload = function() {
-//load '../path/to/your.svg' in the canvas with id = 'canvas'
-canvg('canvas', 'Calculator_diagram.svg')
-//load a svg snippet in the canvas with id = 'drawingArea'
-canvg(document.getElementById('drawingArea'), '<svg>...</svg>')
-canvg('canvas', 'Calculator_diagram.svg', {})
-}
-</script>
-</head>
-<body>
-<canvas id="canvas" width="1400px" height="1340px">
-</canvas>
-</body>
-</html> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/output/Calculator_diagram.svg b/sca-java-2.x/trunk/modules/composite-diagram/output/Calculator_diagram.svg
deleted file mode 100755
index 7c7622b974..0000000000
--- a/sca-java-2.x/trunk/modules/composite-diagram/output/Calculator_diagram.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" contentScriptType="text/ecmascript" zoomAndPan="magnify" contentStyleType="text/css" viewBox="0 0 1400 1340" preserveAspectRatio="xMidYMid meet" version="1.0"><rect x="0" y="0" alignment-baseline="middle" fill="#E5E5D0" width="1400" rx="20" ry="20" height="1340" stroke="#919191"/><rect x="200" y="100" alignment-baseline="middle" fill="#E5E5E5" width="1000" rx="20" ry="20" height="1140" stroke="#919191"/><text x="220" font-size="15" y="120" dominant-baseline="mathematical">Calculator</text><rect x="400" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="350" dominant-baseline="mathematical">CalculatorServiceComponent</text><polygon fill="#00CD66" points="380,210 410,210 425,225 410,240 380,240 395,225 " stroke="#008B45"/><text x="380" font-size="15" y="209" dominant-baseline="mathematical">CalculatorService</text><polygon fill="#BF3EFF" points="586,210 608,210 619,221 608,232 586,232 597,221 " stroke="#68228B"/><text x="586" font-size="15" y="209" dominant-baseline="mathematical">addService</text><polygon fill="#BF3EFF" points="586,242 608,242 619,253 608,264 586,264 597,253 " stroke="#68228B"/><text x="586" font-size="15" y="241" dominant-baseline="mathematical">subtractService</text><polygon fill="#BF3EFF" points="586,274 608,274 619,285 608,296 586,296 597,285 " stroke="#68228B"/><text x="586" font-size="15" y="273" dominant-baseline="mathematical">multiplyService</text><polygon fill="#BF3EFF" points="586,306 608,306 619,317 608,328 586,328 597,317 " stroke="#68228B"/><text x="586" font-size="15" y="305" dominant-baseline="mathematical">divideService</text><rect x="800" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="350" dominant-baseline="mathematical">AddServiceComponent</text><polygon fill="#00CD66" points="780,210 810,210 825,225 810,240 780,240 795,225 " stroke="#008B45"/><text x="780" font-size="15" y="209" dominant-baseline="mathematical">AddService</text><rect x="800" y="460" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="610" dominant-baseline="mathematical">SubtractServiceComponent</text><polygon fill="#00CD66" points="780,470 810,470 825,485 810,500 780,500 795,485 " stroke="#008B45"/><text x="780" font-size="15" y="469" dominant-baseline="mathematical">SubtractService</text><rect x="800" y="720" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="870" dominant-baseline="mathematical">MultiplyServiceComponent</text><polygon fill="#00CD66" points="780,730 810,730 825,745 810,760 780,760 795,745 " stroke="#008B45"/><text x="780" font-size="15" y="729" dominant-baseline="mathematical">MultiplyService</text><rect x="800" y="980" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="1130" dominant-baseline="mathematical">DivideServiceComponent</text><polygon fill="#00CD66" points="780,990 810,990 825,1005 810,1020 780,1020 795,1005 " stroke="#008B45"/><text x="780" font-size="15" y="989" dominant-baseline="mathematical">DivideService</text><rect x="400" y="460" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="610" dominant-baseline="mathematical">StockQuoteMediatorComponent</text><rect fill="#EEEE00" x="420" width="20" height="20" y="450" stroke="#EEC900"/><text x="420" font-size="15" y="449" dominant-baseline="mathematical">currency</text><polygon fill="#00CD66" points="380,470 410,470 425,485 410,500 380,500 395,485 " stroke="#008B45"/><text x="380" font-size="15" y="469" dominant-baseline="mathematical">SQMediator</text><polygon fill="#BF3EFF" points="580,470 610,470 625,485 610,500 580,500 595,485 " stroke="#68228B"/><text x="580" font-size="15" y="469" dominant-baseline="mathematical">stockQuoteService</text><polyline fill="none" stroke-width="2" points="619,221 639,221 639,225 795,225" stroke="black"/><polyline fill="none" stroke-width="2" points="619,317 644,317 644,1005 795,1005" stroke="black"/><polyline fill="none" stroke-width="2" points="619,285 649,285 649,745 795,745" stroke="black"/><polyline fill="none" stroke-width="2" points="619,253 654,253 654,485 795,485" stroke="black"/></svg> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/output/IdleTest_diagram.svg b/sca-java-2.x/trunk/modules/composite-diagram/output/IdleTest_diagram.svg
deleted file mode 100755
index a18d9c11a2..0000000000
--- a/sca-java-2.x/trunk/modules/composite-diagram/output/IdleTest_diagram.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" contentScriptType="text/ecmascript" zoomAndPan="magnify" contentStyleType="text/css" preserveAspectRatio="xMidYMid meet" version="1.0"><rect x="0" y="0" alignment-baseline="middle" fill="#E5E5D0" width="1000" rx="20" ry="20" height="560" stroke="#919191"/><rect x="200" y="100" alignment-baseline="middle" fill="#E5E5E5" width="600" rx="20" ry="20" height="360" stroke="#919191"/><text x="500" font-size="15" y="120" dominant-baseline="mathematical">IdleTest</text><rect x="400" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="350" dominant-baseline="mathematical">AddServiceComponent</text><polygon fill="#00CD66" points="380,210 410,210 425,225 410,240 380,240 395,225 " stroke="#008B45"/><text x="380" font-size="15" y="209" dominant-baseline="mathematical">AddService</text></svg> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/output/MyValueComposite2_diagram.html b/sca-java-2.x/trunk/modules/composite-diagram/output/MyValueComposite2_diagram.html
deleted file mode 100755
index 0c91f6ae0a..0000000000
--- a/sca-java-2.x/trunk/modules/composite-diagram/output/MyValueComposite2_diagram.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<h1 align='center'>Apache Tuscany - Composite Diagram Generator</h1>
-<h2 align='center'>MyValueComposite2</h2>
-</br>
-</head>
-<body>
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" contentScriptType="text/ecmascript" zoomAndPan="magnify" contentStyleType="text/css" viewBox="0 0 1400 1080" preserveAspectRatio="xMidYMid meet" version="1.0"><rect x="0" y="0" alignment-baseline="middle" fill="#E5E5D0" width="1400" rx="20" ry="20" height="1080" stroke="#919191"/><rect x="200" y="100" alignment-baseline="middle" fill="#E5E5E5" width="1000" rx="20" ry="20" height="880" stroke="#919191"/><text x="220" font-size="15" y="120" dominant-baseline="mathematical">MyValueComposite2</text><rect x="400" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="350" dominant-baseline="mathematical">MyValueServiceComponent</text><rect fill="#EEEE00" x="420" width="20" height="20" y="190" stroke="#EEC900"/><text x="420" font-size="15" y="189" dominant-baseline="mathematical">currency</text><polygon fill="#00CD66" points="380,210 410,210 425,225 410,240 380,240 395,225 " stroke="#008B45"/><text x="380" font-size="15" y="209" dominant-baseline="mathematical">myValueService</text><polygon fill="#BF3EFF" points="580,210 610,210 625,225 610,240 580,240 595,225 " stroke="#68228B"/><text x="580" font-size="15" y="209" dominant-baseline="mathematical">stockQuoteService</text><polygon fill="#BF3EFF" points="580,250 610,250 625,265 610,280 580,280 595,265 " stroke="#68228B"/><text x="580" font-size="15" y="249" dominant-baseline="mathematical">customerService</text><rect x="800" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="350" dominant-baseline="mathematical">StockQuoteMediatorComponent</text><rect fill="#EEEE00" x="820" width="20" height="20" y="190" stroke="#EEC900"/><text x="820" font-size="15" y="189" dominant-baseline="mathematical">currency</text><polygon fill="#00CD66" points="780,210 810,210 825,225 810,240 780,240 795,225 " stroke="#008B45"/><text x="780" font-size="15" y="209" dominant-baseline="mathematical">SQMediator</text><polygon fill="#BF3EFF" points="980,210 1010,210 1025,225 1010,240 980,240 995,225 " stroke="#68228B"/><text x="980" font-size="15" y="209" dominant-baseline="mathematical">stockQuoteService</text><rect x="400" y="460" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="610" dominant-baseline="mathematical">SubtractServiceComponent</text><polygon fill="#00CD66" points="380,470 410,470 425,485 410,500 380,500 395,485 " stroke="#008B45"/><text x="380" font-size="15" y="469" dominant-baseline="mathematical">SubtractService</text><rect x="400" y="720" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="870" dominant-baseline="mathematical">MultiplyServiceComponent</text><polygon fill="#00CD66" points="380,730 410,730 425,745 410,760 380,760 395,745 " stroke="#008B45"/><text x="380" font-size="15" y="729" dominant-baseline="mathematical">MultiplyService</text><rect fill="#EEEE00" x="670" width="60" height="60" y="70" stroke="#EEC900"/><text x="670" font-size="15" y="69" dominant-baseline="mathematical">currency</text><polygon fill="#00CD66" points="140,495 230,495 275,540 230,585 140,585 185,540 " stroke="#008B45"/><text x="140" font-size="15" y="494" dominant-baseline="mathematical">MyValueService</text><polygon fill="#BF3EFF" points="1140,425 1230,425 1275,470 1230,515 1140,515 1185,470 " stroke="#68228B"/><text x="1140" font-size="15" y="424" dominant-baseline="mathematical">CustomerService</text><polygon fill="#BF3EFF" points="1140,565 1230,565 1275,610 1230,655 1140,655 1185,610 " stroke="#68228B"/><text x="1140" font-size="15" y="564" dominant-baseline="mathematical">StockQuoteService</text><polyline fill="none" stroke-width="2" points="625,225 795,225" stroke="black"/><polyline fill="none" stroke-dasharray="3 3" stroke-width="2" points="1025,225 1050,225 1050,610 1185,610" stroke="black"/><polyline fill="none" stroke-dasharray="3 3" stroke-width="2" points="625,265 655,265 655,470 1185,470" stroke="black"/><polyline fill="none" stroke-dasharray="3 3" stroke-width="2" points="1025,225 1060,225 1060,470 1185,470" stroke="black"/><polyline fill="none" stroke-dasharray="3 3" stroke-width="2" points="275,540 315,540 315,225 395,225" stroke="black"/><rect x="205" y="910" alignment-baseline="middle" fill="#E5E5C0" width="990" rx="20" ry="20" height="65" stroke="#919191"/><text x="210" font-size="15" y="920" dominant-baseline="mathematical">Included Composites</text><text x="210" font-size="15" y="945" dominant-baseline="mathematical"><a xlink:href="store_diagram.svg" xlink:actuate="onRequest" xlink:type="simple" xlink:show="new" xmlns:xlink="http://www.w3.org/1999/xlink"> store ,</a><a xlink:href="Calculator_diagram.svg" xlink:actuate="onRequest" xlink:type="simple" xlink:show="new" xmlns:xlink="http://www.w3.org/1999/xlink"> Calculator ,</a><a xlink:href="supplychain_diagram.svg" xlink:actuate="onRequest" xlink:type="simple" xlink:show="new" xmlns:xlink="http://www.w3.org/1999/xlink"> supplychain ,</a></text></svg>
-</body>
-</html> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/output/MyValueComposite2_diagram.svg b/sca-java-2.x/trunk/modules/composite-diagram/output/MyValueComposite2_diagram.svg
deleted file mode 100755
index f731eb05aa..0000000000
--- a/sca-java-2.x/trunk/modules/composite-diagram/output/MyValueComposite2_diagram.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" contentScriptType="text/ecmascript" zoomAndPan="magnify" contentStyleType="text/css" viewBox="0 0 1400 1080" preserveAspectRatio="xMidYMid meet" version="1.0"><rect x="0" y="0" alignment-baseline="middle" fill="#E5E5D0" width="1400" rx="20" ry="20" height="1080" stroke="#919191"/><rect x="200" y="100" alignment-baseline="middle" fill="#E5E5E5" width="1000" rx="20" ry="20" height="880" stroke="#919191"/><text x="220" font-size="15" y="120" dominant-baseline="mathematical">MyValueComposite2</text><rect x="400" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="350" dominant-baseline="mathematical">MyValueServiceComponent</text><rect fill="#EEEE00" x="420" width="20" height="20" y="190" stroke="#EEC900"/><text x="420" font-size="15" y="189" dominant-baseline="mathematical">currency</text><polygon fill="#00CD66" points="380,210 410,210 425,225 410,240 380,240 395,225 " stroke="#008B45"/><text x="380" font-size="15" y="209" dominant-baseline="mathematical">myValueService</text><polygon fill="#BF3EFF" points="580,210 610,210 625,225 610,240 580,240 595,225 " stroke="#68228B"/><text x="580" font-size="15" y="209" dominant-baseline="mathematical">stockQuoteService</text><polygon fill="#BF3EFF" points="580,250 610,250 625,265 610,280 580,280 595,265 " stroke="#68228B"/><text x="580" font-size="15" y="249" dominant-baseline="mathematical">customerService</text><rect x="800" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="350" dominant-baseline="mathematical">StockQuoteMediatorComponent</text><rect fill="#EEEE00" x="820" width="20" height="20" y="190" stroke="#EEC900"/><text x="820" font-size="15" y="189" dominant-baseline="mathematical">currency</text><polygon fill="#00CD66" points="780,210 810,210 825,225 810,240 780,240 795,225 " stroke="#008B45"/><text x="780" font-size="15" y="209" dominant-baseline="mathematical">SQMediator</text><polygon fill="#BF3EFF" points="980,210 1010,210 1025,225 1010,240 980,240 995,225 " stroke="#68228B"/><text x="980" font-size="15" y="209" dominant-baseline="mathematical">stockQuoteService</text><rect x="400" y="460" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="610" dominant-baseline="mathematical">SubtractServiceComponent</text><polygon fill="#00CD66" points="380,470 410,470 425,485 410,500 380,500 395,485 " stroke="#008B45"/><text x="380" font-size="15" y="469" dominant-baseline="mathematical">SubtractService</text><rect x="400" y="720" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="870" dominant-baseline="mathematical">MultiplyServiceComponent</text><polygon fill="#00CD66" points="380,730 410,730 425,745 410,760 380,760 395,745 " stroke="#008B45"/><text x="380" font-size="15" y="729" dominant-baseline="mathematical">MultiplyService</text><rect fill="#EEEE00" x="670" width="60" height="60" y="70" stroke="#EEC900"/><text x="670" font-size="15" y="69" dominant-baseline="mathematical">currency</text><polygon fill="#00CD66" points="140,495 230,495 275,540 230,585 140,585 185,540 " stroke="#008B45"/><text x="140" font-size="15" y="494" dominant-baseline="mathematical">MyValueService</text><polygon fill="#BF3EFF" points="1140,425 1230,425 1275,470 1230,515 1140,515 1185,470 " stroke="#68228B"/><text x="1140" font-size="15" y="424" dominant-baseline="mathematical">CustomerService</text><polygon fill="#BF3EFF" points="1140,565 1230,565 1275,610 1230,655 1140,655 1185,610 " stroke="#68228B"/><text x="1140" font-size="15" y="564" dominant-baseline="mathematical">StockQuoteService</text><polyline fill="none" stroke-width="2" points="625,225 795,225" stroke="black"/><polyline fill="none" stroke-dasharray="3 3" stroke-width="2" points="1025,225 1050,225 1050,610 1185,610" stroke="black"/><polyline fill="none" stroke-dasharray="3 3" stroke-width="2" points="625,265 655,265 655,470 1185,470" stroke="black"/><polyline fill="none" stroke-dasharray="3 3" stroke-width="2" points="1025,225 1060,225 1060,470 1185,470" stroke="black"/><polyline fill="none" stroke-dasharray="3 3" stroke-width="2" points="275,540 315,540 315,225 395,225" stroke="black"/><rect x="205" y="910" alignment-baseline="middle" fill="#E5E5C0" width="990" rx="20" ry="20" height="65" stroke="#919191"/><text x="210" font-size="15" y="920" dominant-baseline="mathematical">Included Composites</text><text x="210" font-size="15" y="945" dominant-baseline="mathematical"><a xlink:href="store_diagram.svg" xlink:actuate="onRequest" xlink:type="simple" xlink:show="new" xmlns:xlink="http://www.w3.org/1999/xlink"> store ,</a><a xlink:href="Calculator_diagram.svg" xlink:actuate="onRequest" xlink:type="simple" xlink:show="new" xmlns:xlink="http://www.w3.org/1999/xlink"> Calculator ,</a><a xlink:href="supplychain_diagram.svg" xlink:actuate="onRequest" xlink:type="simple" xlink:show="new" xmlns:xlink="http://www.w3.org/1999/xlink"> supplychain ,</a></text></svg> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/output/store_diagram.html b/sca-java-2.x/trunk/modules/composite-diagram/output/store_diagram.html
deleted file mode 100755
index 9be38f99ad..0000000000
--- a/sca-java-2.x/trunk/modules/composite-diagram/output/store_diagram.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<h1 align='center'>Apache Tuscany - Composite Diagram Generator</h1>
-<h2 align='center'>store</h2>
-</br>
-</head>
-<body>
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" contentScriptType="text/ecmascript" zoomAndPan="magnify" contentStyleType="text/css" viewBox="0 0 1800 820" preserveAspectRatio="xMidYMid meet" version="1.0"><rect x="0" y="0" alignment-baseline="middle" fill="#E5E5D0" width="1800" rx="20" ry="20" height="820" stroke="#919191"/><rect x="200" y="100" alignment-baseline="middle" fill="#E5E5E5" width="1400" rx="20" ry="20" height="620" stroke="#919191"/><text x="220" font-size="15" y="120" dominant-baseline="mathematical">store</text><rect x="400" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="350" dominant-baseline="mathematical">Store</text><polygon fill="#00CD66" points="380,210 410,210 425,225 410,240 380,240 395,225 " stroke="#008B45"/><text x="380" font-size="15" y="209" dominant-baseline="mathematical">Widget</text><polygon fill="#BF3EFF" points="580,210 610,210 625,225 610,240 580,240 595,225 " stroke="#68228B"/><text x="580" font-size="15" y="209" dominant-baseline="mathematical">catalog</text><polygon fill="#BF3EFF" points="580,250 610,250 625,265 610,280 580,280 595,265 " stroke="#68228B"/><text x="580" font-size="15" y="249" dominant-baseline="mathematical">shoppingCart</text><polygon fill="#BF3EFF" points="580,290 610,290 625,305 610,320 580,320 595,305 " stroke="#68228B"/><text x="580" font-size="15" y="289" dominant-baseline="mathematical">shoppingTotal</text><rect x="800" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="350" dominant-baseline="mathematical">Catalog</text><rect fill="#EEEE00" x="820" width="20" height="20" y="190" stroke="#EEC900"/><text x="820" font-size="15" y="189" dominant-baseline="mathematical">currencyCode</text><polygon fill="#00CD66" points="780,210 810,210 825,225 810,240 780,240 795,225 " stroke="#008B45"/><text x="780" font-size="15" y="209" dominant-baseline="mathematical">Catalog</text><polygon fill="#BF3EFF" points="980,210 1010,210 1025,225 1010,240 980,240 995,225 " stroke="#68228B"/><text x="980" font-size="15" y="209" dominant-baseline="mathematical">currencyConverter</text><rect x="800" y="460" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="610" dominant-baseline="mathematical">ShoppingCart</text><polygon fill="#00CD66" points="780,470 810,470 825,485 810,500 780,500 795,485 " stroke="#008B45"/><text x="780" font-size="15" y="469" dominant-baseline="mathematical">Cart</text><polygon fill="#00CD66" points="780,510 810,510 825,525 810,540 780,540 795,525 " stroke="#008B45"/><text x="780" font-size="15" y="509" dominant-baseline="mathematical">Total</text><rect x="1200" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="1200" font-size="15" y="350" dominant-baseline="mathematical">CurrencyConverter</text><polygon fill="#00CD66" points="1180,210 1210,210 1225,225 1210,240 1180,240 1195,225 " stroke="#008B45"/><text x="1180" font-size="15" y="209" dominant-baseline="mathematical">CurrencyConverter</text><polyline fill="none" stroke-width="2" points="625,305 645,305 645,525 795,525" stroke="black"/><polyline fill="none" stroke-width="2" points="625,265 650,265 650,485 795,485" stroke="black"/><polyline fill="none" stroke-width="2" points="625,225 795,225" stroke="black"/><polyline fill="none" stroke-width="2" points="1025,225 1195,225" stroke="black"/></svg>
-</body>
-</html> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/output/store_diagram.svg b/sca-java-2.x/trunk/modules/composite-diagram/output/store_diagram.svg
deleted file mode 100755
index 2bce7c1173..0000000000
--- a/sca-java-2.x/trunk/modules/composite-diagram/output/store_diagram.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" contentScriptType="text/ecmascript" zoomAndPan="magnify" contentStyleType="text/css" viewBox="0 0 1800 820" preserveAspectRatio="xMidYMid meet" version="1.0"><rect x="0" y="0" alignment-baseline="middle" fill="#E5E5D0" width="1800" rx="20" ry="20" height="820" stroke="#919191"/><rect x="200" y="100" alignment-baseline="middle" fill="#E5E5E5" width="1400" rx="20" ry="20" height="620" stroke="#919191"/><text x="220" font-size="15" y="120" dominant-baseline="mathematical">store</text><rect x="400" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="350" dominant-baseline="mathematical">Store</text><polygon fill="#00CD66" points="380,210 410,210 425,225 410,240 380,240 395,225 " stroke="#008B45"/><text x="380" font-size="15" y="209" dominant-baseline="mathematical">Widget</text><polygon fill="#BF3EFF" points="580,210 610,210 625,225 610,240 580,240 595,225 " stroke="#68228B"/><text x="580" font-size="15" y="209" dominant-baseline="mathematical">catalog</text><polygon fill="#BF3EFF" points="580,250 610,250 625,265 610,280 580,280 595,265 " stroke="#68228B"/><text x="580" font-size="15" y="249" dominant-baseline="mathematical">shoppingCart</text><polygon fill="#BF3EFF" points="580,290 610,290 625,305 610,320 580,320 595,305 " stroke="#68228B"/><text x="580" font-size="15" y="289" dominant-baseline="mathematical">shoppingTotal</text><rect x="800" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="350" dominant-baseline="mathematical">Catalog</text><rect fill="#EEEE00" x="820" width="20" height="20" y="190" stroke="#EEC900"/><text x="820" font-size="15" y="189" dominant-baseline="mathematical">currencyCode</text><polygon fill="#00CD66" points="780,210 810,210 825,225 810,240 780,240 795,225 " stroke="#008B45"/><text x="780" font-size="15" y="209" dominant-baseline="mathematical">Catalog</text><polygon fill="#BF3EFF" points="980,210 1010,210 1025,225 1010,240 980,240 995,225 " stroke="#68228B"/><text x="980" font-size="15" y="209" dominant-baseline="mathematical">currencyConverter</text><rect x="800" y="460" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="610" dominant-baseline="mathematical">ShoppingCart</text><polygon fill="#00CD66" points="780,470 810,470 825,485 810,500 780,500 795,485 " stroke="#008B45"/><text x="780" font-size="15" y="469" dominant-baseline="mathematical">Cart</text><polygon fill="#00CD66" points="780,510 810,510 825,525 810,540 780,540 795,525 " stroke="#008B45"/><text x="780" font-size="15" y="509" dominant-baseline="mathematical">Total</text><rect x="1200" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="1200" font-size="15" y="350" dominant-baseline="mathematical">CurrencyConverter</text><polygon fill="#00CD66" points="1180,210 1210,210 1225,225 1210,240 1180,240 1195,225 " stroke="#008B45"/><text x="1180" font-size="15" y="209" dominant-baseline="mathematical">CurrencyConverter</text><polyline fill="none" stroke-width="2" points="625,305 645,305 645,525 795,525" stroke="black"/><polyline fill="none" stroke-width="2" points="625,265 650,265 650,485 795,485" stroke="black"/><polyline fill="none" stroke-width="2" points="625,225 795,225" stroke="black"/><polyline fill="none" stroke-width="2" points="1025,225 1195,225" stroke="black"/></svg> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/output/supplychain_diagram.html b/sca-java-2.x/trunk/modules/composite-diagram/output/supplychain_diagram.html
deleted file mode 100755
index 227ebd720b..0000000000
--- a/sca-java-2.x/trunk/modules/composite-diagram/output/supplychain_diagram.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<html>
-<head>
-<h1 align='center'>Apache Tuscany - Composite Diagram Generator</h1>
-<h2 align='center'>supplychain</h2>
-</br>
-<script type="text/javascript" src="/media/798D-18B1/GSoC-2011/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/resources/rgbcolor.js"></script>
-<script type="text/javascript" src="/media/798D-18B1/GSoC-2011/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/resources/canvg-1.0.js"></script>
-<script type="text/javascript">
-window.onload = function() {
-//load '../path/to/your.svg' in the canvas with id = 'canvas'
-canvg('canvas', 'supplychain_diagram.svg')
-//load a svg snippet in the canvas with id = 'drawingArea'
-canvg(document.getElementById('drawingArea'), '<svg>...</svg>')
-canvg('canvas', 'supplychain_diagram.svg', {})
-}
-</script>
-</head>
-<body>
-<canvas id="canvas" width="2200px" height="560px">
-</canvas>
-</body>
-</html> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/output/supplychain_diagram.svg b/sca-java-2.x/trunk/modules/composite-diagram/output/supplychain_diagram.svg
deleted file mode 100755
index 466028c02e..0000000000
--- a/sca-java-2.x/trunk/modules/composite-diagram/output/supplychain_diagram.svg
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" contentScriptType="text/ecmascript" zoomAndPan="magnify" contentStyleType="text/css" viewBox="0 0 2200 560" preserveAspectRatio="xMidYMid meet" version="1.0"><rect x="0" y="0" alignment-baseline="middle" fill="#E5E5D0" width="2200" rx="20" ry="20" height="560" stroke="#919191"/><rect x="200" y="100" alignment-baseline="middle" fill="#E5E5E5" width="1800" rx="20" ry="20" height="360" stroke="#919191"/><text x="220" font-size="15" y="120" dominant-baseline="mathematical">supplychain</text><rect x="400" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="400" font-size="15" y="350" dominant-baseline="mathematical">CustomerComponent</text><polygon fill="#00CD66" points="380,210 410,210 425,225 410,240 380,240 395,225 " stroke="#008B45"/><text x="380" font-size="15" y="209" dominant-baseline="mathematical">CustomerComponent</text><polygon fill="#BF3EFF" points="580,210 610,210 625,225 610,240 580,240 595,225 " stroke="#68228B"/><text x="580" font-size="15" y="209" dominant-baseline="mathematical">retailer</text><rect x="800" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="800" font-size="15" y="350" dominant-baseline="mathematical">RetailerComponent</text><polygon fill="#00CD66" points="780,210 810,210 825,225 810,240 780,240 795,225 " stroke="#008B45"/><text x="780" font-size="15" y="209" dominant-baseline="mathematical">RetailerComponent</text><polygon fill="#BF3EFF" points="980,210 1010,210 1025,225 1010,240 980,240 995,225 " stroke="#68228B"/><text x="980" font-size="15" y="209" dominant-baseline="mathematical">warehouse</text><rect x="1200" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="1200" font-size="15" y="350" dominant-baseline="mathematical">WarehouseComponent</text><polygon fill="#00CD66" points="1180,210 1210,210 1225,225 1210,240 1180,240 1195,225 " stroke="#008B45"/><text x="1180" font-size="15" y="209" dominant-baseline="mathematical">WarehouseComponent</text><polygon fill="#BF3EFF" points="1380,210 1410,210 1425,225 1410,240 1380,240 1395,225 " stroke="#68228B"/><text x="1380" font-size="15" y="209" dominant-baseline="mathematical">shipper</text><rect x="1600" y="200" fill-opacity="0.75" fill="#3D59AB" width="200" rx="20" ry="20" height="130" stroke="#104E8B"/><text x="1600" font-size="15" y="350" dominant-baseline="mathematical">ShipperComponent</text><polygon fill="#00CD66" points="1580,210 1610,210 1625,225 1610,240 1580,240 1595,225 " stroke="#008B45"/><text x="1580" font-size="15" y="209" dominant-baseline="mathematical">ShipperComponent</text><polygon fill="#BF3EFF" points="1780,210 1810,210 1825,225 1810,240 1780,240 1795,225 " stroke="#68228B"/><text x="1780" font-size="15" y="209" dominant-baseline="mathematical">customer</text><polyline fill="none" stroke-width="2" points="625,225 795,225" stroke="black"/><polyline fill="none" stroke-width="2" points="1025,225 1195,225" stroke="black"/><polyline fill="none" stroke-width="2" points="1425,225 1595,225" stroke="black"/><polyline fill="none" stroke-width="2" points="1825,225 1860,225 1860,155 360,155 360,225 395,225" stroke="black"/></svg> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/pom.xml b/sca-java-2.x/trunk/modules/composite-diagram/pom.xml
index ee360ddfb1..f3071860ca 100644
--- a/sca-java-2.x/trunk/modules/composite-diagram/pom.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/pom.xml
@@ -1,22 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License. <groupId>org.apache.tuscany.sca</groupId>
--->
+<!-- * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE
+ file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the
+ License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable
+ law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES
+ OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions
+ and limitations * under the License. <groupId>org.apache.tuscany.sca</groupId> -->
<project>
<modelVersion>4.0.0</modelVersion>
@@ -38,138 +27,98 @@
<artifactId>commons-cli</artifactId>
<version>1.2</version>
</dependency>
-
- <!--
- <dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-anim</artifactId>
- <version>1.7</version>
- </dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-awt-util</artifactId>
+ <artifactId>batik-dom</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-css</artifactId>
+ <artifactId>batik-parser</artifactId>
<version>1.7</version>
</dependency>
-
+
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-ext</artifactId>
+ <artifactId>batik-svg-dom</artifactId>
<version>1.7</version>
</dependency>
- -->
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-dom</artifactId>
+ <artifactId>batik-transcoder</artifactId>
<version>1.7</version>
+ <scope>compile</scope>
</dependency>
-
-
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-parser</artifactId>
+ <artifactId>batik-codec</artifactId>
<version>1.7</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-svg-dom</artifactId>
- <version>1.7</version>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis-ext</artifactId>
+ <version>1.3.04</version>
</dependency>
<dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-svggen</artifactId>
- <version>1.7</version>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.1</version>
+ <scope>test</scope>
</dependency>
<dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-util</artifactId>
- <version>1.7</version>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly</artifactId>
+ <version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-xml</artifactId>
- <version>1.7</version>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-deployment</artifactId>
+ <version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>org.apache.xmlgraphics</groupId>
- <artifactId>batik-codec</artifactId>
- <version>1.7</version>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-node-api</artifactId>
+ <version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis-ext</artifactId>
- <version>1.3.04</version>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-assembly-xml</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.5</version>
- <scope>test</scope>
+ <groupId>org.apache.tuscany.sca</groupId>
+ <artifactId>tuscany-implementation-java-runtime</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-assembly</artifactId>
+ <artifactId>tuscany-node-impl</artifactId>
<version>2.0-SNAPSHOT</version>
+ <scope>runtime</scope>
</dependency>
</dependencies>
<build>
- <defaultGoal>install</defaultGoal>
- <directory>${basedir}/target</directory>
- <finalName>${project.artifactId}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
-
-<!--
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.1</version>
- <executions>
- <execution>
- <id>${project.artifactId}-fetch-deps</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>unpack-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.outputDirectory}</outputDirectory>
- <stripVersion>true</stripVersion>
- <excludeTransitive>true</excludeTransitive>
- <excludeArtifactIds>junit</excludeArtifactIds>
- </configuration>
- </execution>
- </executions>
- </plugin>
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/artifacts/Artifact.java b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/artifacts/Artifact.java
index 0a16a797c2..4751cff023 100644
--- a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/artifacts/Artifact.java
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/artifacts/Artifact.java
@@ -117,4 +117,40 @@ public abstract class Artifact {
return containerName;
}
+ /**
+ * Parse the component/service|reference/binding names
+ * @param compoundName
+ * @return An array of names
+ */
+ public static String[] parseNames(String compoundName) {
+ String[] names = new String[] {"", "", ""};
+ if (compoundName != null) {
+ String[] parts = compoundName.split("/");
+ for (int i = 0; i < parts.length; i++) {
+ names[i] = parts[i];
+ }
+ }
+ return names;
+ }
+
+ public static boolean matches(String compoundName, String... parts) {
+ String names[] = parseNames(compoundName);
+ if (parts.length > names.length) {
+ return false;
+ }
+ for (int i = 0; i < parts.length; i++) {
+ if (parts[i].length() > 0 && names[i].length() > 0 && !names[i].equals(parts[i])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Artifact [containerName=").append(containerName).append(", name=").append(name).append("]");
+ return builder.toString();
+ }
+
}
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/generator/DiagramGenerator.java b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/generator/DiagramGenerator.java
index b7ff1b47e7..9b72d7d25a 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/generator/DiagramGenerator.java
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/generator/DiagramGenerator.java
@@ -24,6 +24,7 @@ import java.util.Iterator;
import java.util.Map.Entry;
import org.apache.batik.dom.svg.SVGDOMImplementation;
+import org.apache.tuscany.sca.diagram.artifacts.Artifact;
import org.apache.tuscany.sca.diagram.artifacts.ComponentArtifact;
import org.apache.tuscany.sca.diagram.artifacts.CompositeArtifact;
import org.apache.tuscany.sca.diagram.artifacts.Constant;
@@ -154,7 +155,7 @@ public class DiagramGenerator {
String compositeRef = entry.getKey();
ArrayList<String> componentRef = entry.getValue();
- ReferenceArtifact r1 = getRef(compositeRef);
+ ReferenceArtifact r1 = getRef(comp.getName() + "/" + compositeRef);
for (String ref : componentRef) {
@@ -175,7 +176,7 @@ public class DiagramGenerator {
String compositeSer = entry.getKey();
String componentSer = entry.getValue();
- ServiceArtifact s1 = getSer(compositeSer);
+ ServiceArtifact s1 = getSer(comp.getName() + "/" + compositeSer);
ServiceArtifact s2 = getSer(componentSer);
if (s1 != null && s2 != null) {
@@ -238,7 +239,7 @@ public class DiagramGenerator {
String ref = entry.getKey();
String ser = entry.getValue();
- ReferenceArtifact r = getRef(ref);
+ ReferenceArtifact r = getRef(ent.getName() + "/" + ref);
ServiceArtifact s = getSer(ser);
if (r != null && s != null) {
@@ -292,7 +293,7 @@ public class DiagramGenerator {
private ServiceArtifact getSer(String ser) {
for (ServiceArtifact s : sers) {
- if (s.getContainerName().equals(ser) || s.getName().equals(ser)) {
+ if (Artifact.matches(ser, s.getContainerName(), s.getName())) {
return s;
}
}
@@ -303,7 +304,7 @@ public class DiagramGenerator {
for (ReferenceArtifact r : refs) {
- if (r.getContainerName().equals(ref) || r.getName().equals(ref)) {
+ if (Artifact.matches(ref, r.getContainerName(), r.getName())) {
return r;
}
}
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/Entity.java b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/Entity.java
index 1736cbf3b7..469c59cf4f 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/Entity.java
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/Entity.java
@@ -284,5 +284,12 @@ public abstract class Entity {
this.implementation = implementation;
}
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("Entity [id=").append(id).append(", name=").append(name).append("]");
+ return builder.toString();
+ }
+
}
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/EntityBuilder.java b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/EntityBuilder.java
index 70171e484c..64ac2db409 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/EntityBuilder.java
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/EntityBuilder.java
@@ -121,7 +121,7 @@ public class EntityBuilder {
if (service == null) {
composite.addToPromoteAService(compositeSer, serviceComp);
} else {
- composite.addToPromoteAService(compositeSer, service);
+ composite.addToPromoteAService(compositeSer, serviceComp + "/" + service);
}
}
@@ -157,7 +157,7 @@ public class EntityBuilder {
if (reference == null) {
composite.addToPromoteAReference(compositeRef, referenceComp);
} else {
- composite.addToPromoteAReference(compositeRef, reference);
+ composite.addToPromoteAReference(compositeRef, referenceComp + "/" + reference);
}
}
@@ -504,12 +504,12 @@ public class EntityBuilder {
if (reference != null && service != null) {
- ent.addToRefToSerMap(reference, service);
+ ent.addToRefToSerMap(reference, serviceComp + "/" + service);
ent.addAnAdjacentEntity(serviceComp);
addToConnectedEntities(referenceComp, serviceComp);
addToConnectedEntities(serviceComp, referenceComp);
} else if (reference == null && service != null) {
- ent.addToRefToSerMap(referenceComp, service);
+ ent.addToRefToSerMap(referenceComp, serviceComp + "/" + service);
ent.addAnAdjacentEntity(serviceComp);
addToConnectedEntities(referenceComp, serviceComp);
addToConnectedEntities(serviceComp, referenceComp);
@@ -708,13 +708,13 @@ public class EntityBuilder {
}
}
}
-
- private String extractClassName(String classAttr){
- if(classAttr==null) {
+
+ private String extractClassName(String classAttr) {
+ if (classAttr == null) {
return "";
} else {
int index = classAttr.lastIndexOf('.');
- return classAttr.substring(index+1);
+ return classAttr.substring(index + 1);
}
}
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/TuscanyCompositeEntityBuilder.java b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/TuscanyCompositeEntityBuilder.java
index 1a9b59e486..82a8e2a32a 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/TuscanyCompositeEntityBuilder.java
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/layout/TuscanyCompositeEntityBuilder.java
@@ -30,10 +30,13 @@ import org.apache.tuscany.sca.assembly.ComponentService;
import org.apache.tuscany.sca.assembly.Composite;
import org.apache.tuscany.sca.assembly.CompositeReference;
import org.apache.tuscany.sca.assembly.CompositeService;
+import org.apache.tuscany.sca.assembly.Endpoint;
+import org.apache.tuscany.sca.assembly.EndpointReference;
import org.apache.tuscany.sca.assembly.Property;
import org.apache.tuscany.sca.assembly.Reference;
import org.apache.tuscany.sca.assembly.Service;
import org.apache.tuscany.sca.assembly.Wire;
+import org.apache.tuscany.sca.diagram.artifacts.Artifact;
public class TuscanyCompositeEntityBuilder {
@@ -61,15 +64,16 @@ public class TuscanyCompositeEntityBuilder {
ComponentEntity[] comps = buildComponentEntities();
+ buildTargets(comps);
buildWires(tuscanyComp.getWires(), comps);
composite = new CompositeEntity(compositeName);
setParent(comps);
- System.out.println("ComponentEntity " + comps[0].getId());
+ // System.out.println("ComponentEntity " + comps[0].getId());
int[][] conns = buildConnectionMatrix(comps);
- System.out.println("ComponentEntity " + conns[0][0]);
+ // System.out.println("ComponentEntity " + conns[0][0]);
composite.setComponentList(comps);
composite.setConnections(conns);
@@ -77,7 +81,7 @@ public class TuscanyCompositeEntityBuilder {
LayoutBuilder buildLayout = new LayoutBuilder(comps, conns);
buildLayout.placeEntities();
- System.out.println("conns " + conns[0][0]);
+ // System.out.println("conns " + conns[0][0]);
buildCompositeService();
buildCompositeReference();
@@ -173,20 +177,24 @@ public class TuscanyCompositeEntityBuilder {
}
private String extractComp(ComponentEntity[] elts, String str, boolean isReference) {
-
+ String[] names = Artifact.parseNames(str);
if (isReference) {
for (ComponentEntity elt : elts) {
- for (String ref : elt.getReferences()) {
- if (ref.equals(str)) {
- return elt.getName();
+ if (elt.getName().equals(names[0])) {
+ for (String ref : elt.getReferences()) {
+ if (ref.equals(names[1])) {
+ return elt.getName();
+ }
}
}
}
} else {
for (ComponentEntity elt : elts) {
- for (String ser : elt.getServices()) {
- if (ser.equals(str)) {
- return elt.getName();
+ if (elt.getName().equals(names[0])) {
+ for (String ser : elt.getServices()) {
+ if (ser.equals(names[1])) {
+ return elt.getName();
+ }
}
}
}
@@ -233,6 +241,22 @@ public class TuscanyCompositeEntityBuilder {
}
+ private void buildTargets(ComponentEntity[] components) {
+
+ for (Component c : tuscanyComp.getComponents()) {
+ ComponentEntity sourceComponent = findEntity(components, c.getName());
+ for (ComponentReference ref : c.getReferences()) {
+ for (EndpointReference epr : ref.getEndpointReferences()) {
+ Endpoint ep = epr.getTargetEndpoint();
+ if (ep != null && ep.getComponent() != null && ep.getService() != null) {
+ createConnection(sourceComponent, ref.getName(), ep.getComponent().getName(), ep.getService()
+ .getName());
+ }
+ }
+ }
+ }
+ }
+
private void buildWires(List<Wire> wires, ComponentEntity[] elts) {
for (int i = 0; i < wires.size(); i++) {
@@ -281,12 +305,12 @@ public class TuscanyCompositeEntityBuilder {
if (reference != null && service != null) {
- ent.addToRefToSerMap(reference, service);
+ ent.addToRefToSerMap(reference, serviceComp + "/" + service);
ent.addAnAdjacentEntity(serviceComp);
addToConnectedEntities(referenceComp, serviceComp);
addToConnectedEntities(serviceComp, referenceComp);
} else if (reference == null && service != null) {
- ent.addToRefToSerMap(referenceComp, service);
+ ent.addToRefToSerMap(referenceComp, serviceComp + "/" + service);
ent.addAnAdjacentEntity(serviceComp);
addToConnectedEntities(referenceComp, serviceComp);
addToConnectedEntities(serviceComp, referenceComp);
@@ -319,7 +343,7 @@ public class TuscanyCompositeEntityBuilder {
}
private void addToConnectedEntities(String ent1, String ent2) {
- System.err.println(ent1 + " : " + ent2);
+ // System.err.println(ent1 + " : " + ent2);
ArrayList<String> list;
if (connectedEntities.containsKey(ent1)) {
list = connectedEntities.get(ent1);
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/main/Main.java b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/main/Main.java
index 10f0b26713..033c1a6d00 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/main/Main.java
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/main/java/org/apache/tuscany/sca/diagram/main/Main.java
@@ -29,6 +29,7 @@ import java.io.StringWriter;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
@@ -51,6 +52,10 @@ import org.apache.tuscany.sca.diagram.generator.DiagramGenerator;
import org.apache.tuscany.sca.diagram.html.HTMLWrapper;
import org.apache.tuscany.sca.diagram.layout.CompositeEntity;
import org.apache.tuscany.sca.diagram.layout.EntityBuilder;
+import org.apache.tuscany.sca.diagram.layout.TuscanyCompositeEntityBuilder;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
+import org.apache.tuscany.sca.node.extensibility.NodeExtension;
import org.w3c.dom.Document;
public class Main {
@@ -183,22 +188,29 @@ public class Main {
}
private static String extractSvg(Document svg) throws Exception {
-
- // Set up the output transformer
- TransformerFactory transfac = TransformerFactory.newInstance();
- Transformer trans = transfac.newTransformer();
-
// Print the DOM node
StringWriter sw = new StringWriter();
StreamResult result = new StreamResult(sw);
- DOMSource source = new DOMSource(svg);
- trans.transform(source, result);
+
+ transform(svg, result);
String svgString = sw.toString();
return svgString;
}
+ private static void transform(Document svg, StreamResult result) throws Exception {
+ // Set up the output transformer
+ TransformerFactory transfac = TransformerFactory.newInstance();
+
+ Transformer trans = transfac.newTransformer();
+ trans.setOutputProperty(OutputKeys.INDENT, "yes");
+ trans.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
+
+ DOMSource source = new DOMSource(svg);
+ trans.transform(source, result);
+ }
+
public static void svgToJPEG(File svg, File jpeg) throws IOException, TranscoderException {
// Create the transcoder input.
TranscoderInput input = new TranscoderInput(svg.toURI().toString());
@@ -280,4 +292,34 @@ public class Main {
png.close();
}
+ /**
+ * Generate the SVG diagram from
+ * @param configuration
+ * @param classLoader
+ * @return The XML string for the SVG
+ * @throws Exception
+ */
+ public static String generateDiagram(NodeConfiguration configuration, ClassLoader classLoader, String baseURL)
+ throws Exception {
+ ClassLoader currentTCCL = null;
+ if (classLoader != null) {
+ currentTCCL = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(classLoader);
+ }
+
+ try {
+ NodeFactory factory = NodeFactory.getInstance();
+ NodeExtension node = factory.loadNode(configuration);
+ TuscanyCompositeEntityBuilder builder = new TuscanyCompositeEntityBuilder(node.getDomainComposite());
+ CompositeEntity compositeEntity = builder.buildCompositeEntity();
+ DiagramGenerator generator = new DiagramGenerator(compositeEntity, false, baseURL);
+ Document doc = generator.buildSVGDocument();
+ return extractSvg(doc);
+ } finally {
+ if (currentTCCL != null) {
+ Thread.currentThread().setContextClassLoader(currentTCCL);
+ }
+ }
+ }
+
}
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/main/resources/org/apache/tuscany/sca/diagram/artifacts/composite-diagram.css b/sca-java-2.x/trunk/modules/composite-diagram/src/main/resources/org/apache/tuscany/sca/diagram/artifacts/composite-diagram.css
index c1a657f6c5..4a72235502 100644
--- a/sca-java-2.x/trunk/modules/composite-diagram/src/main/resources/org/apache/tuscany/sca/diagram/artifacts/composite-diagram.css
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/main/resources/org/apache/tuscany/sca/diagram/artifacts/composite-diagram.css
@@ -60,4 +60,4 @@ polyline.normalWire {
polyline.dashedWire {
stroke-dasharray: "3 3";
-} \ No newline at end of file
+}
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java b/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java
index c6884b9c15..d53cecac38 100644
--- a/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/layout/DiagramGeneratorTestCase.java
@@ -19,15 +19,19 @@
package org.apache.tuscany.sca.diagram.layout;
import java.io.File;
+import java.io.FileWriter;
import org.apache.tuscany.sca.diagram.main.Main;
+import org.apache.tuscany.sca.diagram.test.HelloWorld;
+import org.apache.tuscany.sca.node.NodeFactory;
+import org.apache.tuscany.sca.node.configuration.NodeConfiguration;
import org.junit.Test;
public class DiagramGeneratorTestCase {
@Test
- public final void test() throws Exception {
- for (File xml : new File("input").listFiles()) {
+ public final void testFiles() throws Exception {
+ for (File xml : new File("src/test/resources/input").listFiles()) {
if (xml.getName().endsWith(".xml")) {
System.out.println(xml);
Main.generate(new File("target"), null, true, false, false, xml.toString());
@@ -35,4 +39,17 @@ public class DiagramGeneratorTestCase {
}
}
+ @Test
+ public final void testNode() throws Exception {
+ NodeConfiguration config = NodeFactory.getInstance().createNodeConfiguration();
+ config.addContribution(new File("target/test-classes/contribution").toURI().toURL());
+
+ String svg = Main.generateDiagram(config, HelloWorld.class.getClassLoader(), null);
+
+ System.out.println(svg);
+ FileWriter fw = new FileWriter("target/node.svg");
+ fw.write(svg);
+ fw.close();
+ }
+
}
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorld.java b/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorld.java
new file mode 100644
index 0000000000..d9ee85e2ca
--- /dev/null
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorld.java
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.diagram.test;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+/**
+ * HelloWorld interface
+ */
+@Remotable
+public interface HelloWorld {
+ String hello(String name);
+
+ Message echo(Message msg);
+
+ public class Message {
+ public String name;
+ public String message;
+ }
+}
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorld2Impl.java b/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorld2Impl.java
new file mode 100644
index 0000000000..22216c105e
--- /dev/null
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorld2Impl.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.diagram.test;
+
+import org.oasisopen.sca.annotation.AllowsPassByReference;
+
+/**
+ * HelloWorld2Impl
+ */
+@AllowsPassByReference
+public class HelloWorld2Impl implements HelloWorld {
+
+ public String hello(String name) {
+ String msg = "Hello " + name;
+ return msg;
+ }
+
+ @Override
+ public Message echo(Message msg) {
+ return msg;
+ }
+}
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorldImpl.java b/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorldImpl.java
new file mode 100644
index 0000000000..89a0da0093
--- /dev/null
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/java/org/apache/tuscany/sca/diagram/test/HelloWorldImpl.java
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.diagram.test;
+
+import org.oasisopen.sca.annotation.AllowsPassByReference;
+import org.oasisopen.sca.annotation.Reference;
+
+/**
+ * HelloWorldImpl
+ */
+@AllowsPassByReference
+public class HelloWorldImpl implements HelloWorld {
+ @Reference
+ private HelloWorld delegate;
+
+ public String hello(String name) {
+ String msg = delegate.hello(name);
+ return msg;
+ }
+
+ @Override
+ public Message echo(Message msg) {
+ return delegate.echo(msg);
+ }
+}
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/contribution/helloworld.composite b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/contribution/helloworld.composite
new file mode 100755
index 0000000000..0b40ca68ed
--- /dev/null
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/contribution/helloworld.composite
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="HelloWorld">
+
+ <component name="HelloComponent">
+ <implementation.java class="org.apache.tuscany.sca.diagram.test.HelloWorldImpl"/>
+ <reference name="delegate" target="Hello2Component" />
+ </component>
+
+ <component name="Hello2Component">
+ <implementation.java class="org.apache.tuscany.sca.diagram.test.HelloWorld2Impl"/>
+ </component>
+
+</composite> \ No newline at end of file
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/input/Calculator.xml b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/Calculator.xml
index 345b9065a9..496581ec6a 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/input/Calculator.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/Calculator.xml
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
targetNamespace="http://sample"
xmlns:sample="http://sample"
name="Calculator">
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/input/MyValueComposite2.xml b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/MyValueComposite2.xml
index 722bdeb0a5..722bdeb0a5 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/input/MyValueComposite2.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/MyValueComposite2.xml
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/input/composite.xml b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite.xml
index 49c33cf2d8..0a08c84f60 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/input/composite.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite.xml
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
targetNamespace="http://sample"
xmlns:sample="http://sample"
name="Calculator">
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/input/composite1.xml b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite1.xml
index 1964db7fbb..c0c714133b 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/input/composite1.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite1.xml
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
targetNamespace="http://supplychain"
xmlns:sp="http://supplychain"
name="supplychain">
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/input/composite2.xml b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite2.xml
index fc32186344..248fc697cf 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/input/composite2.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite2.xml
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
targetNamespace="http://store"
name="store">
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/input/composite3.xml b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite3.xml
index 9997ba42bc..5516c83822 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/input/composite3.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite3.xml
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
targetNamespace="http://sample"
xmlns:sample="http://sample"
name="CalculatorTest">
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/input/composite_idle.xml b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite_idle.xml
index 99517f639f..b1773e6615 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/input/composite_idle.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite_idle.xml
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
targetNamespace="http://sample"
xmlns:sample="http://sample"
name="IdleTest">
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/input/composite_with_compositeService.xml b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite_with_compositeService.xml
index e619d39c1c..e619d39c1c 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/input/composite_with_compositeService.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/composite_with_compositeService.xml
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/input/store.xml b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/store.xml
index fc32186344..248fc697cf 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/input/store.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/store.xml
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"
targetNamespace="http://store"
name="store">
diff --git a/sca-java-2.x/trunk/modules/composite-diagram/input/supplychain.xml b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/supplychain.xml
index 1964db7fbb..c0c714133b 100755
--- a/sca-java-2.x/trunk/modules/composite-diagram/input/supplychain.xml
+++ b/sca-java-2.x/trunk/modules/composite-diagram/src/test/resources/input/supplychain.xml
@@ -17,7 +17,7 @@
* specific language governing permissions and limitations
* under the License.
-->
-<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
targetNamespace="http://supplychain"
xmlns:sp="http://supplychain"
name="supplychain">