UrsZeidler / shr5rcp

The shadowrun 5 rich client platfrom is a model driven project for managing shadowrun resources. A shadowrun 5 character generator for example ...
http://urszeidler.github.io/shr5rcp/
49 stars 9 forks source link

Add extension point for acceleo generators. #207

Closed UrsZeidler closed 9 years ago

UrsZeidler commented 9 years ago

We need to provide an extension point for the model to text engine. The extension point need to define:

The current acceleo plugin will use these extension point. So we can change inverse the dependency which is currentl bad design.

Other people could provide new model to text transformations.

UrsZeidler commented 9 years ago

The extension point is used by the default export dialog,

Identifier: de.urszeidler.shr5.m2t.de.urszeidler.shr5.m2t Since: 0.2.9 Description: A register point for acceleo based model to text transformations. Configuration Markup:

 <!ELEMENT extension (Transformer)*>
 <!ATTLIST extension
  point CDATA #REQUIRED
  id    CDATA #IMPLIED
  name  CDATA #IMPLIED>

  <!ELEMENT Transformer (TransformerMapping)+>
  <!ATTLIST Transformer
   acceleoGenerator CDATA #REQUIRED
   name             CDATA #REQUIRED
   description      CDATA #IMPLIED
  dialogImage      CDATA #IMPLIED>

Defines an acceleo generator which transform a given model object to a file.

All classes which the generator can make use of.

Examples: See de.urszeidler.shr5.acceleo.

 <Transformer
        acceleoGenerator="de.urszeidler.shr5.acceleo.sheets.BoardCharacterSheet"
        description="%Transformer.bbcharactersheet.description"
        dialogImage="images/textTransformations.png"
        name="%Transformer.bbcharactersheet.name">
     <TransformerMapping
           class="de.urszeidler.eclipse.shr5Management.NonPlayerCharacter"></TransformerMapping>
     <TransformerMapping
           class="de.urszeidler.eclipse.shr5Management.PlayerCharacter">
     </TransformerMapping>
     <TransformerMapping
           class="de.urszeidler.eclipse.shr5Management.CharacterGroup">
     </TransformerMapping>
  </Transformer>