Poseidon for Ecore User Guide



  1. Poseidon for Ecore User Guide
    1. Overview
    2. Creating ECore elements on the diagram
      1. Creating EAnnotation
        1. Creating DetailsEntry for EAnnotation
      2. Creating ETypeParameter
    3. Import and Export
      1. Import
      2. Export
    4. "Poseidon Metamodel" extension of Poseidon for ECore
      1. Start creating Metamodel for Poseidon
      2. Load Poseidon Core Metamodel into Project


Overview

Poseidon for ECore is a graphical editor created with Poseidon for DSL framework. It is a graphical editor for EMF ECore models. Eclipse IDE provides a tree editor for ECore models, Poseidon for ECore provides a fully functional graphical ECore editor. Usage of the editor is pretty straight-forward (assuming that you are familiar with ECore).

Creating ECore elements on the diagram


There is a tools palette which allows you to create all the elements of ECore model:

You can create EClasses, EDataTypes and EEnums with the according tools. You can define EReferences to create references between elements. The "Inheritance" tool is used to set superclasses for an EClass.


Creating EAnnotation

You can create an EAnnotation for any element on the diagram via "Add" sub-menu in the context menu (invoked by right-clicking the mouse)

or, you can hit the Space bar when mouse pointer is over the desired element:


Creating DetailsEntry for EAnnotation


You can create DetailsEntry for the EAnnotation in the Model Browser. Just select the EAnnotation in the Model Browser, right-click the mouse, and then select "Create->Details Entry"



Creating ETypeParameter


Same as creating EAnnotation.


Import and Export


Import


You can import existing ECore models in Poseidon for ECore.
IMPORTANT:
  1. If the imported ecore model references another ecore model by file URI, it is assumed that the referenced ecore model file is located in the same folder as the imported one.
  2. Platform URIs are not supported because they can only be resolved (and created) in Eclipse IDE.

If the imported ecore model references another model, than the referenced model is read-only in Poseidon. For example, you created a simple ecore model using Eclipse IDE tree editor for ecore:
This model has an EClass "MyClass" with an attribute "myAttribute". The type of the "myAttribute" is EBoolean which is defined in another Ecore model "Ecore.ecore". So, if you import that model in Poseidon, you will see both "My" and "ecore" packages, but "ecore" package will be read-only. You can drag-drop elements from the "ecore" package to the diagram, but you cannot change their properties.




Export


Poseidon stores its' models in xmi format. You can export your project into standard ecore model (an *.ecore file) using main menu item "Ecore -> Generate Ecore Model"



"Poseidon Metamodel" extension of Poseidon for ECore

Poseidon for ECore has an extension which allows to create metamodels for editor created with Poseidon for DSL framework. There are 2 actions in the "Poseidon Metamodel" menu of Poseidon for Ecore:


Start creating Metamodel for Poseidon


Creating a new editor in Poseidon for DSL framework starts with creating a metamodel for the editor. Elements in that metamodel must be inherited from the "core" Poseidon metamodel. The action "Start creating Metamodel for Poseidon" simplifies creation of such a metamodel. This action creates a new model with several EPackages: "ecore", "dsl" and "user". It also creates a diagram with 3 basic elements on it: "PoseidonCoreNamedElement", "PoseidonCoreNamespace" and "PoseidonCoreDirectedRelationship". Additional tools category "Poseidon Metamodel" is added to palette to allow creation of Poseidon nodes and edges:


When you create a "Poseidon Node" element on the diagram, it is automatically inherited from "PoseidonCoreNamedElement"; "Poseidon Edge" element is automatically inherited from "PoseidonCoredirectedRelationship", etc

Still, you can model the same model using tools from standard "Ecore" tools palette, i.e you can create an EClass and then create an Inheritance from that EClass to, say, "PoseidonCoreNamedElement". It will be exactly tha same as creating a "Poseidon Node" element, but requires more manual actions from you. The EClass_1 from the picture below is exactly the same (except the name) as "PoseidonNode_1" from the picture above.


Load Poseidon Core Metamodel into Project


This action does almost the same thing as Start creating Metamodel for Poseidon action. The difference is that "Start creating..." action creates a completely new project and "Load Poseidon..." action loads Poseidon core metamodel into existing project.