Bi directional webwheel
Submitted by admin on Mon, 2009-09-07 16:30
Bidirectional Web Wheel
This example illustrates a multi-command application. Basically it is the Web Wheel application but instead of only moving forward, it can also move backwards by using another tag.
<?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://developer.touchatag.com</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>
Most notably observe the application element, which now features two commands. Observe that the ids are now relevant, since they are leveraged 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.
In this example, we are using the following blocks :
