Using Existing Files with the QVTr Editor

For the purpose of this discussion we assume that
  • you wish to edit a QVTr transformation in my/file.qvtr within your ModelProject project
  • the transformation refers to meta-models MM1 and MM2
  • the MM1 metamodel is available as model/meta-model1.xml within your MetaModelProject project.
  • the MM2 metamodel has been installed by an Eclipse plug-in as "http://meta-model2" in the EMF Package Registry, and that it was built with a *.ecore file in the same folder as its *.genmodel file.
  • [Since the QVTr Editor uses the Model Registry, the meta-models may be defined using EMOF or Ecore regardless of their file extension. The meta-model may even use a non-XML form if a suitable to-Ecore translator has been registered.]

    Step 1: Add QVTrelation Nature to the Model Project

    Select ModelProject and from the right button menu invoke Add QVTrelation Nature.

    [The QVTrelation Nature must be added for the QVTr problem markers to be maintained.]

    Step 2: Add Model Registry Nature to the Model Project

    Select ModelProject and from the right button menu invoke Add Model Registry Nature.

    [The Model Registry Nature must be added for Model Registry Property Pages to be used.]

    Step 3: Bind Meta-Model References

    Invoke Properties, Model Registry from the right button menu of ModelProject to open up the Model Registry Property Page.

    In the Property Page for the Model Name Accessor, invoke New...
    Enter MM1, and use Browse Workspace... to locate MetaModelProject/model/meta-model1.xml.
    Hit OK to complete the binding.
    Repeat for MM2, using Browse Registered Packages... to locate http://meta-model2.

    Finally hit OK to complete the registrations.

    [If your meta-models use a non-XML format, you should select that format in the serialization combo.]

    [If the required bindings for MM1 and MM2 vary between project files, define the bindings for each file rather than for the project. If the bindings are common to all files in a folder, define the bindings for the folder rather than each file.]

    Step 4: Edit your files

    From the Eclipse main menu invoke Project->Clean... for ModelProject, and any errors should appear in the Problems View.

    You may double click my/file.qvtr or a problem marker to open the editor.