XML Minibrowser#
A D-Series phone can download and display customer provided content using the XML Minibrowser. This process
-
downloads a XML file
-
parses its contents
-
displays a menu, which the user can navigate and interact with.
-
processes user actions
Setup#
To setup a working Minibrowser infrastructure you need just a webserver that provides the Minibrowser xml-files. A configured key is the simplest way to invoke the Minibrowser. Just choose minibrowser as type and enter the url to your webserver. The key invokes the http request, the Minibrowser engine then renders and displays the content.
Syntax: see examples below and minibrowser.xsd
Functions#
A menu contains a set of Items. Each item can have multiple defined actions. The actions can range from downloading another document to initiating a call or preparing a dial that the user can then complete.
The following example shows the interaction, that can be achieved:
<?xml version="1.0" encoding="UTF-8"?>
<Menu xmlns="minibrowser_v01.xsd">
<Title>Contacts</Title>
<Item>
<TextLine>
<Text>John Doe</Text>
</TextLine>
<AutomatedActions>
<Url on="do it">http://my.server.tld/details_john_doe.xml</Url>
<Dial on="make call, mb make call">71</Dial>
</AutomatedActions>
</Item>
</Menu>
<?xml version="1.0" encoding="UTF-8"?>
<Menu xmlns="minibrowser_v01.xsd">
<Title>John Doe (Details)</Title>
<Item>
<TextLine>
<Text>Name: John Doe</Text>
</TextLine>
</Item>
<Item>
<TextLine>
<Text>Number: 71</Text>
</TextLine>
<AutomatedActions>
<Dial on="do it, make call, mb make call">71</Dial>
</AutomatedActions>
</Item>
</Menu>
On key press, minibrowser.xml
is served by the webserver.
The list (titled 'Contacts') contains one item, which supplies two different actions: do it
and make call
.
The OK key on phone activates the do it
action.
The Hook or Speaker keys would for example invoke the make call
action.
On do it
the phone downloads the URL and displays details_john_doe.xml
.
In this document, the name has no associated actions, while most actions on the number item start a call.
Actions and Order of Execution#
The minibrowser has the following actions (see syntax in XSD)
The document can state actions in every single item and general actions.
Actions are executed when a certain trigger occurs (e.g. do it
, make call
). Each action defines which trigger(s) cause it to execute. When a trigger-signal is generated:
-
first all actions listed in the currently selected item get executed
-
next all general actions for that trigger get executed
-
last the default action for that trigger executes (e.g. close the minibrowser on trigger
mb exit
) A trigger can be stopped with the Stop-action. When this action gets executed, the above execution-chain stops.
Url#
The Url action executes a http GET request with the given URL.
Dial#
The Dial action invokes a call on the device. Using the min_len attribute, the phone can prepare a number for the user to complete.
Timer actions#
The timer actions allow the execution of triggers after a given timeout. Using the timer capabilities, a dialog can close itself after 25 seconds of inactivity.
<Dialog xmlns="minibrowser_v01.xsd">
<Title>Activate Lamp?</Title>
<Text>Press OK to accept</Text>
<AutomatedActions>
<StartTimer on="shown" timer_id="MainTimer" timeout="25000ms" />
<RestartTimer on="user activity" timer_id="MainTimer" />
<Trigger on="timeout MainTimer">mb back</Trigger>
<StopSignal on="back" />
<Url on="do it">http://my.server.tld/activate_lamp</Url>
</AutomatedActions>
</Dialog>
Handling Inputs#
<?xml version="1.0" encoding="UTF-8"?>
<Menu xmlns="minibrowser_v01.xsd">
<Title>Input</Title>
<Item id="1">
<TextInput>
<Default/>
<Help>Enter your info</Help>
<InputMode>alphanumeric</InputMode>
<InputType>plain</InputType>
<Parameter>user_input</Parameter>
</TextInput>
<AutomatedActions>
<Url on="changed" answer="show">http://my.server.tld/input</Url>
<Url on="edit done" answer="show">http://my.server.tld/final_input</Url>
</AutomatedActions>
</Item>
<Item>
<TextLine>
<Text>Save</Text>
<AutomatedActions>
<Url on="do it" answer="show">http://my.server.tld/save</Url>
</AutomatedActions>
</TextLine>
</Item>
<Options>
<Option>
<Text>Save</Text>
<Url on="do it" answer="show">http://my.server.tld/option_save</Url>
</Option>
</Options>
</Menu>
The file mentioned above presents interactions combined with user input.
It defines a TextInput
field and specifies several attributes like for instance the input type.
The element Parameter
specifies the name of the parameter used in the Urls query string.
The TextInput
item has two associated AutomatedActions
.
The first url-action is triggered by a changed
signal and is called every time the user changes the text.
When a user enters a o
, the phone sends a HTTP request to http://my.server.tld/input?user_input=o
. When next a k
is entered, the resulting HTTP request will contain user_input=ok
in its query.
When the user leaves the input mask (with OK or a navigation key) the phone invokes the edit done
signal which triggers the 2nd url-action to send a request to http://my.server.tld/final_input?user_input=ok
.
The document also provides 2 opportunities for the user to click "Save". It presents a 2nd menu-item wich can be used to issue a save-command and an Option
"Save", which is preseted on one of the phones softkeys.
The phone appends all available input parameters to all url-actions it fires. E.g. if the menu would contain multiple TextInput
fields then all values would always be added. Each TextInput
must have a different Parameter
name for this to work.
Accepted File Formats#
The Minibrowser engine tries to be compliant with XML files using common dialects of other companies like snom or tiptel.
For example, the phone accepts the following document:
<?xml version="1.0" encoding="UTF-8"?>
<TiptelIPPhoneTextMenu Beep="yes" style="numbered">
<Title>Phone register</Title>
<MenuItem>
<Prompt>Tiptel.com</Prompt>
<URI>http://my.server.tld/more_info_about_tiptel.xml</URI>
<Dial>004921024280</Dial>
</MenuItem>
<MenuItem>
<Prompt>My dentist</Prompt>
<URI>http://my.server.tld/info_about_dentist.xml</URI>
<Dial line="2">00800123412341234</Dial>
</MenuItem>
<SoftKey index="4">
<Label>Dial</Label>
<URI>SoftKey:Select</URI>
</SoftKey>
</TiptelIPPhoneTextMenu>
and interprets it as:
<?xml version="1.0" encoding="UTF-8"?>
<Menu xmlns="minibrowser_v01.xsd">
<Title>Phone register</Title>
<Item>
<TextLine>
<Text>Tiptel.com</Text>
</TextLine>
<AutomatedActions>
<Url on="do it">http://server/more_info_about_tiptel.xml</Url>
<Dial on="make call, mb make call">004921024280</Dial>
</AutomatedActions>
</Item>
<Item>
<TextLine>
<Text>My dentist</Text>
</TextLine>
<AutomatedActions>
<Url on="do it">http://server/info_about_dentist.xml</Url>
<Dial on="make call, mb make call">00800123412341234</Dial>
</AutomatedActions>
</Item>
<AutomatedActions>
<Beep on="shown" />
</AutomatedActions>
<Options>
<Option>
<Text>Dial</Text>
<Trigger for="item">do it</Trigger>
</Option>
</Options>
</Menu>
Tuning the Documents#
Support for multiple languages#
Every text element in the document can contain a language attribute. This enables the phone to select the text elements using its configured language.