Configuring toolbar and context menu items
You configure the toolbar and context menu functionality that is available to users by editing attributes in the BIRT Studio configuration file, erni_config.xml. This file is located in:
<context root>\WEB-INF
Customizations you make to erni_config.xml apply at the application level. If you want different sets of functionality available to different groups of users, you need to create multiple instances of the web application, then customize the functionality of each BIRT Studio instance.
In erni_config.xml, the <actionSets> element defines all the user actions that can be enabled or disabled. The actions are organized by category, for example, file operations, calculations, and formatting. The <actionSet> element defines the category, and the <action> element defines a specific action. Listing 4‑1 shows the hierarchy of elements.
Listing 4‑1 An example of an <actionSet> element in erni_config.xml
<actionSets>
<actionSet>
<name>FileOperations</name>
<visible>true</visible>
<action>
<name>New</name>
<enabled>true</enabled>
</action>
<action>
<name>Open</name>
<enabled>true</enabled>
</action>
<action>
<name>Save</name>
<enabled>true</enabled>
</action>
<action>
<name>SaveAs</name>
<enabled>true</enabled>
</action>
</actionSet>
By default, all actions are enabled. You can disable actions in the following ways:
*To disable a particular action, change the action’s <enabled> attribute from true to false.
*To disable all actions within a category in one step, change the action set’s <visible> attribute from true to false.
For the changes to take effect, restart the appropriate Windows service. When you relaunch BIRT Studio, the toolbar displays different buttons and the context menus display different items, depending on which action or actions you disabled.
Configurable actions
Table 4‑1 lists toolbar and context menu actions that you can enable or disable. Some of the actions appear in both the toolbar and context menus, and some appear in context menus only. While you can disable any of the actions defined in erni_config.xml, it does not make sense to disable all the actions. For example, disabling both the New and Open actions under file operations prevents a user from creating or opening reports.
Table 4‑1 User actions that you can enable or disable through
erni_config.xml
Action set
Action
Description
Calculations
Aggregation
Performs a calculation over a specified set of data rows.
 
Calculation
Creates a calculated column, based on a specified expression.
 
ChangeSubtotal
Changes the subtotal function, applied to a column in a summary table.
 
Chart
Inserts a chart.
 
DataFields
Shows the data fields in the report, and supports adding or deleting fields in the report.
 
EditCalculation
Changes a calculated column.
 
Filter
Filters table rows, based on a specified condition.
ColumnHeader
Operations
DeleteRow
Deletes the row of the selected column header.
 
InsertRow
Inserts a row above or below the selected column header.
 
Merge
Merges the selected column header with the header on the right, left, or above.
 
Split
Splits the selected merged columns.
ColumnOperations
ColumnWidth
Changes the width of the selected column.
 
HideColumn
Hides the selected column.
 
MergeColumns
Merges the selected columns.
 
MoveToDetail
Moves the selected item in the group header row to the table’s detail row.
 
MoveToGroup
Moves the selected item in the table’s detail row to the group header row.
 
NoRepeat
If duplicate data values appear in the selected column, displays only the first instance.
 
ReorderColumns
Changes the order of the columns in the table.
 
RepeatValues
Displays duplicate data values in the selected column.
 
ShowColumns
Shows the selected columns.
CrosstabOperations
Analyze
Opens Data Analzyer.
 
Delete
Deletes a cross tab.
 
Edit
Opens the cross tab builder.
 
SwitchView
Switches the cross tab view.
ManageData
ManageData
Opens the Manage Data dialog.
DeleteColumn
DeleteColumn
Deletes a column from a table in the report.
EditText
EditText
Enables editing of the selected static text.
FileOperations
New
Creates a new report design file.
 
Open
Opens an existing report design.
 
Save
Saves the current report design.
 
SaveAs
Saves the current report design file under a different name or in a new location.
Formatting
AlignCenter
Centers the text in the selected column.
 
AlignLeft
Aligns the left sides of text in the selected column.
 
AlignRight
Aligns the right sides of text in the selected column.
 
Border
Draws a border around the selected column.
 
Conditional
Format
Formats data in a selected column, based on a specified condition.
 
Data
Formats the display of data in the selected column.
 
Font
Formats the font of data in the selected column.
GeneralOperations
Parameter
Displays the parameters, if any, for the current report.
 
SwitchSummary
Mode
Switches between summary table mode and detail table mode for the selected table.
 
TableBuilder
Enables the table builder wizard.
Grouping
CreateSection
Adds a report section, which provides an additional level of data grouping.
 
DeleteSection
Removes the selected report section.
 
GroupBy
Groups table rows by values in the selected column.
 
HideDetail
Hides the detail rows in a report section.
 
PageBreak
Adds page breaks before or after a report section.
 
ShowDetail
Shows the detail rows in a report section.
 
UngroupBy
Removes groups in the selected column.
Help
Help
Shows help information.
PageLayout
PageLayoutIn
Toolbar
Displays page layout toggle under toolbar. Disabled by default.
Preview
PreviewHTML
Shows a preview of the report in HTML format.
ReportItemOperations
Bookmark
Assigns a bookmark to a report item.
 
Hyperlink
Assigns a hyperlink to a report item.
SectionOperations
SectionHeading
Shows the data fields in the report, and supports adding fields to the selected section heading.
Sorting
AdvancedSort
Sorts the table rows by the values of multiple columns.
 
SortAscending
Sorts, in ascending order, the table rows by the values of the selected column.
 
SortDescending
Sorts, in descending order, the table rows by the values of the selected column.
TemplateTable
Operations
AutoSummarizeOn
If set to true, creates a summary table by default. If set to false, creates a detail table by default.
UndoRedo
Redo
Redo the last action.
 
Undo
Undo the last action.
Configuration examples
This section provides examples of editing attributes in erni_config.xml, and the resulting changes to the BIRT Studio page.
Figure 4‑4 shows the default BIRT Studio page with all actions enabled. The formatting actions on the toolbar and context menu are called out, so that you can see the difference in the toolbar and context menu when these actions are disabled.
Figure 4‑4 Default BIRT Studio page
Listing 4‑2 shows a change to the Formatting action set. Its <visible> attribute, shown in bold, is set to false. Note, however, that all the actions under the Formatting action set are still enabled.
Listing 4‑2 Visibility of the Formatting action set, changed to false
<actionSet>
<name>Formatting</name>
<visible>false</visible>
<action>
<name>AlignLeft</name>
<enabled>true</enabled>
</action>
<action>
<name>AlignCenter</name>
<enabled>true</enabled>
</action>
<action>
<name>AlignRight</name>
<enabled>true</enabled>
</action>
<action>
<name>Font</name>
<enabled>true</enabled>
</action>
<action>
<name>Border</name>
<enabled>true</enabled>
</action>
<action>
<name>ConditionalFormat</name>
<enabled>true</enabled>
</action>
<action>
<name>Data</name>
<enabled>true</enabled>
</action>
</actionSet>
Figure 4‑5 shows the updated BIRT Studio page. None of the formatting actions appear in the toolbar or the context menu. Setting the <visible> attribute of an action set to false disables all actions within the action set.
Figure 4‑5 Updated toolbar and context menu, without any formatting functions
Listing 4‑3 shows changes to the Font and Data actions within the Formatting action set. The Formatting action set’s <visible> attribute is set to true. The Font and Data actions are disabled. The other actions in the action set are still enabled.
Listing 4‑3 Font and Data (formatting) actions disabled
<actionSet>
<name>Formatting</name>
<visible>true</visible>
<action>
<name>AlignLeft</name>
<enabled>true</enabled>
</action>
<action>
<name>AlignCenter</name>
<enabled>true</enabled>
</action>
<action>
<name>AlignRight</name>
<enabled>true</enabled>
</action>
<action>
<name>Font</name>
<enabled>false</enabled>
</action>
<action>
<name>Border</name>
<enabled>true</enabled>
</action>
<action>
<name>ConditionalFormat</name>
<enabled>true</enabled>
</action>
<action>
<name>Data</name>
<enabled>false</enabled>
</action>
</actionSet>
Figure 4‑6 shows the updated BIRT Studio page. The alignment actions are available on the toolbar and on the context menu, but not the Font and Data formatting actions.
Figure 4‑6 Updated toolbar and context menu, without the Font and Data formatting actions