First Steps with MDR

Note: Before you start using MDR, make sure that you have all the MDR modules installed and enabled in NetBeans (see installation instructions for more info).

Using FreeStyle Browser

The instructions depend on whether you want to use the old FreeStyle Browser to access the MDR (this is the only way to access it in NetBeans 3.3.2 or older) or the new MDR Explorer. To start using MDR using the FreeStyle browser make sure it is installed and follow these steps:
  1. Go to "View" menu, you should see "FreeStyle Browser" as one of items in this menu. Click on it - a new FreeStyle browser window will pop up.
  2. Right-click on the root node in the window ("NetBeans - FreeStyle") - choose "Set Look"->"Metadata" in the pop-up menu that will appear.
  3. Now you can see a node representing the MDR and after expanding it, you can see the content of the repository.
  4. The topmost nodes under the repository node represent instances of some metamodels. The clean repository should contain only one instance of the metamodel of MOF (named MOF) with metamodel of MOF loaded into it. Content of instance of any metamodel can be viewed using the "default" look - this look displays all the class/association/package proxies under the package instance (which is also a package proxy) and then instances of a particular class under the corresponding class proxy. For instances of the metamodel of MOF there is also option to switch to "MofModel" look which is MOF metamodel specific and shows the instance content in a more user friendly way - based on MOF's Contain association. To switch looks right-click on an instance node and choose the look you want in the "Set Look" submenu of the displayed pop-up menu. (To learn more about FreeStyle Browser and Looks go to FreeStyle Browser homepage.)
  5. To create a new instance of some MOF package, browse to the package you want to instantiate (e.g. Model package in the metamodel of MOF by expanding MOF->Package) and choose "Instantiate" from the pop-up menu. You will be asked to enter a name for the new instance. After refreshing the view (e.g. by switching look on the root node to some other look and then back to "Metadata" look) you should see this new instance under the repository node. (Automatic refresh will work after the event notification mechanism will be finalized.)
  6. You can import an XMI file to any instance of the corresponding metamodel (e.g. you can load XMI files containing MOF metadata only to instances of MOF metamodel, not to instances of any other metamodel, etc.) by right-clicking on the instance and choosing "Import XMI" from the pop-up menu.
  7. To generate JMI interfaces, right-click on an instance of MOF metamodel that contains a description of a metamodel you want generate the interfaces for and choose "Generate JMI interfaces".

Using MDR Explorer

MDR Explorer provides all the functionality that FreeStyle Browser does. Please read the above section for the functionality overview and explanation. For the MDR Explorer specific instructions on how to run and use it see Using MDR Explorer.

Important note: If some fatal error occurs during a critical MDR operation, the MDR storage may get corrupted. Currently the storage recovery mechanism is not automatical. So if something like this happens, you will need to fix this problem manually by deleting the corrupted storage files. As a result of this, MDR will recreate the storage (during its first start) and all the user-created data will be lost. This is not a problem - we understand the MDR as a cache for a metadata rather than a primary source of metadata - your modules should not use MDR to store metadata that cannot be recalculated (e.g. in case of Java this can be easily done from the source files) if the MDR gets corrupted. If you need to store a metadata that don't have a primary source (like the Java source files), we recommend to serialize this metadata in XMI files (XMI writer that will enable you to export anything from the repository in form of XMI will be available soon). This will also give you ability to use version controling systems to version your metadata.
To delete the storage files go to %your_user_dir%/system/ and delete MDRepositories folder.