Friday, March 1, 2013

Reusing Packages in Papyrus Model Repositories

In last week's instalment of the Papyrus Model Repository tech preview series, I showed how to create new models in a CDO repository. This week we look at reusing model content by importing packages and applying profiles from models stored in a repository.

The latest development on the cdo_kepler branch in Papyrus SVN refactors the "Import Package From Workspace" and "Apply Profile(s)" dialogs to support pluggable model import sources, including CDO repositories in addition to the Eclipse Workspace. Also, the workflow in these dialogs is stream-lined a bit and some of the code that handles profile migration is generalized to work with non-XMI resources. See the video after the break to take a tour.

 

The guts of the package import action are factored out into a new reusable dialog with an extension point that plugs in "package import sources". These provide the dialog with:

  • a content provider to present a tree in which to browse for models
  • a label provider for the tree content
  • validation of user selections
  • extraction of packages from the user selection

Workspace content is provided by default and the CDO integration plug-ins provide the contents of currently connected model repositories.

In the Juno release, for every model file that was selected by the user in the first package-import or apply-profile dialog, another dialog would pop up asking the user which packages(s) to import or profile(s) to apply from each file. This repetition of the dialog is now replaced by a single dialog that presents all of the packages/profiles found in all models selected by the user. In the case of importing packages, the dialog's selection tree has a second column in which the user elects whether to import or copy each package.

The package import dialog is sensitive to the context of the package into which the user is importing content. Each import source is queried whether it is supports importing into the user's selected package. This allows the CDO provider to be excluded for packages in workspace models, because dependencies from the workspace to a model repository are discouraged. However, the workspace import source is enabled on packages in the repository.

Check out the latest cdo_kepler branch in Papyrus SVN to take this for a spin, yourself!

No comments:

My blog has moved!

You will be automatically redirected to the new address.

If that does not occur, please visit http://www.damus.ca/blog/.