Tuscany
  1. Tuscany
  2. TUSCANY-3496

Develop a simple tool that can be used to generate composite diagrams from the xml files

    Details

      Description

      I'm looking a simple tool (web based or command) that can generate the composite diagrams from a list of composite files. One technology we can try is the Apache Batik project.

      http://xmlgraphics.apache.org/batik/

      This tool can serve multiple purposes:

      1) Help document our tutorials and samples
      2) Be integrated with the SCA domain manager to visualize the SCA domain (contributions, composites, nodes etc)

      1. MyValueComposite_diagram.html
        5 kB
        Nirmal Fernando
      2. Calculator_diagram.html
        4 kB
        Nirmal Fernando
      3. supplychain.xml
        2 kB
        Nirmal Fernando
      4. store.xml
        2 kB
        Nirmal Fernando
      5. MyValueComposite2.xml
        2 kB
        Nirmal Fernando
      6. Calculator.xml
        2 kB
        Nirmal Fernando
      7. supplychain_diagram.svg
        4 kB
        Nirmal Fernando
      8. Calculator_diagram.svg
        4 kB
        Nirmal Fernando
      9. store_diagram.svg
        4 kB
        Nirmal Fernando
      10. MyValueComposite2_diagram.svg
        4 kB
        Nirmal Fernando
      11. CompositeDiagramGeneratorUsingBatik-Maven.zip
        55 kB
        Nirmal Fernando
      12. CompositeDiagramGeneratorUsingBatik.zip
        1.83 MB
        Nirmal Fernando
      13. proposed_design_1.jpg
        29 kB
        Nirmal Fernando

        Activity

        Hide
        SANNI Lookman added a comment -

        Hi.

        I was wondering if the SCA Tools project (http://www.eclipse.org/stp/sca/) from eclipse wasn't adressing all these issues? Is there any specific requirements you wish to cover that isn't yet?

        Show
        SANNI Lookman added a comment - Hi. I was wondering if the SCA Tools project ( http://www.eclipse.org/stp/sca/ ) from eclipse wasn't adressing all these issues? Is there any specific requirements you wish to cover that isn't yet?
        Hide
        Raymond Feng added a comment -

        I'm looking for a non-Eclipse tool that can be used from the command line or web UI to generate the composite diagrams from Tuscany's in-memory representation of the composite model.

        Show
        Raymond Feng added a comment - I'm looking for a non-Eclipse tool that can be used from the command line or web UI to generate the composite diagrams from Tuscany's in-memory representation of the composite model.
        Hide
        Janith Bandara added a comment -

        What will be the output of this tool?

        Show
        Janith Bandara added a comment - What will be the output of this tool?
        Hide
        Raymond Feng added a comment -

        A set of diagrams, such as SVG or JPG.

        Show
        Raymond Feng added a comment - A set of diagrams, such as SVG or JPG.
        Hide
        Janith Bandara added a comment -

        well. I'm eligible student for GSOC 2010. but I'm not familiar with Tuscany project, Do you want SCA tool (http://www.eclipse.org/stp/sca/) project like output?

        Show
        Janith Bandara added a comment - well. I'm eligible student for GSOC 2010. but I'm not familiar with Tuscany project, Do you want SCA tool ( http://www.eclipse.org/stp/sca/ ) project like output?
        Hide
        Nirmal Fernando added a comment -

        I showed my interest on this idea, in the dev-mailing list,
        and currently started to explore the requirements and a design.

        Show
        Nirmal Fernando added a comment - I showed my interest on this idea, in the dev-mailing list, and currently started to explore the requirements and a design.
        Hide
        Nirmal Fernando added a comment -

        Hi,

        After studying about the idea, I came up with the following design proposal.

        Please refer the attached proposed_design_1 image.

        Composite XML should be generated using the Tuscany's in-memory representation of the composite model.
        It will then will give as an input for the Composite Analyzer. Composite Analyzer then analyzes the XML document
        and grab the relevant DOM Elements such as Composite, Component, Service, Reference, Wire etc. and starts to
        build the SVG document using SVG DOM API of Apache Batik.

        After Composite Analyzer built up the SVG document it will be the output which represents the composite diagram.

        DOM elements (Composite, Component, Service, Reference, Wire etc.) possibly be static classes which holds the
        shape of the artifact, colour, other static properties and will be given the dynamic properties (such as position, size etc.)
        as input, in order to create a DOM element and it will be then handover to the Composite Analyzer.

        This may be very high level design, but I would appreciate if you can give me some feedback.

        Thanks.

        Show
        Nirmal Fernando added a comment - Hi, After studying about the idea, I came up with the following design proposal. Please refer the attached proposed_design_1 image. Composite XML should be generated using the Tuscany's in-memory representation of the composite model. It will then will give as an input for the Composite Analyzer. Composite Analyzer then analyzes the XML document and grab the relevant DOM Elements such as Composite, Component, Service, Reference, Wire etc. and starts to build the SVG document using SVG DOM API of Apache Batik. After Composite Analyzer built up the SVG document it will be the output which represents the composite diagram. DOM elements (Composite, Component, Service, Reference, Wire etc.) possibly be static classes which holds the shape of the artifact, colour, other static properties and will be given the dynamic properties (such as position, size etc.) as input, in order to create a DOM element and it will be then handover to the Composite Analyzer. This may be very high level design, but I would appreciate if you can give me some feedback. Thanks.
        Hide
        Nirmal Fernando added a comment -

        I have submitted my proposal to Google http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/nirmal070125/1

        Really exciting to work on this project and contribute to Apache Tuscany!

        Show
        Nirmal Fernando added a comment - I have submitted my proposal to Google http://socghop.appspot.com/gsoc/proposal/review/google/gsoc2011/nirmal070125/1 Really exciting to work on this project and contribute to Apache Tuscany!
        Hide
        Jean-Sebastien Delfino added a comment -

        The proposal looks really good. I've just posted some comments to tuscany-dev, see: http://marc.info/?l=tuscany-dev&m=130228511529211&w=2

        Show
        Jean-Sebastien Delfino added a comment - The proposal looks really good. I've just posted some comments to tuscany-dev, see: http://marc.info/?l=tuscany-dev&m=130228511529211&w=2
        Hide
        Nirmal Fernando added a comment -

        Hi,

        This is my work plan till 10th of May:

        • Read on Tuscany SCA Java, understand the design, and concentrate on project relevant parts
        • Read on Scalable Vector Graphics (SVG) 1.1: already partially done
        • Read on Apache Batik and write examples to get familiar: already partially done
        • Recognize all the artifacts of SCA: already partially done
        • Research on layout building algorithms and tools and find out the appropriate algorithm

        I will update on my findings!

        Thanks.

        Show
        Nirmal Fernando added a comment - Hi, This is my work plan till 10th of May: Read on Tuscany SCA Java, understand the design, and concentrate on project relevant parts Read on Scalable Vector Graphics (SVG) 1.1: already partially done Read on Apache Batik and write examples to get familiar: already partially done Recognize all the artifacts of SCA: already partially done Research on layout building algorithms and tools and find out the appropriate algorithm I will update on my findings! Thanks.
        Hide
        Luciano Resende added a comment -

        Please see modules/node-manager for some some base work that can be useful for your project.

        Show
        Luciano Resende added a comment - Please see modules/node-manager for some some base work that can be useful for your project.
        Hide
        Nirmal Fernando added a comment - - edited

        Hi,

        I have attached an Eclipse project of a composite diagram generator prototype using Apache Batik. This is an experimental project to understand the usage of Apache Batik.

        @Luciano thanks, it will be helpful!

        Thanks.

        Show
        Nirmal Fernando added a comment - - edited Hi, I have attached an Eclipse project of a composite diagram generator prototype using Apache Batik. This is an experimental project to understand the usage of Apache Batik. @Luciano thanks, it will be helpful! Thanks.
        Hide
        Nirmal Fernando added a comment -

        Hi,

        I'm looking at Graphviz API, playing around it and checking whether it can be used in this project !
        Also watching few screen casts, reading the paper "Drawing graphs with dot" by Emden Gansner and Eleftherios Koutsofios and Stephen North to learn "dot language", and experimenting

        Show
        Nirmal Fernando added a comment - Hi, I'm looking at Graphviz API, playing around it and checking whether it can be used in this project ! Also watching few screen casts, reading the paper "Drawing graphs with dot" by Emden Gansner and Eleftherios Koutsofios and Stephen North to learn "dot language", and experimenting
        Hide
        Nirmal Fernando added a comment -

        Hi All,

        I have attached the Maven project of the prototype created using Apache Batik.

        Thanks.

        Show
        Nirmal Fernando added a comment - Hi All, I have attached the Maven project of the prototype created using Apache Batik. Thanks.
        Hide
        ant elder added a comment -

        I've committed your Maven project to SVN here: https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/

        You can check that out with svn co https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/ and then as soon as your userid comes through you'll be able to commit to there too

        Show
        ant elder added a comment - I've committed your Maven project to SVN here: https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/ You can check that out with svn co https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/ and then as soon as your userid comes through you'll be able to commit to there too
        Hide
        ant elder added a comment -

        (I should have also said that i've tried building it with Maven and it works fine, so good on you its a great start.)

        Show
        ant elder added a comment - (I should have also said that i've tried building it with Maven and it works fine, so good on you its a great start.)
        Hide
        Nirmal Fernando added a comment -

        Thanks Ant for committing it!

        Show
        Nirmal Fernando added a comment - Thanks Ant for committing it!
        Hide
        Nirmal Fernando added a comment -

        Hi All,

        I am currently facing few problems with GraphViz.

        1) We can't place shapes as they overlap each other (we need this cause services overlap on components etc.). We can load a single image, but then it is not possible to connect a service to a particular reference correctly (i.e. wires will land all over, instead of connecting the correct points).

        2) We can't create a shape we have for a service/reference directly, but there's a way by using a postscript file. But this will be out of the question if we can't find a solution for 1).

        According to my observation graphViz can't provide a solution for 1) hence we might give up GraphViz .

        So, other possibility is to use Apache batiks for diagram creation and implement a suitable algorithm to manage layout.

        Any thoughts are highly appreciated!

        Thanks.

        Show
        Nirmal Fernando added a comment - Hi All, I am currently facing few problems with GraphViz. 1) We can't place shapes as they overlap each other (we need this cause services overlap on components etc.). We can load a single image, but then it is not possible to connect a service to a particular reference correctly (i.e. wires will land all over, instead of connecting the correct points). 2) We can't create a shape we have for a service/reference directly, but there's a way by using a postscript file. But this will be out of the question if we can't find a solution for 1). According to my observation graphViz can't provide a solution for 1) hence we might give up GraphViz . So, other possibility is to use Apache batiks for diagram creation and implement a suitable algorithm to manage layout. Any thoughts are highly appreciated! Thanks.
        Hide
        Nirmal Fernando added a comment - - edited

        Hi All,

        I have almost finished implementing the necessary requirements of Composite Diagram Generator as per now, and starting to testing the tool.

        You can find the code up to date from https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/

        Herewith I have attached 4 SVG images, created using the tool, and the 4 attached composites files were created/modified just for the feature validation process, thus may not be meaningful.

        Please download and open the SVG images using your web browser, then only you'll get to see the 'inclusion' links working. Also you should place all 4 SVG images in one place to get the links to work.

        PS: You may notice that the images are not scrollable, I couldn't find a way to make SVG scrollable yet (I spent very little time on it ), for now you may want to zoom in and out.

        Waiting for your comments!

        Thanks.

        Show
        Nirmal Fernando added a comment - - edited Hi All, I have almost finished implementing the necessary requirements of Composite Diagram Generator as per now, and starting to testing the tool. You can find the code up to date from https://svn.apache.org/repos/asf/tuscany/collaboration/GSoC-2011-Nirmal/ Herewith I have attached 4 SVG images, created using the tool, and the 4 attached composites files were created/modified just for the feature validation process, thus may not be meaningful. Please download and open the SVG images using your web browser, then only you'll get to see the 'inclusion' links working. Also you should place all 4 SVG images in one place to get the links to work. PS: You may notice that the images are not scrollable, I couldn't find a way to make SVG scrollable yet (I spent very little time on it ), for now you may want to zoom in and out. Waiting for your comments! Thanks.
        Hide
        Nirmal Fernando added a comment -

        Herewith I have attached sample HTML files generated by the tool!

        Show
        Nirmal Fernando added a comment - Herewith I have attached sample HTML files generated by the tool!
        Hide
        Nirmal Fernando added a comment -

        Hi All,

        Can't we resolve this now?

        Thanks.

        Show
        Nirmal Fernando added a comment - Hi All, Can't we resolve this now? Thanks.
        Hide
        Nirmal Fernando added a comment -

        I am resolving this issue.

        Please create separate JIRAs to track any bugs with Tuscany Composite Diagram Generator.

        Show
        Nirmal Fernando added a comment - I am resolving this issue. Please create separate JIRAs to track any bugs with Tuscany Composite Diagram Generator.

          People

          • Assignee:
            Nirmal Fernando
            Reporter:
            Raymond Feng
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1m
              1m
              Remaining:
              Remaining Estimate - 1m
              1m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development