Skip to content
Paul Schwartz edited this page Jun 2, 2015 · 1 revision

There are two ways to add menus in openELIS, statically through menu.xml and dynamically through the plugins

###menu.xml

Menu.xml is in the base of liquibase tree. Unlike the way the rest of liquibase is organized a new menu.xml is not created for each release. This was done so all of the menu could be seen in one file. The file is divided into three main sections. The top section is the common menu items for all configurations except RetroCI. The next section is for the customization of each configuration and the last section is the complete menu configuration for RetroCI.

Liquibase will use menus.xml to populate the DB. Below is a snippet that is marked up to explain what the different elements mean.

    <insert schemaName="clinlims" tableName="menu"> each insert element represents a single menu item
		<column name="id" valueNumeric=" nextval( 'menu_seq' ) " /> this is the primary key, the numeric value will always be nextval( 'menu_seq' )
		<column name="presentation_order" valueNumeric="2" /> this is the order of this menu item under the parent menu.  The order the menu items appear in the file don't matter
		<column name="element_id" value="menu_sample" /> It doesn't matter what the value is but it must be unique.  It is used for identifying parent menu items
		<column name="display_key" value="banner.menu.sample" /> the key for name on the menu item.  If you just want to change the name on the menu then edit the value of the key in the MessageResource.properties file or MessageResource_fr.properties file
		<column name="tool_tip_key" value="tooltip.bannner.menu.sample" /> the key for the tooltip.  We currently don't show tool tips for the menu.  It is easiest to make the key the same value as the display_key value 
	</insert>
	<insert schemaName="clinlims" tableName="menu">
		<column name="id" valueNumeric=" nextval( 'menu_seq' ) " />
		<column name="parent_id"
			valueNumeric=" ( select id from clinlims.menu where element_id = 'menu_sample' ) " /> this identifies this as a submenu of the above menu item
		<column name="presentation_order" valueNumeric="1" /> this is the first submenu item
		<column name="element_id" value="menu_sample_add" />
		<column name="action_url" value="/SamplePatientEntry.do" /> the action which will be triggered when the menu item is selected
		<column name="display_key" value="banner.menu.sampleAdd" />
		<column name="tool_tip_key" value="tooltip.bannner.menu.sampleAdd" />
	</insert>
	<insert schemaName="clinlims" tableName="menu">
		<column name="id" valueNumeric=" nextval( 'menu_seq' ) " />
		<column name="parent_id"
			valueNumeric=" ( select id from clinlims.menu where element_id = 'menu_sample' ) " />
		<column name="presentation_order" valueNumeric="2" />this is the second submen item
		<column name="element_id" value="menu_sample_edit" />
		<column name="action_url" value="/SampleEdit.do?type=readwrite" />
		<column name="display_key" value="banner.menu.sampleEdit" />
		<column name="tool_tip_key" value="tooltip.banner.menu.sampleEdit" />
	</insert> 

###plugins

The menu items for the plugins are added dynamically and most of the details are handled in PluginMenuService.java. See the wiki section on analyzer plugins for more details.

Clone this wiki locally