m2doc

Is it possible to add multiple variables to templates and configurations?


I'm using M2Doc on an EMF model and are able to generate a document with some model contents. The scope of the access to the model is at the moment limited to the single variable configured for the template and subsequently the configuration file. So I can only access a single file in the workspace project folder.

As my model contains information spread across multiple files: Is it possible to configure multiple variables, each connected to a different project file? All the configuration dialogs are actually lists, but there's no button to add additional line items.

Did I miss any setting? Is this planned for the future?

Thanks!


Solution

  • Yes, you can add calls to new variables in your template:

    { m:myVar2.name }
    

    Then, after saving your template, use the Template properties wizard to define the type of the new variable. It can be an EClass from your metamodel or a primitive type (String, Integer, ...). Then you will need to bind its value in your .genconf file.

    For the moment the genconf wizard doesn't allow binding of Sequence nor OrderedSet. There is an issue opened for that matter.