### # addapp0.jacl ### # # Create a variable for use in the creation of a URLProvider object. # # The script expects 1 parameter: # node name # ### # proc addapp0 {nodeName} { ### # set up globals ### global AdminConfig set url_name Quote set jar_name QuoteURLProvider.jar set streamhandlerclass_name com.ibm.ejs.sm.fvt.url.QuoteURLStreamHandler set protocol_name quote ### # Get the config id for the node ### puts "addapp0: getting the config id for the node" set node [$AdminConfig getid /Node:$nodeName/] if {[llength $node] == 0} { puts "addapp0: could not find a Node object called $nodeName" return } ### # Get the config id for the node's variable map ### puts "addapp0: getting the config id for the variable map object on node $nodeName" set varmap [$AdminConfig getid /Node:$nodeName/VariableMap:/] if {[llength $varmap] == 0} { puts "addapp0: could not find a VariableMap object in node $nodeName" return } ### # Create a mapping ### puts "addapp0: create a variable in the variable map" set nameattr [list symbolicName WAS_CLASSES_DIR] set valattr [list value "\${WAS_INSTALL_ROOT}/classes"] set attrs [list $nameattr $valattr] $AdminConfig create VariableSubstitutionEntry $varmap $attrs ### # Create a new URLProvider using this variable in the classpath attribute ### puts "addapp0: create a new URLProvider object using this variable" set name_attr [list name $url_name] set cp_attr [list classpath \${WAS_CLASSES_DIR}/$jar_name] set sh_attr [list streamHandlerClassName $streamhandlerclass_name] set prot_attr [list protocol $protocol_name] set attrs [list $name_attr $cp_attr $sh_attr $prot_attr] set urlp [$AdminConfig create URLProvider $node $attrs] ### # Create new URLs using this URLProvider ### puts "addapp0: create new URL objects using this URLProvider" set name_attr [list name MyCompany] set jndiName_attr [list jndiName url/MyCompany] set spec_attr [list spec quote://MyCompany] set attrs [list $name_attr $jndiName_attr $spec_attr] $AdminConfig create URL $urlp $attrs set name_attr [list name YourCompany] set jndiName_attr [list jndiName url/YourCompany] set spec_attr [list spec quote://YourCompany] set attrs [list $name_attr $jndiName_attr $spec_attr] $AdminConfig create URL $urlp $attrs ### # Save all the changes ### puts "addapp0: saving the configuration" $AdminConfig save } ### # Main ### if { !($argc == 1) } { puts "addapp0: this script requires 1 parameters: " puts " 1) the name of the node under which to create resources" puts "" puts "e.g.: addapp0 mynode" } else { set nodeName [lindex $argv 0] addapp0 $nodeName }