xmlToDiagram.php

Go to the documentation of this file.
00001 <?php
00015 require_once( "../public/codetodiagram.php" );
00016 
00017 $intZoom = (integer)CorujaArrayManipulation::getArrayField( $_POST , "zoom" , 100 );
00018 $strFile = (string)CorujaArrayManipulation::getArrayField( $_REQUEST , "file" , "threeLittlePigs");
00019 
00020 switch( $strFile )
00021 {
00022     case "mvc":
00023     {
00024         $strXmlFile = '../examples/xmls/mvc.xml';
00025         $strTitle = "Model View Controller";
00026         break;
00027     }
00028     case "threeLittlePigs":
00029     default:
00030     {
00031         $strTitle = "Three Little Pigs";
00032         $strXmlFile = '../examples/ThreeLittlePigs/threeLittlePigs.xml';
00033     }
00034 }
00035 $strXml = CorujaArrayManipulation::getArrayField( $_POST , "xml" , file_get_contents( $strXmlFile ) );
00036 $strXml =  html_entity_decode( trim( $strXml ) );
00037 $strXml = stripslashes( $strXml );
00038 $objXmlSequence = UmlSequenceDiagramFactoryFromXml::getInstance()->setXml( $strXml )->perform();
00039 
00040 ?>
00041 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
00042     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00043 <html xmlns="http://www.w3.org/1999/xhtml">
00044     <head>
00045         <?php require_once( "header.php" ) ?>
00046         <style type="text/css">
00047 /*<![CDATA[*/
00048 
00049             @import url("css/default.css");
00050 /*]]>*/
00051         </style>
00052         <title>
00053             Automatic Sequence Diagram
00054         </title>
00055     </head>
00056     <body>
00057         <h3>
00058             Code To Diagram
00059         </h3>
00060         <h4> Interpreting XML into Sequence Diagrams  </h4>
00061         <h5> Sequence Diagrams </h5>
00062         <div class="intro">
00063             <p>
00064                 Sequence diagrams are simple and easy to understand.
00065                 However, create sequence diagrams automatically can
00066                 be very complex by XMI interpratation, image generation
00067                 and still very restrict to some kind language or output.
00068             </p>
00069             <h5> Code to Diagram Proposal </h5>
00070                 <div style="width:50%; float:left">
00071             <p>
00072                 To make this process easier, We've developed an automatic
00073                 diagram generator that factory the diagram object from
00074                 many different factory as XML and
00075                 <a href="index.php">Code Execution</a>
00076                 ( yeahhh )
00077                 then it can be sent to one of the printers that have the
00078                 most diverse output types as XML, HTML, Jpeg, etc..
00079             </p>
00080             <p>
00081                 Some printers need to be maded yet. And, if you have some
00082                 special case, when any of the avaliable printers and factorys
00083                 solve your problem, everthing it is extremly well 
00084                 <a href="http://www.thiagomata.com/codetodiagram/svn/doc/dox/html/">doc</a>
00085                 to help
00086                 to you create new classes and append new features.
00087             </p>
00088                 </div>
00089                 <div style="text-align: center;width:50%; float:left">
00090                     <img src="./images/flow_codetodiagram.png"
00091                     alt="code to diagram flow"
00092                     longdesc="./images/flow_codetodiagram.txt"/>
00093                 </div>
00094             <h5> Limitations </h5>
00095             <p>
00096                 While still not fully working on Internet Explorer, the generator
00097                 already makes life easier for those responsible in maintaining
00098                 this kind of diagrams. We welcome anyone with the patience
00099                 and desire to make the CSS changes need for it to work on IE.
00100             </p>
00101             <h5> Under Development </h5>
00102             <p>
00103                 Also, fully compliance with UML 2.0 is still under development.
00104                 Anyone interested in working in these fields is more than welcome
00105                 to join the team. And if you have a patch on add-on to send, feel
00106                 free to do so. Just send an e-mail to me thiago.henrique.mata@gmail.com .
00107             </p>
00108             <p>
00109                 And remember, this is free software, in development, and as such, I can give you no
00110                 warranty. Use it at your own risk. It's not for the faint of heart.
00111             </p>
00112             <p>
00113                 Tag names can and should change. New tags can be add anytime. Stay tunned for more news.
00114             </p>
00115             <h5> Code to Diagram can do more ? </h5>
00116             <p>
00117                 This look nice ? And if the diagram was created by a
00118                 <a href="index.php" title="PHP to Diagram">
00119                     code execution
00120                 </a>?
00121             </p>
00122             <h5> Download </h5>
00123             <p>
00124                 This software can be download by the SVN into the
00125                 <a href="http://www.assembla.com/spaces/codetodiagram" title="Code To Diagram Project">
00126                     Code To Diagram
00127                 </a>
00128                 inside the
00129                 <a href="http://www.assembla.com/">
00130                     Assembla
00131                 </a>
00132                 where you can find a detail description about the
00133                 <a href="http://www.assembla.com/wiki/show/codetodiagram/Team" title="Code to Diagram - Team" >
00134                 development team
00135                 </a>
00136                 and
00137                 the project
00138             </p>
00139             <p>
00140                 For external use <a href="caller.php"> try this link </a> and see the HTML code.
00141             </p>
00142             <h5> Examples </h5>
00143             <p>
00144                 The example I posted is the <a href="http://www.shol.com/agita/pigs.htm" > story </a> of <a href="http://en.wikipedia.org/wiki/The_Three_Little_Pigs"> "Three Little Pigs"</a>.
00145                 It should give you a view of how the generator works and also entertain you
00146                 a little bit. Change the XML as you please to generate other
00147                 diagrams of your own.
00148             </p>
00149             <ul>
00150                 <li><a href="?file=threeLittlePigs">Three Little Pigs</a></li>
00151                 <li><a href="?file=mvc">Model View Controller</a></li>
00152             </ul>
00153             <h5> Team </h5>
00154             <p>
00155                 Special thanks to Raphael Melo and
00156                 <a href="http://pt-br.facebook.com/people/Igor-Moreno/678110783">
00157                     Igor Moreno
00158                 </a>
00159                 for helping.
00160             </p>
00161             <p >
00162                 Click
00163                 <a href="http://www.assembla.com/wiki/show/codetodiagram/Team" title="Code to Diagram - Team">
00164                     here
00165                 </a>
00166                 to see the team responsible for the development of these projects
00167             </p>
00168          </div>
00169         <h4>
00170             <?php print $strTitle ?>
00171         </h4>
00172         <?php print UmlSequenceDiagramPrinterToHtml::getInstance()->getConfiguration()->setEmbeded( true )->setZoom( $intZoom )->perform( $objXmlSequence ) ?>
00173         <div style="float:left;width:100%">
00174             <h4>
00175                 Now, change and create your own sequence diagram.
00176             </h4>
00177             <form method="post" action="">
00178                 <label>
00179                     <span> Zoom: </span>
00180                     <span> <input type="text" name="zoom" value="<?php print $intZoom ?>" style="width:50px"/> % </span>
00181                 </label>
00182                 <label>
00183                     <span> Xml: </span>
00184                     <textarea name="xml" rows="20" cols="20"><?php print htmlentities( $strXml ) ?>
00185                     </textarea>
00186                 </label>
00187                 <label>
00188                     <input type="submit" value="Make My Sequence Diagram"/>
00189                 </label>
00190             </form>
00191         </div>
00192         <?php require_once( "footer.php" ); ?>
00193     </body>
00194 </html>

Generated on Sat Apr 7 14:19:11 2012 for CodeToDiagram by  doxygen 1.5.9