###
### get_DataSources.jacl
###
###
### Generate JACL configuration code by reading
### from an existing configuration
###
### From xmi:type fields in resources.xml
###
###





proc get_DataSource {sname} {



global AdminConfig


set DataSources [$AdminConfig getid /DataSource:/]


foreach  DataSource $DataSources {

  if {[regexp $sname $DataSource] == 1} {
      puts " "
      puts "# $DataSource"
      set xyz [$AdminConfig showall $DataSource]
      puts "\$AdminConfig create DataSource \$serverid { $xyz }"
      puts " "
  }
}


}






###
### Main
###
###


if { !($argc == 1) } {
   puts ""
   puts "Usage: "
   puts " "
   puts "wsadmin.sh -username system -password password -f get_DataSource.jacl servername"
   puts " "
} else { 
   set xserver      [lindex $argv 0]  
   get_DataSource $xserver 
}