Dynamic hosts and assigning attributes
Hey!
<P>
How do I host assign attributes when using:
<P>
<targetRef hostName='tmp_:[hostName]' typeName='com.sun.tst#tstHost'></targetRef>
<P>
Like if my hostType <i>com.sun.tst#tstHost</i> has the following variables:
applicationName
applicationVersion
applicationPath
<P>
And this is when creating components and create virtual hosts on the fly...
<P>
Rgds,
Peter
[534 byte] By [
chappe] at [2008-1-29]

You can't assign values to the host type attributes with a <targetRef> element. You can create install the component which creates the host then execute the CLUI command "hdb.h.mod" to modify the host as in:
cr_cli -cmd hdb.h.mod -ID NM:tmp_myhost -attr "applicationName='my value';applicationVersion='my other value';applicationPath='/some/path/here'" -u admin -p admin
Usually if you are creating virtual hosts "on-the-fly" using targetable components, I prefer the component itself to store those values as regular component variables.
Of course, this results in final values as compared to host attributes, which could be modified. But your variable names suggest, that's what you want to have anyway.
If it comes to retrieving those values starting from the virtual host consider using ':[targetableComponents:varName]' instead of ':[target:varName]' finally.
Regards,
Frank