Message
Message

This Specification example shows the XML to pop up a system tray message balloon that states, "Ta-dah!! Your tag has been read!"
<?xml version="1.0" encoding="UTF-8"?>
<specification xmlns="http://www.touchatag.com/schema/configurator/specification-1.0">
<application>
<command id="default" name="Show balloon message"/>
</application>
<blueprint>
<superblock id="urn:example:sample:message-app">
<property name="Message"><text>Ta-dah!! Your tag has been read!</text></property>
<breakdown>
<block id="ts" ref="urn:touchatag:block:text-source">
<property name="Value"><delegate as="Message"/></property>
</block>
<block id="m" ref="urn:touchatag:block:message"/>
</breakdown>
<wiringscheme>
<wire from="ts:out" to="m:in"/>
<shunt from="m:out" to="action-out"/>
</wiringscheme>
</superblock>
</blueprint>
</specification>
Explanation
Every Specification XML starts with the specification element. This element contains two elements, an application element and a blueprint element. The application element is used to advertise the tag-commands of the application, since this is a trivial application with only one logical tag-command, we can specify a basic tag-command. Following the recommendations, we will call it default.
Let's move on to the interesting part, being the blueprint. It should contain a superblock element, which requires an id attribute. Following the recommendations we will use the * id to illustrate its a don't care.
<blueprint>
<superblock id="*">
A superblock element has the following child elements.
breakdown
Now we can start to define and register our blocks in the elements blueprint.
<breakdown> ... </breakdown>
A block element has the following attributes:
- id: unique identifier in the xml for this block
- ref: reference to an existing block provided by touchatag
So in this example we are going to use text-source and message blocks.
<breakdown>
<block id="ts" ref="urn:touchatag:block:text-source">
A block can have properties that we can set.In our example the text-source has a property.
<breakdown>
<block id="ts" ref="urn:touchatag:block:text-source">
<property name="Value"><text>Ta-dah!! Your tag has been read!</text></property>
</block>
property
We can also specify properties in the blueprint xml. They are child elements of the superblock tag.
<superblock id="*">
<property name="Message"><text>Ta-dah!! Your tag has been read!</text></property>
We can give a property a name. In the property element of a block we can delegate it through a global property.
<breakdown>
<block id="ts" ref="urn:touchatag:block:text-source">
<property name="Value"><delegate as="Message"/></property>
</block>
In our example we are using the message property as a value in the text-source block.
wiringscheme
Our last step is wiring all the blocks together. We can do this in the wiringscheme element.
<wiringscheme>
...
</wiringscheme>
We have two types of wiring.
- wire: from an output pin to an input pin
<wiringscheme> <wire from="ts:out" to="m:in" />We wire the text output pin of the
text-sourceblock with identifiertsto the text input pin of themessageblockm. The from and to attributes have to follow the Pin Endpoint syntax. - shunt: from an input pin to an input pin or from an output pin to an output pin.
<wiringscheme> ... <shunt from="m:out" to="action-out" />We shunt the output pin of the
messageblock to the output pin of our superblock.
Troubleshooting
No pop-up on Windows
Make sure that this key in the Windows registry is set
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AdvancedDWORD EnableBalloonTips = 1
No pop-up on MacOS
Make sure that Growl is installed.
