I want to set the values of items on a DCT to the values returned by the Perl script called by the callServer. How can I access the values returned by the callserver?
The call to the callserver I am using is like this:
IWDatacapture.callServer("/iw-bin/testcallserver.ipl",true);
and the testcallserver.ipl is as below:
#!/home/iw-home/iw-perl/bin/iwperl
use TeamSite::CGI_lite;
use CGI;
my $dbh = DBI->connect("DBI

racle:host","user", "pwd",
{
PrintError => 1, # Messes up the GUI
RaiseError => 0, # Handled elsewhere
AutoCommit => 1, # Usually good
}
);
print "\nconnected to db\n\n";
my $sql= "SELECT TABLE_NAME FROM ALL_TABLES WHERE TABLE_NAME LIKE '%CONTENT_DETAIL%'";
my $sth = $dbh->prepare( $sql )
or die "Can not prepare SQL statement: $DBI::errorstr\n";
$sth->execute
or die "Can not execute SQL statement: $DBI::errorstr\n";
my $row;
$row = $sth->fetchrow_array();
# print "Row: $row\n";
warn "Data fetching terminated early by error: $DBI::errstr\n"
if $DBI::err;
print "Content-type: text/html\n
<html>
<HEAD>
</HEAD>
<BODY>
<script language=\"Javascript\">
var api = parent.getScriptFrame()\;
api.IWDatacapture.getItem(\"/Header\").setValue('$row')\;
</script>
</BODY>
</HTML>
";
My questions are:
1. How do i access the return values of the Perl script from FormAPI?
2. Does the return value of the callserver have to a Javascript code embedded in HTML tags?
3. How can i set the values of the Perl returned values to the items on the DCT that invoked the callserver?
Any help is greatly appreciated.
Thanks.