widget.xml
The Widget Manifest file is required to create widgets in the Mashup Builder. For example, the Hello World Widget Manifest file is as follows:
<xml version="1.0" encoding='UTF-8'>
<Widget1 name="Hello World" group="Style Tools">
<Description2> Widget description</Description>
<Preview3>
<![CDATA[
<h2>Hello World</h2>
]]>
</Preview>
<Includes4>
<Include type="css" path="css/style.css" />
<Include type="css" path="/resources/static/css/style.css" />
</Includes>
<SupportWidgetsId5 arity="ZERO_OR_MANY" />
<SupportFeedsId6 arity="MANY" />
<SupportI18N7 supported="true" />
<OptionsGroup8 name="Configuration">
<Option9 id="person" name="Person" arity="ONE">
<Description10>Person you want to say Hello to</Description>
<Values11>
<Value>World</Value>
<Value>Tintin</Value>
</Values>
<Functions12>
<ContextMenu13>Pages()</ContextMenu>
<Display14>SetHeight(3)</Display>
<Check15>isPageName</Check>
</Functions>
</Option>
</OptionsGroup>
<DefaultValues16>
<DefaultValue name="person">World</DefaultValue>
</DefaultValues>
</Widget>
This file contains the following information:
|
# |
Element/tag |
Description |
|---|---|---|
|
1 |
Widget Declaration |
|
|
2 |
Description |
The widget’s description. |
|
3 |
Preview |
The preview can contain any text or HTML embedded using CDATA tags. |
|
4 |
Includes |
List of widget assets to inject in the page.
|
|
5 |
SupportWidgetsId |
Defines how this widget supports sub widgets.
If
you want to restrict the possibilities of sub widgets types, you can nest
WidgetId tags to describe them:
|
|
6 |
SupportFeedsId |
Defines how this widget supports feeds.
If you
want to restrict the possibilities of feed types, you can nest
|
|
7 |
SupportI18N |
Widget internationalization support.
|
|
8 |
OptionsGroup |
Declares an Option Group (displayed as a tab in the widget configuration).
|
|
9 |
Option |
Declares a widget Option.
|
|
10 |
Description |
User-friendly option description. |
|
11 |
Values |
Declares the option's value(s). Declaring several values will create a selection box. |
|
12 |
Functions |
A container to describe this Option's expected display, behavior, error checking, etc. |
|
13 |
ContextMenu |
Use this tag to specify the types of functions that will be available in the Value tab of the dynamic list displayed on the left of the widget properties panel:
|
|
14 |
Display |
Use this tag to specify how the property will be displayed. For example, you can force the property to act as a select box, force it to act as an input (default is Text area), force it to act as a password input, etc.
|
|
15 |
Check |
Error checking functions to validate user input.
|
|
16 |
Default Values |
Specifies the default value of the option (one of the values specified for the "Value" element). |