| <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon()); # All on the same line to unclutter the user's desktop' |
| |
| #***************************************************************************** |
| # |
| # AMW_KM32SQL_doc.php |
| # |
| # Author: Marcos Didonet Del Fabro |
| # Date: 2005-06-20 |
| # |
| # Description: Type your page comments here - these are not sent to the browser |
| # |
| # |
| #**************************************************************************** |
| |
| # |
| # Begin: page-specific settings. Change these. |
| $pageTitle = "Translating KM3 into SQL DDL using AMW and ATL"; |
| $pageKeywords = ""; |
| $pageAuthor = "Marcos Didonet Del Fabro"; |
| |
| # Paste your HTML content between the EOHTML markers! |
| $html = <<<EOHTML |
| |
| <!-- Main part --> |
| <div id="midcolumn"> |
| <table width="100%"> |
| <tr> |
| <td width="50%"> |
| <h1>$pageTitle</h1> |
| </td> |
| </tr> |
| </table> |
| |
| <p> |
| This example is a complete bridge between KM3 and SQL DDL (Data Definition Language) that uses injection, extraction, weaving and transformations. |
| It is similar to the example that transforms SQL to KM3, but in the opposite direction. <p/> |
| This example contains a weaving model between a KM3 metamodel and a SQL DDL metamodel. |
| It uses the same metamodel extensions as the ones used to transform SQL into KM3. |
| The weaving model is used to produce an ATL transformation that translates KM3 models |
| into SQL models. We used a KM3 file generated by the example "Translating SQL into KM3".<p/> |
| Most part of the ATL transformation is also used to generate the files of the |
| <a href="http://www.eclipse.org/gmt/am3/zoos/">Atlantic SQL DDL Zoo</a>. |
| </p> |
| |
| <h2>Instructions</h2> |
| |
| <h4>Loading the weaving model into AMW:</h4> |
| The weaving model (models/mw_km3_sqlddl.ecore) must be loaded using the wizard to be able to |
| create the metadata file in the workspace. |
| <br/> There are two metamodel extensions that need to be loaded : "mw_base_ext" and |
| "metamodels/mmw_sql_km3". |
| The complete weaving metamodel is saved at metamodels/mmw_sql_km3.ecore</br> |
| This step does is not necessary to execute the transformations. |
| <br/> |
| <i>Left metamodel:</i> metamodels/KM3.ecore.</br> |
| <i>Right metamodel:</i> metamodels/SQLDDL.ecore. |
| |
| <h4>Executing the transformations</h4> |
| |
| <p/> |
| There is an Ant Script (scripts/executeAll.xml) that takes the models/mantis.km3 file, |
| and automatically produces a .SQL file. |
| It executes the following actions: |
| <ul class="midlist"> |
| <li> |
| injects the mantis.km3 file into a KM3 model (models/mantis-KM3.ecore) conforming to |
| KM3 metamodel, |
| </li> |
| <li> |
| the weaving model (models/mw_km3_sqlddl.ecore) contains links between the metamodels/KM3.ecore metamodel and |
| the metamodels/SQLDDL.ecore metamodel, |
| </li> |
| <li> |
| executes the ATL HOT (hot/AMWtoATL_KM32SQL.atl) that takes the weaving model mw_km3_sqlddl.ecore as input |
| and produces the ATL model (output/KM32SQL.ecore) conforming to the ATL metamodel, |
| </li> |
| <li> |
| extracts the ATL model into an ATL file (output/KM32SQL.atl), |
| </li> |
| <li> |
| executes the ATL transformation (KM32SQL.atl). This transformation takes the mantis-KM3.ecore model as input |
| and produces the SQLDDL model (models/mantis-sql.ecore) as output, |
| </li> |
| <li> |
| extracts the SQL model (mantis-sql.ecore) into a SQL file (models/mantis-sql.sql). |
| </li> |
| </ul> |
| |
| <p/> |
| <b>Remarks:</b></br> |
| <ul class="midlist"> |
| <li> |
| The HOT and the KM32SQL transformations can be executed separatedly as well. |
| Each transformartion has a predefined "launch configuration" file. <br/> |
| </li> |
| <li> |
| There are Ant scripts to execute the injection of .km3 files (KM3Injector.xml) and |
| the extraction of ATL models(ATLExtractor.xml). The files in the scripts/ folder are mandatory |
| files to execute the Ant Scripts. |
| </li> |
| <li> |
| When the ATL model is extracted into KM32SQL.atl, the KM32SQL.asm file is generated by the |
| ATL engine. It is possible that the executeAll.xml script tries to execute the transformation |
| before it is extracted (in the first time the script is executed), |
| causing an error. To solve this issue the script needs to be executed a second time. |
| </li> |
| </ul> |
| <p/> |
| |
| </div> |
| |
| EOHTML; |
| |
| |
| # Generate the web page |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| ?> |