blob: eebf22508f3ee04cd498b846a5b0d1cabd20688a [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>org.eclipse.emf.importer.roseuml Read Me</title>
</head>
<body lang="EN-US">
<em>The following description is copied from org.eclipse.emf.importer.rose, which
this plug-in almost duplicates. See <a href="installation.html">Installation</a>
for specific instructions on getting this plug-in and its dependents to install and build.
</em>
<h3>Introduction</h3>
<p>Usage of the QVT Rose UML importer is almost identical to the standard EMF Rose usage. The differences is that the
RoseUML conversions apply a UML interpreation to Association Role Constraints such as {ordered}.
The normal Rose conversion ignores these constraints and consequently treats all associations as ordered.</p>
<p>This document describes how you can use scripts to generate code from a Rose UML model. The
script can be either a regular shell script that invokes <a href="#headlessApplication">Eclipse headless
applications</a> or an Ant script that invokes the <a href="#antTasks">task</a> provided by this plugin.</p>
<h3><a name="overallComments">Overall Comments</a></h3>
<ul>
<li>If you didn't extract this plugin from CVS, the &quot;examples&quot; directory mentioned
in this document is available in the EMF source plugin
(org.eclipse.emf.source_<i>&lt;version&gt;</i>/src/org.eclipse.emf.importer.rose_<i>&lt;version&gt;</i>).
<br/><br/></li>
<li>Before running your build scripts or the examples provided here, make sure you have the 2
jar files required by this plugin (&quot;importer.roseuml.jar&quot; and
&quot;importer.roseuml.tasks.jar&quot;) and also the 2 jar files required by the <tt>org.eclipse.emf.ant</tt>
plugin (&quot;emf.ant.jar&quot; and &quot;emf.ant.tasks.jar&quot;). If necessary, Eclipse
can generate them for you. All you need to do is to run the Ant script created by PDE when you right click on the manifest file
and select &quot;PDE Tools&gt;Create Ant Build File&quot;.
<br/><br/></li>
<li>Although the applications and task mentioned here must be executed by Eclipse (usually in headless mode), they can
work on files located in any directory. In other words, your models, templates and other files don't need
to be in the &quot;plugins&quot; directory nor in the workspace.
<br/><br/></li>
<li>In order to preserve the original state of this plugin's &quot;examples&quot; directory, you
should copy it to a different location and run the Ant scripts from there.
<br/><br/></li>
<li>Starting a new JVM process and invoking Eclipse are expensive operations. Your build will
perform better if you are able to group the steps that require Eclipse in a few scripts
(one script would be ideal). This is probably a reason to use Ant instead of invoking the
applications - you can generate code for multiple models using one single Ant script.
<br/><br/></li>
<li>The &quot;examples/library&quot; directory contains a Rose model, and shell and Ant scripts
to generate its code.
</li>
</ul>
<h3><a name="headlessApplication">Rose and Generator Applications</a></h3>
<p>The application provided by this plugin generates the ecore and genmodel files from models defined
using Rose.</p>
<table border="1" cellpadding="2" cellspacing="0"
summary="Lists the details about the Rose application.">
<tr><td colspan="2">Rose application details</td></tr>
<tr><td>ID</td><td><tt>org.eclipse.emf.importer.roseuml.RoseUML2GenModel</tt></td></tr>
<tr><td>Class</td><td><tt>org.eclipse.emf.importer.roseuml.RoseUMLImporterApplication</tt></td></tr>
</table>
<p>To generate the actual Java code you will need to use a second application, provided by
the &quot;org.eclipse.emf.codegen.ecore&quot; plugin.</p>
<table border="1" cellpadding="2" cellspacing="0"
summary="Lists the details about the Generator application.">
<tr><td colspan="2">Generator application details</td></tr>
<tr><td>ID</td><td><tt>org.eclipse.emf.codegen.ecore.Generator</tt></td></tr>
<tr><td>Class</td><td><tt>org.eclipse.emf.codegen.ecore.Generator</tt></td></tr>
</table>
<p>In order to run these or any other Eclipse application, you need to execute the following
command (without the line breaks):</p>
<p>
java
<br/>&nbsp;&nbsp;-classpath <i>&lt;eclipseDir&gt;</i>/startup.jar org.eclipse.core.launcher.Main
<br/>&nbsp;&nbsp;-data <i>&lt;full path to a workspace - ideally an empty directory&gt;</i>
<br/>&nbsp;&nbsp;-application <i>&lt;application ID&gt;</i>
<br/>&nbsp;&nbsp;<i>&lt;application arguments&gt;</i>
</p>
<p>The directory &quot;examples/library/build&quot; has shell scripts that generate the code for
the model provided. If you have any questions after reading and experimenting with it, look at the
applications's javadoc for more details. Also, check the application's class
&quot;getUsage()&quot; method for the list of possible arguments.</p>
<h3><a name="antTasks">Rose Ant Task</a></h3>
<p>The Rose task details are:</p>
<table border="1" cellpadding="2" cellspacing="0"
summary="Lists the details about the Rose task.">
<tr><td>Name</td><td><tt>emf.Rose2Java</tt></td></tr>
<tr><td>Class</td><td><tt>org.eclipse.emf.importer.roseuml.taskdefs.RoseUMLGeneratorTask</tt></td></tr>
</table>
<p>This is the usual command line to run an Ant script using a headless Eclipse instance (remove the line breaks):</p>
<p>
java
<br/>&nbsp;&nbsp;-classpath <i>&lt;eclipseDir&gt;</i>/startup.jar org.eclipse.core.launcher.Main
<br/>&nbsp;&nbsp;-data <i>&lt;full path to a workspace - ideally an empty directory&gt;</i>
<br/>&nbsp;&nbsp;-application org.eclipse.ant.core.antRunner
<br/>&nbsp;&nbsp;-buildfile <i>&lt;full path to your script&gt;</i>
</p>
<p>The directory &quot;examples/library/build&quot; has an Ant script that generate the code for
the model provided. The task's javadoc has lots of information you may find useful.</p>
</body>
</html>