Raw XML Module Built-In Script
All of the UI Fragment built-in scripts produce XML that is similar to, but not interchangeable with, XML found in a plugin descriptor. You will notice that, for usability reasons, the forms do not provide all the possible configuration elements available in plugins. For example, the web item built-in script form does not give you the option to provide a tooltip for the web item link or a velocity context provider.
You can work around this limitation by using the XML provided by the other UI Fragment built-in scripts and then adding to it using the raw XML module built-in script:
Examples
Add a tooltip
As a simple example, we want to add a button to the top navigation bar, as described on our Fragments Tutorial page. We want to do more than what this tutorial describes as we want to also add a tooltip to the button. To do so we would do the following:
Use multiple items
You can use this built-in script to make multiple modifications that belong as a single unit in a single script, which you can enable and disable at once.
The XML below allows you to create the following structure, which consists of:
- A drop-down menu in the top navigation bar
- A web section activated by that menu item, which has a heading
- Two simple web items
<web-item key='toppy' name='ScriptRunner generated web item - toppy' section='system.top.navigation.bar' weight='70'>
<label>Toppy</label>
<link linkId='toppy'></link>
</web-item>
<web-section key='top-menu-section' name='ScriptRunner generated web item - top-menu-section' location='toppy' weight='70'>
<label>Subby</label>
<param name='lazy' value='true' />
</web-section>
<web-item key='x-other' name='ScriptRunner generated web item - x-other' section='toppy/top-menu-section' weight='1'>
<label>Sub-menu item</label>
<link linkId='x-other'>/</link>
</web-item>
<web-item key='y-other' name='ScriptRunner generated web item - y-other' section='toppy/top-menu-section' weight='1'>
<label>Another menu item</label>
<link linkId='y-other'>/</link>
</web-item>