
You are here: MyURC.org > Tools & Prototypes > UCHj > tutorial > Generic Target Adapter Readme
Generic Target Adapter Readme
Steps for adding a new simulated Target:
- After installing UCH under Apache Tomcat, edit
[TOMCAT_HOME]/webapps/UCH/generic/tdmconfig/generictdm.config, add new
<target> details within <generictdm> tag, as follows:
<target> <prop> <name>http://myurc.org/ns/res#friendlyName</name> <value>TV</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> <name>http://myurc.org/ns/res#deviceType</name> <value>urn:schemas-upnp-org:device:tv:1</value> </prop> <prop> <name>http://myurc.org/ns/res#manufacturer</name> <value>Trace</value> </prop> <prop> <name>http://myurc.org/ns/res#modelName</name> <value>TV FC29</value> </prop> <prop> <name>http://myurc.org/ns/res#udn</name> <value>TV</value> </prop> <prop> <name>http://myurc.org/ns/res#tdUri</name> <value>generic/tv/tv.td</value> </prop> <prop> <name>http://myurc.org/ns/res#scriptFileName[http://res.myurc.org/upnp/tv/tvSocket]</name> <value>generic/tv/tvTarget.script</value> </prop> <prop> <name>http://myurc.org/ns/res#scriptFileName[http://res.myurc.org/upnp/tv/tvSocket2]</name> <value>generic/tv/tvTarget2.script</value> </prop> </target>The value of the property name "tdFileName" provides the file name of the Target Description. One has either copy this file manually to the codeBase of UCH as defined by web.xml, or modify the ANT build.xml to automate the process. [See ANT Usage for details.]
The property name "http://myurc.org/ns/res#scriptFileName[http://res.myurc.org/upnp/tv/tvSocket]" has a fixed format. The value inside the square brackets [], should match the Socket Name available from the about tag of the UI Socket Document. The value of this property points to the script file which has to be run for Sessions opened with this particular Socket.
UCH will get the TDMs to instantiate from web.xml.Ao append a entry of generic TDM(http://res.myurc.org/generic/tdm/java) in the comman saparated value of context parameter 'TDMs'.
<context-param> <param-name>TDMs</param-name> <param-value>http://res.myurc.org/upnp/av/tdm/java,http://res.myurc.org/generic/tdm/java</param-value> </context-param>UCH will search in the uch.config file appropriate TDM. So add generic TDM properties under <tdmList>
<tdmList> <tdm> <prop> <name>http://myurc.org/ns/res#name</name> <value>http://res.myurc.org/generic/tdm/java</value> </prop> <prop> <name>http://myurc.org/ns/res#dynamicLibClass</name> <value>edu.wisc.trace.uch.tdm.generic.GenericTDM</value> </prop> <prop> <name>http://myurc.org/ns/res#type</name> <value>http://www.myurc.org/TR/uch/#tdm</value> </prop> <prop> <name>http://purl.org/dc/elements/1.1/title</name> <value>Generic-TDM</value> </prop> <prop> <name>http://purl.org/dc/elements/1.1/identifier</name> <value>Generic TDM</value> </prop> <prop> <name>http://purl.org/dc/terms/modified</name> <value>2008-08-18T00:00:00Z</value> </prop> <prop> <name>http://purl.org/dc/terms/conformsTo</name> <value>http://myurc.org/TR/uch-20080811/</value> </prop> </tdm> </tdmList>Once the Target is added to the TDM config, then UCH will discover this target with the properties mentioned above. UCH will search in the uch.config file for the proper TA for the discovered. Once the correct TA is found, UCH instantiates the TA and then asks for names of Sockets supported by the TA. Using the Socket Names, UCH again searches the uch.config file for the proper UIPM for supporting these Sockets. Once the correct UIPM is found, UCH instantiates the UIPM. For proper working of the former, the following changes in uch.config are to be made under <taList> and <uipmList>:
<taList> <ta> <prop> <name>http://myurc.org/ns/res#dynamicLibClass</name> <value>edu.wisc.trace.uch.ta.generictarget.GenericTAFacade</value> </prop> <prop> <name>http://myurc.org/ns/res#targetFriendlyName</name> <value>TV</value> </prop> <prop> <name>http://myurc.org/ns/res#deviceType</name> <value>urn:schemas-upnp-org:device:tv:1</value> </prop> <prop> <name>http://myurc.org/ns/res#targetModelName</name> <value>TV FC29</value> </prop> <prop> <name>http://myurc.org/ns/res#targetPlatform</name> <value>UPnP</value> </prop> <prop> <name>http://myurc.org/ns/res#manufacturer</name> <value>Trace</value> </prop> <prop> <name>http://purl.org/dc/terms/modified</name> <value>2008-08-18T00:00:00Z</value> </prop> <prop> <name>http://purl.org/dc/terms/conformsTo</name> <value>http://myurc.org/TR/uch-20080811/</value> </prop> </ta> </taList> <uipmList> <uipm> <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-client</value> </prop> <prop> <name>http://purl.org/dc/terms/modified</name> <value>2008-08-18T00:00:00Z</value> </prop> <prop> <name>http://purl.org/dc/terms/conformsTo</name> <value>http://myurc.org/TR/uch-20080811/</value> </prop> <prop> <name>http://purl.org/dc/elements/1.1/title</name> <value>URC-HTTP UIPM</value> </prop> <prop> <name>http://myurc.org/ns/res#forTargetName</name> <value>*</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://res.myurc.org/uipm/urc-http#tcpIpPortNo</name> <value>8888</value> </prop> <prop> <name>http://myurc.org/ns/res#protocolShortName</name> <value>URC-HTTP</value> </prop> </uipm> </uipmList>Most of the above properties are specified in [UCH] or [RES-PROP-VOCAB].
- After doing the above, the UCH is ready to handle the new simulated Target, using the Generic Target Adapter available with the UCH package.
Last update: Parikshit Thakur & Team, 2008-11-04