On Fri, Aug 12, 2011 at 1:37 AM, ant elder <antel...@apache.org> wrote:
> On Thu, Aug 11, 2011 at 3:52 PM, Nirmal Fernando <nirmal070...@gmail.com> > wrote: > > > > > > On Wed, Aug 10, 2011 at 1:15 PM, ant elder <antel...@apache.org> wrote: > >> > >> On Tue, Aug 9, 2011 at 6:55 PM, Nirmal Fernando <nirmal070...@gmail.com > > > >> wrote: > >> > Hi Ant, > >> > > >> > On Mon, Aug 8, 2011 at 1:58 PM, ant elder <ant.el...@gmail.com> > wrote: > >> >> > >> >> Nirmal, I've just committed a module with a couple of classes that > >> >> show how your SVG code could be used by the Tuscany Shell to draw SVG > >> >> pictures of composites: > >> >> > >> >> > >> >> > >> >> > https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/ > >> >> > >> >> The code is pretty simple, just one Batik class copied from their > >> >> examples to display an SVG with Swing, and one small class for the > >> >> Tuscany Shell command. If you check that out and from its directory > do > >> >> "mvn tuscany:run" it will start the Tuscany Shell and you'll see in > >> >> the help there is a new "draw command, and entering > >> >> > >> >> draw CompositeDiagramShellPlugin helloworld.composite > >> >> > >> >> it will try to display the SVG. That doesn't quite work as the > >> >> EntityBuilder has a problem parsing the XML. Ideally it wouldn't have > >> >> to parse the XML but would be able to work with the Tuscany Composite > >> >> object directly. > >> > > >> > Thanks for the contribution ! :) > >> > > >> >> > >> >> What do you think about adding another EntityBuilder impl that works > >> >> with the Composite object? > >> > > >> > I added the support to the Tuscany composite object by adding > >> > TuscanyCompositeEntityBuilder class: > >> > > >> > > https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/CompositeDiagramGeneratorUsingBatik/src/main/java/org/apache/tuscany/sca/impl/layout/TuscanyCompositeEntityBuilder.java > >> > > >> > And tried to run the shell command, but I think there's some problem > >> > with > >> > the temp file which you are creating in "DrawShellCommand" class. > >> > > >> > >> Thanks Nirmal, thats looking good to me. I've updated DrawShellCommand > >> to not use the intermediate file so it should be working now. > > > > Ant, I'm still getting the SVG file not found exception. Here's the > trace: > > > > java.io.FileNotFoundException: > > > /media/798D-18B1/GSoC-2011/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/file:/tmp/tmp1022936089053255799.svg > > (No such file or directory) > > at java.io.FileInputStream.open(Native Method) > > at java.io.FileInputStream.<init>(FileInputStream.java:106) > > at java.io.FileInputStream.<init>(FileInputStream.java:66) > > at > > > sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70) > > at > > > sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161) > > at > > > org.apache.batik.util.ParsedURLData.openStreamInternal(ParsedURLData.java:547) > > at > > org.apache.batik.util.ParsedURLData.openStream(ParsedURLData.java:471) > > at org.apache.batik.util.ParsedURL.openStream(ParsedURL.java:417) > > at > > > org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(SAXSVGDocumentFactory.java:158) > > at > > > org.apache.batik.dom.svg.SAXSVGDocumentFactory.createSVGDocument(SAXSVGDocumentFactory.java:124) > > at > > > org.apache.batik.bridge.DocumentLoader.loadDocument(DocumentLoader.java:106) > > at > > > org.apache.batik.swing.svg.SVGDocumentLoader.run(SVGDocumentLoader.java:84) > > > > Can you try doing an svn up, mvn clean install, and then mvn > tuscany:run to see if that fixes it? it should, the lates code in svn > has no file code anymore. > > Earlier I probably forgotten to compile the code, sorry about that! >> > >> I do get an error while its displaying the SVG but the image still > >> seems to display ok - > >> > >> org.w3c.dom.DOMException: The "central" identifier is not a valid > >> value for the "alignment-baseline" property. > >> > >> That comes from the code in CompositeArtifact.addElement and > >> Layer.addElement setting the alignment-baseline attribute, i don't > >> know what the issue is with that value does it mean anything to you? > > > > I changed it to "middle", but couldn't check whether there's an error > still. > > Yes thats fixed it. > > >> > >> The diagrams always have the bit at the bottom for included composites > >> even when there aren't any included, i think it might look better if > >> DiagramGenerator.addInclusions() did nothing when there are no > >> included composites. > > > > Done! :) > > > > Cool. This is looking really good i think. I've added another test > composite to try with the shell plugin, myValue.composite, which is > based on the one from section 5.2.1 of the Assembly spec so we can > compare the diagram from the shell with the one in figure 5-4 in the > spec. You can see it with the shell command "draw > CompositeDiagramShellPlugin myValue.composite", Comparing the pictures > i wonder how you're layout algorithm is deciding where to put the > composite services and references? It looks like its putting them at > the top whereas the spec images have them centered. Having them > centered looks better to me, what do you think? > Done! Indeed, having them centered looks better :) Ant, is it possible to add a test composite which has <includes> and see whether the links are working, in the SVG viewer? Thanks. > ...ant > -- Best Regards, Nirmal C.S.Nirmal J. Fernando Department of Computer Science & Engineering, Faculty of Engineering, University of Moratuwa, Sri Lanka. Blog: http://nirmalfdo.blogspot.com/