carbidecpp20devenv/plugins/org.eclipse.xsd.source_2.4.1.v200808251517/src/org.eclipse.xsd.ecore.importer_2.4.0.v200808251517/readme.html
author cawthron
Wed, 18 Mar 2009 17:21:00 -0500
changeset 1 82d1d1de1a01
permissions -rw-r--r--
import Carbide.c++
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     2
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     3
<html xmlns="http://www.w3.org/1999/xhtml">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     4
<head>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     5
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     6
<title>org.eclipse.xsd.ecore.importer Read Me</title>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     7
</head>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     8
<body lang="EN-US">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     9
<h3>Introduction</h3>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    10
<p>This document describes how you can use scripts to generate code from XML Schema (xsd) files.  The 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    11
script can be either a regular shell script that invokes <a href="#headlessApplication">Eclipse headless 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    12
applications</a> or an Ant script that invokes the <a href="#antTasks">task</a> provided by this plugin.</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    13
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    14
<h3><a name="overallComments">Overall Comments</a></h3>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    15
<ul>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    16
<li>If you didn't extract this plugin from CVS, the &quot;examples&quot; directory mentioned 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    17
in this document is available in the XSD source plugin 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    18
(org.eclipse.xsd.source_<i>&lt;version&gt;</i>/src/org.eclipse.xsd.ecore.importer_<i>&lt;version&gt;</i>).
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    19
<br/><br/></li>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    20
<li>Before running your build scripts or the examples provided here, make sure you have the 2 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    21
jar files required by this plugin (&quot;xsd.ecore.importer.jar&quot; and 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    22
&quot;xsd.ecore.importer.tasks.jar&quot;) and also the 2 jar files required by the <tt>org.eclipse.emf.ant</tt> 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    23
plugin (&quot;emf.ant.jar&quot; and &quot;emf.ant.tasks.jar&quot;).  If necessary, Eclipse 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    24
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 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    25
and select &quot;PDE Tools&gt;Create Ant Build File&quot;.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    26
<br/><br/></li>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    27
<li>Although the applications and task mentioned here must be executed by Eclipse (usually in headless mode), they can 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    28
work on files located in any directory.  In other words, your models, templates and other files don't need 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    29
to be in the &quot;plugins&quot; directory nor in the workspace.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    30
<br/><br/></li>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    31
<li>In order to preserve the original state of this plugin's &quot;examples&quot; directory, you
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    32
should copy it to a different location and run the Ant scripts from there.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    33
<br/><br/></li>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    34
<li>Starting a new JVM process and invoking Eclipse are expensive operations.  Your build will 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    35
perform better if you are able to group the steps that require Eclipse in a few scripts 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    36
(one script would be ideal).  This is probably a reason to use Ant instead of invoking the 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    37
applications - you can generate code for multiple models using one single Ant script.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    38
<br/><br/></li>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    39
<li>The &quot;examples/library&quot; directory contains xsd file, and shell and Ant scripts 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    40
to generate their code.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    41
</li>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    42
</ul>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    43
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    44
<h3><a name="headlessApplication">XSD and Generator Applications</a></h3>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    45
<p>The application provided by this plugin generates the ecore and genmodel files from models defined
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    46
using XSD files.</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    47
<table border="1" cellpadding="2" cellspacing="0" 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    48
summary="Lists the details about the XSD application.">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    49
  <tr><td colspan="2">XSD application details</td></tr>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    50
	<tr><td>ID</td><td><tt>org.eclipse.xsd.ecore.importer.XSD2GenModel</tt></td></tr>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    51
	<tr><td>Class</td><td><tt>org.eclipse.xsd.ecore.importer.XSDImporterApplication</tt></td></tr>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    52
</table>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    53
<p>To generate the actual Java code you will need to use a second application, provided by 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    54
the &quot;org.eclipse.emf.codegen.ecore&quot; plugin.</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    55
<table border="1" cellpadding="2" cellspacing="0" 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    56
summary="Lists the details about the Generator application.">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    57
  <tr><td colspan="2">Generator application details</td></tr>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    58
	<tr><td>ID</td><td><tt>org.eclipse.emf.codegen.ecore.Generator</tt></td></tr>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    59
	<tr><td>Class</td><td><tt>org.eclipse.emf.codegen.ecore.Generator</tt></td></tr>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    60
</table>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    61
<p>In order to run these or any other Eclipse application, you need to execute the following 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    62
command (without the line breaks):</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    63
<p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    64
eclipse
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    65
<br/>&nbsp;&nbsp;-noSplash
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    66
<br/>&nbsp;&nbsp;-data <i>&lt;full path to a workspace - ideally an empty directory&gt;</i>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    67
<br/>&nbsp;&nbsp;-application <i>&lt;application ID&gt;</i>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    68
<br/>&nbsp;&nbsp;<i>&lt;application arguments&gt;</i>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    69
</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    70
<p>In Windows you should execute <i>eclipsec</i> instead of <i>eclipse</i> in order to have
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    71
access to the application's console output.</p> 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    72
<p>The directory &quot;examples/library/build&quot; has shell scripts that generate the code for
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    73
the model provided.  If you have any questions after reading and experimenting with it, look at the 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    74
applications's javadoc for more details.  Also, check the application's class  
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    75
&quot;getUsage()&quot; method for the list of possible arguments.</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    76
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    77
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    78
<h3><a name="antTasks">XSD Ant Task</a></h3>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    79
<p>The XSD task details are:</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    80
<table border="1" cellpadding="2" cellspacing="0" 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    81
summary="Lists the details about the XSD task.">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    82
	<tr><td>Name</td><td><tt>emf.XSD2Java</tt></td></tr>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    83
	<tr><td>Class</td><td><tt>org.eclipse.xsd.ecore.importer.taskdefs.XSDGeneratorTask</tt></td></tr>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    84
</table>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    85
<p>This is the usual command line to run an Ant script using a headless Eclipse instance (remove the line breaks):</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    86
<p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    87
eclipse
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    88
<br/>&nbsp;&nbsp;-noSplash 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    89
<br/>&nbsp;&nbsp;-data <i>&lt;full path to a workspace - ideally an empty directory&gt;</i>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    90
<br/>&nbsp;&nbsp;-application org.eclipse.ant.core.antRunner
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    91
<br/>&nbsp;&nbsp;-buildfile <i>&lt;full path to your script&gt;</i>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    92
</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    93
<p>In Windows you should execute <i>eclipsec</i> instead of <i>eclipse</i> in order to have
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    94
access to the Ant build script console output.</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    95
<p>You can also use the Eclipse UI to execute an Ant script containing an EMF task.  This can be 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    96
done by right-clicking the script and selecting 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    97
<i>Run As &gt; Ant Build... &gt; JRE &gt; "Run in the same JRE as the workspace&quot;</i>.</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    98
<p>The directory &quot;examples/library/build&quot; has an Ant script that generate the code for
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    99
the model provided.  The task's javadoc has lots of information you may find useful.</p>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   100
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   101
</body>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   102
</html>