back to developer home
This Specification example illustrates a multi-command application. It extends the Web Wheel Application's functionality by allowing you to go backward or forward through its list of web links. You associate one (or more) tag with each direction.
Most notably observe the application element, which features two commands. Then notice how the command-id are used in the configuration of the text2integer-mapper block.
Commands are available to applications via the command-id-in pin on an application. We then map the command to an integer, which will influence the cycling direction within the links.
|
<?xml version="1.0" encoding="UTF-8"?> <specification xmlns="http://www.touchatag.com/schema/configurator/specification-1.0"> <application> <command id="next" name="Show next link"/>
<command id="previous" name="Show previous link"/>
</application>
<blueprint> <superblock id="bidirectionalWebWheel">
<property name="links">
<list>
<uri>http://www.touchatag.com</uri>
<uri>http://www.touchatag.com/developer</uri>
<uri>http://business.touchatag.com</uri>
<uri>http://groups.google.com/group/touchatag</uri> </list>
</property>
<breakdown>
<block id="t2i" ref="urn:touchatag:block:text2integer-mapper">
<property name="Mapping">
<map>
<entry>
<text>next</text> <integer>1</integer>
</entry>
<entry>
<text>previous</text>
<integer>-1</integer>
</entry>
</map>
</property>
</block>
<block id="cu" ref="urn:touchatag:block:cycling-uri">
<property name="URIs"><delegate as="links"/></property>
<!-- To ensure the first next yields the first URI -->
<property name="Index"><integer>-1</integer></property>
</block>
<block id="wl" ref="urn:touchatag:block:web-link"/>
</breakdown>
<wiringscheme>
<shunt from="command-id-in" to="t2i:in"/>
<wire from="t2i:out" to="cu:in"/>
<wire from="cu:out" to="wl:in"/>
<shunt from="wl:out" to="action-out"/>
</wiringscheme> </superblock> </blueprint> </specification>
|
In this example, we are using the following blocks :