Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EATOP/metamodelgen
< EATOP
Revision as of 11:06, 9 April 2014 by Unnamed Poltroon (Talk) (→Step 3: Create EATOP Ecore metamodel)
Contents
Installation
Prerequistes
- Windows Vista, 7 (Linux or Mac is not supported)
- Enterprise Architect 9.1 or greater
- Download and install the latest Eclipse Modeling Tools 32 Bit package
Getting the source code
The source code of EATOP MMGen Tool is managed in a Git repository.
- Clone the git repository: git://git.eclipse.org/gitroot/eatop/org.eclipse.eatop.git
- Import all the plugins that are under metamodelgen folder into your workspace
Adding Enterprise Architect API
Make sure the Enterprise Architect 9.1 or greater has been installed on your computer.
- Copy eaapi.jar from your installation, e.g., C:\Program Files (x86)\Sparx Systems\EA\Java API, to:
org.eclipse.eatop.eaadapter/lib org.eclipse.eatop.metamodel/lib
- Copy SSJavaCOM.dll from your installation, e.g., C:\Program Files (x86)\Sparx Systems\EA\Java API, to:
org.eclipse.eatop.eaadapter org.eclipse.eatop.eaadapter/lib org.eclipse.eatop.metamodel org.eclipse.eatop.metamodel/lib
Setting the target platform
EATOP MMGen Tool provides target platform definitions for the two latest Eclipse releases. These target definitions are in the project org.eclipse.eatop.metamodelgen.tool.targetdefs.
- Open the target definition file xxx.target that corresponds to the Eclipse release you want to work with;
- Wait for the completion of the Resolving Target Definition operation. This may take a while, in particular at the first time, because all directly and indirectly required target platform plug-ins and features are being downloaded or updated as necessary during that operation. If errors occur, try to close and reopen the target definition file so as to re-trigger the target platform resolution;
- Click on link Set as Target Platform (in the upper right corner of the target editor).
User guide
Step 1: Create a project for EATOP metamodel
- Open menu File > New > Other..., select Java Projec. Click on Next.
- Set the project name, “org.eclipse.eatop.eastadl2112”. Click on Finish.
- Create a new folder “model” under this project. Copy the EATOP metamodel Enterprise Architect EAP file into the “model” file. Rename the file to be “eastadl2112.eap”.
Step 2: Import EATOP projects
Import the following projects from EATOP repository into the MMGen’s runtime workspace:
org.eclipse.eatop.common org.eclipse.eatop.common.ui org.eclipse.eatop.geastadl org.eclipse.eatop.geastadl.edit org.eclipse.eatop.serialization
Step 3: Create EATOP Ecore metamodel
Right click on the “eastadl2112.eap” file, open menu “EATOP – Generate EATOP Ecore MM”, select one of the following command:
- Generate (persistence mapping only) Ecore only: to generate persistence mapping Ecore only
- Generate Ecore + MM EMF Code: to generate persistence mapping Ecore and the metamodel code implementation
- Generate Ecore + XSD Schema: to generate persistence mapping Ecore and the XSD shcema
- Generate All (Ecore + MM EMF Code + XSD Schema): to generate persistence mapping Ecore, metamodel code implementation and the XSD schema.
Wait until the Ecore metamodel generation has been finished.
Note:
- Please make sure that the following resources should be removed before you start to generate the metamodel:
org.eclipse.eatop.eastadl2112: /src-gen, /META-INF, /model/eastadl2112.*, /model/geastadl.*, build.properties, plugin.properties, plugin.xml org.eclipse.eatop.eastadl2112
- At the end of the generation, a validation of the Ecore is performed. Some validation failure error is pumped up: "Generated the Ecore. Attention, the generated Ecore contains errors, please validate it to see the errors". It does not affect the generated metamodel, the reason is caused by some default values not setting. Just click on “OK”.