
You are here: MyURC.org > Tools & Prototypes > UCHj > tutorial > How to add Local Resource to UCH
How to Add Local Resource to UCH
Page Contents:
- Local Resource Directory Location
- Add Resource
- UCH Resource Configuration File (extension .ucf) Format
- Sample TDM UCF file
- Sample TA UCF file
- Sample UIPM UCF file
- Sample Target Description (TD) UCF file
- Sample Socket Description (UIS) UCF file
- Sample Resource Sheet (RSHEET) UCF Properties
- Sample IR Code UCF File
Local Resource Directory Location
The Local Resource Directory is located at:
[TOMCAT_HOME]/webapps/UCH/resources.
Add Resource
STEPS:
- Create a new directory under the local resource directory or a sub-directory inside it. Put your resource files in that directory.
- Create a file with '.ucf' extension in the same directory.
- Add appropriate properties in the '.ucf' file in valid XML format as mentioned below.
- For offline resources, three properties are mandatory:
- http://myurc.org/ns/res#name
- http://myurc.org/ns/res#type
- http://myurc.org/ns/res#resourceUri
- The resource configuration can also point to resource on the resource server or anywhere else on the internet. For such online resources, only one property is required: "http://myurc.org/ns/res#resourceUri". Basically the property 'http://myurc.org/ns/res#resourceUri' specifies the resource path that can be a relative path for offline resources, resource server get URL or any other http resource URL.
- For initiating a search on the resource server with specific properties, one can skip the above mentioned 3 properties and instead specify just properties of a resource to search for. UCH will use those properties and search for appropriate resource from resource server at startup time.
NOTE : Details of Resource Types and their properties is available at: Resource Property Vocabulary 1.0 (DRAFT)
UCH Resource Configuration File (extension .ucf) Format
<?xml version="1.0" encoding="UTF-8"?>
<props>
<prop>
<name>Property Name</name>
<value>Property Value</value>
</prop>
</props>
Whereby:
- The message body shall comply to [XML 1.0]. It should not contain any namespace declaration.
- The encoding shall be UTF-8 [UCS].
- <props> shall occur exactly once.
- <prop> shall occur one or more times under each <props> element.
- <prop> shall contain a <name> and a <value> element.
- <name> specifies Property Name.
- <value> specifies Property Value.
Sample TDM UCF file
Below is a sample UCF file for an offline TDM:
<?xml version="1.0" encoding="UTF-8"?>
<props>
<prop>
<name>http://myurc.org/ns/res#name</name>
<value>http://res.myurc.org/upnp/tdm/java</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#dynamicLibClass</name>
<value>edu.wisc.trace.uch.tdm.upnp.UpnpTDM</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#type</name>
<value>http://myurc.org/restypes#tdm</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#platform</name>
<value>java</value>
</prop>
<prop>
<name>http://purl.org/dc/elements/1.1/title</name>
<value>UPnP-TDM</value>
</prop>
<prop>
<name>http://purl.org/dc/terms/modified</name>
<value>2008-11-15T00:00:00Z</value>
</prop>
<prop>
<name>http://purl.org/dc/terms/conformsTo</name>
<value>http://myurc.org/TR/uch1.0-20091103/</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#mimeType</name>
<value>application/java-archive</value>
</prop>
<prop> <!-- Relative path of resource file or directory -->
<name>http://myurc.org/ns/res#resourceUri</name>
<value>upnptdm.jar</value>
</prop>
</props>
Sample TA UCF file
Below is a sample UCF file for an offline TA:
<?xml version="1.0" encoding="UTF-8"?>
<props>
<prop>
<name>http://myurc.org/ns/res#name</name>
<value>http://res.myurc.org/upnp/av/ta/java</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#deviceType</name>
<value>urn:schemas-upnp-org:device:ues:1</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#dynamicLibClass</name>
<value>edu.wisc.trace.uch.ta.upnpav.UpnpAvTAFacade</value>
</prop>
<prop>
<name>http://purl.org/dc/terms/conformsTo</name>
<value>http://myurc.org/TR/uch1.0-20091103/</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#mimeType</name>
<value>application/java-archive</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#platform</name>
<value>java</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#type</name>
<value>http://myurc.org/restypes#ta</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#devicePlatform</name>
<value>UPnP</value>
</prop>
<prop> <!-- Whether subscribe mediaremerer's AV Transport Service -->
<name>http://res.myurc.org/ta/upnp-av#eventSubscription</name>
<value>no</value>
</prop>
<prop> <!-- Time-interval(in seconds) between two consecutive call on media renderer for getting updated values. -->
<name>http://res.myurc.org/ta/upnp-av#pollingRate</name>
<value>1</value>
</prop>
<prop> <!-- Time-interval(in seconds) between two pictures in case of playing picture slide show -->
<name>http://res.myurc.org/ta/upnp-av#frameDelay</name>
<value>5</value>
</prop>
<prop> <!-- Relative path of Target Description File to docRoot -->
<name>http://myurc.org/ns/res#tdUri</name>
<value>upnpav/UpnpEntertainmentSystem.td</value>
</prop>
<prop> <!-- Relative path of resource file or directory -->
<name>http://myurc.org/ns/res#resourceUri</name>
<value>upnpavta.jar</value>
</prop>
</props>
Sample UIPM UCF file
Below is a sample UCF file for an offline UIPM:
<?xml version="1.0" encoding="UTF-8"?>
<props>
<prop>
<name>http://myurc.org/ns/res#name</name>
<value>http://res.myurc.org/upnp/av/uipm/urchttp/java</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#dynamicLibClass</name>
<value>edu.wisc.trace.uch.uipm.urchttp.UrcHttpUIPM</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#type</name>
<value>http://myurc.org/restypes#uipm</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#platform</name>
<value>java</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#devicePlatform</name>
<value>*</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#protocolShortName</name>
<value>URC-HTTP</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#urlBasePath</name>
<value>/urchttp</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#urlPortNo</name>
<value>80</value>
</prop>
<prop>
<name>http://purl.org/dc/elements/1.1/title</name>
<value>URC-HTTP UIPM</value>
</prop>
<prop><!-- Time-interval(in mili-seconds) between two consecutive call of getCompatibleUIs on IUIPMListener-->
<name>http://res.myurc.org/uipm/urc-http#getCompatibleUIsInteval</name>
<value>60000</value>
</prop>
<prop>
<name>http://res.myurc.org/uipm/urc-http#tcpIpPortNo</name>
<value>8888</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#forTargetName</name>
<value>*</value>
</prop>
<prop>
<name>http://purl.org/dc/terms/conformsTo</name>
<value>http://myurc.org/TR/uch1.0-20091103/</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#mimeType</name>
<value>application/java-archive</value>
</prop>
<prop> <!-- Relative path of resource file or directory -->
<name>http://myurc.org/ns/res#resourceUri</name>
<value>urchttpuipm.jar</value>
</prop>
</props>
Sample Target Description (TD) UCF file
Below is a sample UCF file for an offline TD:
<?xml version="1.0" encoding="UTF-8"?>
<props>
<prop>
<name>http://myurc.org/ns/res#name</name>
<value>http://res.myurc.org/upnp/av</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#mimeType</name>
<value>application/urc-targetdesc+xml</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#forTargetName</name>
<value>http://res.myurc.org/upnp/av</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#type</name>
<value>http://myurc.org/restypes#targetdesc</value>
</prop>
<prop>
<name>http://purl.org/dc/terms/conformsTo</name>
<value>http://myurc.org/iso24752-4/2007</value>
<prop> <!-- Relative path of resource file or directory -->
<name>http://myurc.org/ns/res#resourceUri</name>
<value>upnpav/UpnpEntertainmentSystem.td</value>
</prop>
</props>
Sample Socket Description (UIS) UCF file
Below is a sample UCF file for an offline UIS:
<?xml version="1.0" encoding="UTF-8"?>
<props>
<prop>
<name>http://myurc.org/ns/res#name</name>
<value>http://res.myurc.org/devices/dvd/uisocketdesc/template/dvd.uis</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#mimeType</name>
<value>application/urc-uisocketdesc+xml</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#forTargetName</name>
<value>http://res.myurc.org/devices/dvd/targetdesc/template/dvd.td</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#type</name>
<value>http://myurc.org/restypes#uisocketdesc</value>
</prop>
<prop>
<name>http://purl.org/dc/terms/conformsTo</name>
<value>http://myurc.org/iso24752-2/2007</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#forSocketName</name>
<value>http://res.myurc.org/devices/dvd/uisocketdesc/template/dvd.uis</value>
</prop>
<prop> <!-- Relative path of resource file or directory -->
<name>http://myurc.org/ns/res#resourceUri</name>
<value>dvd.uis</value>
</prop>
</props>
Sample Resource Sheet (RSHEET) UCF Properties
Below is a sample UCF file for an offline RSHEET:
<?xml version="1.0" encoding="UTF-8"?>
<props>
<prop>
<name>http://myurc.org/ns/res#name</name>
<value>http://res.myurc.org/devices/dvd/ressheet/template/dvd.rsheet</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#type</name>
<value>http://myurc.org/restypes#ressheet</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#aResDescForDomain</name>
<value>http://res.myurc.org/devices/dvd/uisocketdesc/template/dvd.uis</value>
</prop>
<prop>
<name>http://purl.org/dc/terms/conformsTo</name>
<value>http://myurc.org/iso24752-5/2007</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#mimeType</name>
<value>application/urc-ressheet+xml</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#forLang</name>
<value>en</value>
</prop>
<prop> <!-- Relative path of resource file or directory -->
<name>http://myurc.org/ns/res#resourceUri</name>
<value>dvd.rsheet</value>
</prop>
</props>
Sample IR Code UCF File
- IR code file is used with GC100 Generic IR Target Adapter to control IR device using GC100 Master Controller.
- IR code file specifies mapping between elements of UI Socket Description and Pronto HEX code of IR device.
Below is a sample UCF file for an offline IR code file:
<?xml version="1.0" encoding="UTF-8"?>
<props>
<prop>
<name>http://myurc.org/ns/res#name</name>
<value>http://res.myurc.org/devices/dvd/denon/prontocode/rc-1017.config</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#type</name>
<value>http://myurc.org/TR/uch/#irconfig</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#deviceType</name>
<value>http://myurc.org/devicetypes#dvdPlayer</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#deviceModelNumber</name>
<value>1940CI</value>
</prop>
<prop>
<name>http://myurc.org/ns/res#manufacturer</name>
<value>DENON</value>
</prop>
<prop>
<name>http://purl.org/dc/elements/1.1/creator</name>
<value>Sandip Patel</value>
</prop>
<prop>
<name>http://purl.org/dc/elements/1.1/description</name>
<value>Denon-1940CI dvd's pronto code</value>
</prop>
<prop>
<name>http://purl.org/dc/elements/1.1/title</name>
<value>Denon-1940CI</value>
</prop>
<prop>
<name>http://purl.org/dc/terms/modified</name>
<value>2009-12-26T09:27:12.0Z</value>
</prop>
<prop> <!-- Relative path of resource file or directory -->
<name>http://myurc.org/ns/res#resourceUri</name>
<value>rc-1017.config</value>
</prop>
</props>
Last update: Parikshit Thakur & Team, 2010-04-30