E-Terrasource Metamodel Quickstartguide
E-Terrasource Metamodel Quickstartguide
Guide
Copyright © 2010, 2012 ALSTOM Grid Inc. or Affiliate. All Rights Reserved.
Trademarks
“ESCA” and “HABITAT” are registered trademarks of ALSTOM Grid Inc. “eterra” is a
registered trademark and/or service mark of E-Terra, LLC, licensed for use by
ALSTOM Grid Inc. in connection with its e-terra family of products and services.
Other product and company names in these materials may be trademarks or registered
trademarks of other companies, and are the property of their respective owners. They are
used only for explanation and to the respective owners’ benefit, without intent to infringe.
Contents
1. Overview................................................................................................ 1
Change Summary
The following changes were made to this document for this release:
• Included detailed instructions for installing and using custom
e-terrahabitat and e-terraplatform database definitions in the
transformation environment.
• Minor editorial and formatting corrections.
4. Make sure that the SchemaID and the Model Authority Set Type are
both set to “MetaModel”.
9. Check for errors in the validation message log and correct them.
10. Export the project that contains your metadata customizations and
store it in a safe location.
11. From the Export toolbar, select “Export Workspace…” to export the
metamodel to an XML file on disk.
By default, the file is exported to the
<drive>\ETERRA\e-terrasource\export directory. The exported
MetaModel_MAS.xml file should be captured in Configuration Control.
4. Enter a name for the EMF project that is used to import the new ETS
Ecore model. Click Next.
At this point, files related to the new ETS Ecore model are generated.
When the process is completed, the Package Explorer on the left
displays a folder for the new project, and the main window displays a
window titled “Metamodel_MAS.genmodel”.
10. If the list of “Target definitions” is empty, click the Add button and add
“Default: Default Target for the running platform”.
11. Click Next, and then click Finish in the dialog box.
12. In the Preferences dialog box, click OK.
13. Select the box marked “Running Platform (Active)”.
14. In the Preferences dialog box, click OK.
This generates Java code into the “src” directory, as well as other
plug-in files.
16. Wait for the build that has started to complete.
17. Examine the project in the Package Explorer for any build errors,
indicated by red markers. Warnings are OK.
At this point, the plug-in for the new ETS Ecore model has been
generated. The next step is to deploy the plug-in.
18. On the Package Explorer, double-click the “plugin.xml” file under the
project.
19. In the main window, append “.qualifier” to the Version field, then click
the Save button in the toolbar.
22. Make sure that the only item selected in “Available Plug-ins and
Fragments” is the newly generated plug-in with the name you
specified.
28. You must now uninstall the previous ETS Ecore model. Select the
Installed Software tab.
You should see your new ETS Ecore model (the ID column matches
the project name from step 4). You should also see the previous ETS
Ecore model, the default being titled “AMF CIM/EMS v1 e-terrasource
Schema”.
30. When the Uninstall Details dialog box appears, click Finish.
31. When the uninstall completes, click the Restart Now button to restart
Eclipse.
32. In order for the e-terrasource CIM/XML import/export service to be
aware of the new metamodel, you must copy the Metamodel_MAS.rdfs
file that is generated by Eclipse to the e-terrasource server directory.
33. After copying the file, restart the e-terrasource CIM/XML import/export
service.
The RDFS file is located in the project you created. For the above
example, the file is located at:
<disk>:\ETERRA\e-terrasource\Transformation\
Workspace_Template_26\MyNewETSEcoreModel\model\
MetaModel_MAS.rdfs
34. You can now reference the new ETS Ecore model in the QVTO code.
Remember to update the URI in the “modeltype” statements, if
necessary.
For your convenience, a “cheat sheet” describing these steps is available
within Eclipse by clicking Help > Cheat Sheets, then expanding the Alstom
Transformation Framework folder and double-clicking “Importing ETS or
HDB schemas – converting to Ecore”.
15. The identity of each new entity version cannot be modified, so first
delete the ACLineSegment v1 metaSchemaVerEntityVer under
“CIM/EMS v2”. Then insert a new metaSchemaVerEntityVer record
and select the ACLineSegment v2 EntityVersion.
24. Check for errors in the validation message log and correct them.
28. For Oracle, use the SQL*Plus utility to execute the upgrade script in
the master schema.
A new schema version is created.
For SQL Server, copy the upgrade script directly to the database
machine into the ...\MSSQL\InstallScripts directory, and log in to an
account with administrative privileges. Open a PowerShell command
window, set your current directory to the above location, and run the
following sqlcmd to do the upgrade:
sqlcmd -U <MasterLogin> -P <MasterLoginPassword> -d <database>
-i <upgrade_script_file> -b -S <Server>
31. Export the project that contains your metadata customizations and
store it under Configuration Control.
4. Enter a name for the EMF project that is used to import the new ETS
Ecore model.
The name should reflect the Ecore version being created. For
example, if the new schema version to be supported after the update is
the CIM/EMS schema version 2, the project should be named
“CIM_EMS__v2”. Click Next.
At this point, files related to the new ETS Ecore model are generated.
When the process is completed, the Package Explorer on the left
displays a folder for the new project, and the main window displays a
window titled “Metamodel_MAS.genmodel”.
12. Click Next, and then click Finish in the dialog box.
13. Select the box marked “Running Platform (Active)”, and then click OK
in the Preferences dialog box.
14. In the main window, right-click the model node, and select “Generate
Model Code”.
This generates Java code into the “src” directory, as well as other
plug-in files.
15. Wait for the build that has started to complete.
16. Examine the project in the Package Explorer for any build errors,
indicated by red markers. Warnings are OK.
At this point, the plug-in for the new ETS Ecore model has been
generated. The next step is to deploy the plug-in.
22. Select the “Install into host” radio button. The default Repository name
can be left as is. Click Finish.
23. The plug-in deployment takes place. If a security warning is displayed
regarding unsigned content, click OK.
24. When prompted to restart Eclipse, click the Restart Now button.
25. After Eclipse restarts, on the Help menu, click About.
26. In the dialog box, click the Installation Details button, and then select
the Plug-ins tab.
You should be able to see the new ETS Ecore model as a plug-in. The
plug-in ID matches the project name you specified in step 4.
5. If the list of “Target definitions” is empty, click the Add button and add
“Default: Default Target for the running platform”.
14. Click “Browse File System” to locate the DBDEF file from step 1.
15. Adjust the e-terraplatform version number in the Base URI field if
necessary.
Note: It is very important that the Base URI reflect the correct version
of the schema. If the Base URI needs to be updated, you must re-click
the Load button to re-load the model before clicking Next.
At this point, files related to the new Hdb Ecore model are generated.
When the process is completed, the Package Explorer on the left
displays a folder for the new project, and the main window displays a
window titled “<database>.genmodel”.
Note: The extension “.genmodel” is an Eclipse term that has nothing to
do with the e-terraplatform Generation Model (GENMODEL)
application.
29. On the next screen, make sure that the only item selected in the
“Available Plug-ins and Fragments” is the newly generated plug-in with
the name you specified.
4. Enter a name for the EMF project that is used to import the new ETS
Ecore model. Click Next.
6. Modify the Base URI to correctly represent the name and version of
the custom database.
7. After updating the URI, click “Browse File System” to locate the
DBDEF file from step 1.
8. Adjust the URI name and version number in the Base URI field if
necessary.
At this point, files related to the new Hdb Ecore model are generated.
When the process is completed, the Package Explorer on the left
displays a folder for the new project, and the main window displays a
window titled “<database>.genmodel”.
Note: The extension “.genmodel” is an Eclipse term that has nothing to
do with the e-terraplatform Generation Model (GENMODEL)
application.
14. If the list of “Target definitions” is empty, click the Add button and add
“Default: Default Target for the running platform”.
This generates Java code into the “src” directory as well as other
plug-in files.
18. Wait for the build that has started to complete.
19. Examine the project in the Package Explorer for any build errors,
indicated by red markers. Warnings are OK.
At this point, the plug-in for the new Hdb Ecore model has been
generated. The next step is to deploy the plug-in.
20. Open the plugin.xml file in the newly created project and
22. Right-click the project in the Package Explorer and select “Export”.
24. Make sure that the only item selected in “Available Plug-ins and
Fragments” is the newly generated plug-in with the name you
specified.
31. You can now reference the new Hdb Ecore model in the QVTO code.