Resource identifier blocks
Submitted by admin on Mon, 2009-09-07 16:30
Resource Identifier Blocks Example
This Specification example shows how to use the resource identifier blocks.
<?xml version="1.0" encoding="UTF-8"?>
<specification xmlns="http://www.touchatag.com/schema/configurator/specification-1.0">
<application>
<command id="default" name="Show next resource identifier example"/>
</application>
<blueprint>
<superblock id="resource-identifier-usage">
<breakdown>
<!-- Blocks for managing which resource identifier to show -->
<block id="index" ref="urn:touchatag:block:integer-register">
<property name="Value">
<integer>0</integer>
</property>
</block>
<block id="indexIncrement" ref="urn:touchatag:block:integer-source">
<property name="Value">
<integer>1</integer>
</property>
</block>
<block id="maxIndex" ref="urn:touchatag:block:integer-source">
<property name="Value">
<integer>5</integer>
</property>
</block>
<block id="identifiersList" ref="urn:touchatag:block:textlist-source">
<property name="Value">
<list>
<text>tag id : &touchatag.tag.id;</text>
<text>tag hash : &touchatag.tag.hash;</text>
<text>reader id : &touchatag.reader.id;</text>
<text>reader hash : &touchatag.reader.hash;</text>
<text>client name : &touchatag.client.name;</text>
</list>
</property>
</block>
<block id="lookupIdentifierFromList" ref="urn:touchatag:block:get-textlist"/>
<block id="plusOperator" ref="urn:touchatag:block:text-source">
<property name="Value">
<text>ADDITIVE</text>
</property>
</block>
<block id="modOperator" ref="urn:touchatag:block:text-source">
<property name="Value">
<text>MOD</text>
</property>
</block>
<block id="plus2operator" ref="urn:touchatag:block:math-text-to-operator"/>
<block id="mod2operator" ref="urn:touchatag:block:math-text-to-operator"/>
<block id="mathAdd" ref="urn:touchatag:block:math-calculator"/>
<block id="mathMod" ref="urn:touchatag:block:math-calculator"/>
<block id="identifierReplacer" ref="urn:touchatag:block:text-resource-identifier-replacer"/>
<block id="message" ref="urn:touchatag:block:message"/>
</breakdown>
<wiringscheme>
<wire from="index:out" to="lookupIdentifierFromList:index-in"/>
<wire from="identifiersList:out" to="lookupIdentifierFromList:textlist-in"/>
<wire from="lookupIdentifierFromList:value-out" to="identifierReplacer:in"/>
<wire from="identifierReplacer:out" to="message:in"/>
<wire from="plusOperator:out" to="plus2operator:in"/>
<wire from="plus2operator:out" to="mathAdd:operator-in"/>
<wire from="index:out" to="mathAdd:value-one-in"/>
<wire from="indexIncrement:out" to="mathAdd:value-two-in"/>
<wire from="modOperator:out" to="mod2operator:in"/>
<wire from="mod2operator:out" to="mathMod:operator-in"/>
<wire from="mathAdd:out" to="mathMod:value-one-in"/>
<wire from="maxIndex:out" to="mathMod:value-two-in"/>
<wire from="mathMod:out" to="index:in"/>
<shunt from="message:out" to="action-out"/>
</wiringscheme>
</superblock>
</blueprint>
</specification>
This example uses the following blocks :
