Creating .hep files for the plug-ins

About this task

To provide IBM® Rational® Rhapsody® with the information necessary to load your plug-in, you must create a .hep file or add this information to an existing .hep file if you have already created one.

.hep file structure

About this task

To understand the types of information that must be included for plug-ins in .hep files, it is best to start with the issue of what types of elements can be described in .hep files.

.hep files are used to describe the following items:

  • helpers
  • Plug-ins
  • plug in commands

While these items differ from one another, they use the same .hep file entries to provide Rational Rhapsody with the required information.

Helpers are also used to extend the capabilities in the product, but they use a different mechanism than plug-ins. Helpers are stand-alone applications. Plug-ins use the callback mechanism to respond to events.

Plug-in commands describe menu items that Rational Rhapsody adds to allow you to open a certain plug-in.

For plug-ins, the .hep file must contain the following information:

  • the number of items (plug-ins/helpers/plug-in commands) defined in the file
  • the name of the plug-in
  • the Java class that implements the required methods
  • the Java classpath used by your plug-in
  • an indication that the item is a plug-in (not a helper or plug-in command)
  • an indication of whether a menu item must be added to the Tools menu

The best way to describe the required syntax for the .hep file is to look at an example.

[Helpers]

Category for the entries that follow

Note: The .hep file must contain a [Helpers] section because the helper recognition mechanism is the same one used when you include helper definitions in your rhapsody.ini file, which has other sections as well. Plug-ins are typically designed for use by groups of users, in most cases it does not make sense to include the plug-in definition information in the rhapsody.ini file, which is unique to each user.
numberOfElements=2

Number of plug-ins/helpers described in the file

name1=Diagram Formatter

The name that is displayed on the Tools menu (if isVisible is set to 1)

JavaMainClass1=JavaPlugin.PluginMainClass

The Java class containing the plug-in code

JavaClassPath1=$OMROOT\..\Samples\JavaAPI Samples\Plug-in

Path for locating the Java classes required by the plug-in. Keep in mind that if .jar files are used, the classpath must include the names of the .jar files.

isPlugin1=1

Indicates the item is a plug-in (as opposed to a helper, which is the default, or a "plug-in command")

isVisible1=1

Indicates that the name must be displayed in the Tools menu.

The entries below describe a "plug-in command"

name2=Format Diagram

The text that is displayed in the context menu

isPluginCommand2=1

Indicates a plug-in command (as opposed to a helper or plug-in)

command2=Diagram Formatter

The name of the plug-in opened by this context menu item

applicableTo2=ObjectModelDiagram

Indicates the context to which the menu is added. In this case, when you right-click an OMD in the browser, you see the option "Format Diagram."

isVisible2=1

Indicates that the menu item must be displayed

If you would like to see another sample .hep file, look at the .hep file for the plug-in sample included with <Rational Rhapsody installation path>\Samples\ExtensibilitySamples\
Simple Plug-in\SimplePluginProfile.hep
).

To attach your .hep file to a profile, do one of the following actions:
  • Give the .hep file the same name as the profile, and place it in the same directory as the .sbs file
  • Indicate the path to the .hep file in the value of the General::Profile::AdditionalHelpersFiles property for the profile

Feedback