Rebecca Searls' Blog
Setting default values in OpenInstaller
I've been playing with openinstaller. In particular I was trying to understand how the 'eval' and 'eval-engine' attributes worked. With some effort I was disappointed to find that the functionality for eval-engine is not currently implemented nor is there is no way to pass the classpath of my class to the engine.
I was able to get 'eval' to work. I discovered that there is a strict format for it. The word 'target' is a keyword and MUST be used in conjunction with any of the predefined variables (see below). The format MUST be ":[target:<predefined varable>]" If this format is not used there are 3 possible results. One, the text itself is considered the default value and displayed. Two, the text resolves to "". Three, the text causes a silent error and the default value '/tmp/x' is used.
example
<prop oor:name="TRG_DOMAIN" oor:type="xs:string">
<value if:eval=":[target:sys.homeDir]" >/tmp/x</value>
:
:
</prop>
Another keyword is 'component' it is used when identifying a component name.
example
<prop oor:name="TRG_DOMAIN" oor:type="xs:string">
<value if:eval=":[component:SomeComponent.group.username]" >/tmp/x</value>
</prop>
There is also a keyword 'engine'. It is unclear how this is to be used.
NOTE:
I found some out of date JavaDoc information in TargetToken about the supported predefined variables. Two variables are incorrectly stated. Here is the correct information.
correct incorrect
sys.homeDir sys.raHomeDir displays the system property user.dir
sys.tmpDir sys.raHomeDir displays the system property java.io.tmpdir
correct as listed
sys.hostName Host name of host
sys.ipAddress IP Address of host
sys.OSName OS name
sys.OSVersion OS version
sys.OSArch OS architecture
sys.userName Current user's login account name
*sys.userDir The current directory from which the engine was invoked
(sys.userDir always returns '/'. This may because the engine is invoked from a shell script)
Posted at 05:44PM Feb 24, 2009 by rsearls in Sun | Comments[0]
Tuesday Feb 24, 2009