repository package

The ModelAnt repository package wraps the features of NetBeans MDR metadata repository and provides Ant interface to it. It originates from the NetBeans MDRAnt project. The tasks in this package are slightly renamed and simplified the original ones. As of the Conventions, the tasks in this package have the common prefix “mdr”.

The repository initialization task <mdr> should be called first. It uses a local directory as a temporary storage for the repository’s files.

In order to load a modelĀ  in the repository, it is needed to:

  1. create a MOF extent using the task <mdr.instantiate> with just a name attribute provided to name the extent. For example:

    <mdr.instantiate name=”extent-name” />

  2. load in the MOF extent the meta-model using the <> with the extent name provided and the URI of the file name of the meta-model to load.
    1. The URI is used when loading the meta-model file trough a class loader, i.e. expected to find it in classpath.
    2. The file is used when loading the meta-model file from the local file system

    For example:

    < extent=”extent-name” uri=”uml13/01-12-02_Diff_modelant.xml”/>

  3. instantiate the root MOF package where to load the model, using the <mdr.instantiate> with the extent attribute and the qualified name of the meta-model package that represents the model repository. The name attribute gives the name of the mode-specific repository. For example:

    <mdr.instantiate extent=”extent-name” package=”UML”

  4. load the model in the model-specific repository. For example:

    < extent=”repository-name” file=”model-file”/>

NOTE: By convention the meta-model components of ModelAnt provide specific simplified macros

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.