C
corky
Using Perl 5.6.0. I need to temporarily show a message while I process
in the background. The process calls an OLE component which sets a
value in the user's cookie.
The DisplaySecSubmit sub calls my "please wait" page which is static.
The GetSecureModels sub runs the OLE process and sets the cookie.
The DisplaySubmit sub displays a new page which uses the cookie which
was just set.
Here is where it starts:
elsif ($FORM{'FUNC'} eq 'DISP_SEC_SUBMIT')
{&RightViolation($CREATE_RIGHT) if (($createRight == 0) &&
($a_createRight == 0));
&DisplaySecSubmit();
&GetSecureModels();
&DisplaySubmit();
}
use Win32::OLE;
use DBI;
use DBD::ODBC;
sub GetSecureModels{
if (length($trainedOn) < 1){
$dbh = DBI->connect("dbi:ODBC:support", exsu, exsupwd)|| die "Can't
connect !!: $DBI::errstr";
$dbh -> {RaiseError} = 1;
$stmt = "SELECT DISTINCT CTI_MODEL, MODEL FROM MODEL_LOOKUP WHERE
STATUS = 'ACTIVE' AND CLASS_FAMILY IN (SELECT DISTINCT FAMILY FROM
MODEL_FAMILY) ORDER BY MODEL;";
$sth = $dbh->prepare($stmt)|| die "Error on prepare $DBI::errstr";
$sth->execute()|| die "Error on Execute $DBI::errstr";
while (@row = $sth->fetchrow_array) {
my $server = Win32::OLE->new('auth.caller','Quit');
$server->{Model} = $row[0];
$server->{NSSGID} = $userID;
my $trainstat = $server->{Verify};
if ($trainstat ne -1 ) {
push @trainedOn , $row[1];
}
}
$trainedOn = join ',', @trainedOn;
print "Content-type: text/html; charset=utf-8\n";
&SetCompressedCookies('MODELS','trainedOn', $trainedOn);
print "\n";
}
}
sub DisplaySecSubmit{
&set_submit_strings();
&EchoFile($HTML_PATH, "traincheck.htm");
}
My problem is that it seems as though each individual CGI call will
only return a single page of output. For example, I show my "please
wait" message while I'm processing and when processing is done the
results are appended to the "please wait" message instead of replacing
it.
Another problem is that the cookie stuff shows in the browser too.
Is there any way to flush or start with a clear screen? Can I run the
process on a different thread? Can I use refreshes to handle this? Or
should I use a combination of approaches?
I only use Perl once a year or so as necessary, and as a consequence
this may be a simple problem with a simple answer, so please forgive
me.
Thanks in advance for any help,
Corky
in the background. The process calls an OLE component which sets a
value in the user's cookie.
The DisplaySecSubmit sub calls my "please wait" page which is static.
The GetSecureModels sub runs the OLE process and sets the cookie.
The DisplaySubmit sub displays a new page which uses the cookie which
was just set.
Here is where it starts:
elsif ($FORM{'FUNC'} eq 'DISP_SEC_SUBMIT')
{&RightViolation($CREATE_RIGHT) if (($createRight == 0) &&
($a_createRight == 0));
&DisplaySecSubmit();
&GetSecureModels();
&DisplaySubmit();
}
use Win32::OLE;
use DBI;
use DBD::ODBC;
sub GetSecureModels{
if (length($trainedOn) < 1){
$dbh = DBI->connect("dbi:ODBC:support", exsu, exsupwd)|| die "Can't
connect !!: $DBI::errstr";
$dbh -> {RaiseError} = 1;
$stmt = "SELECT DISTINCT CTI_MODEL, MODEL FROM MODEL_LOOKUP WHERE
STATUS = 'ACTIVE' AND CLASS_FAMILY IN (SELECT DISTINCT FAMILY FROM
MODEL_FAMILY) ORDER BY MODEL;";
$sth = $dbh->prepare($stmt)|| die "Error on prepare $DBI::errstr";
$sth->execute()|| die "Error on Execute $DBI::errstr";
while (@row = $sth->fetchrow_array) {
my $server = Win32::OLE->new('auth.caller','Quit');
$server->{Model} = $row[0];
$server->{NSSGID} = $userID;
my $trainstat = $server->{Verify};
if ($trainstat ne -1 ) {
push @trainedOn , $row[1];
}
}
$trainedOn = join ',', @trainedOn;
print "Content-type: text/html; charset=utf-8\n";
&SetCompressedCookies('MODELS','trainedOn', $trainedOn);
print "\n";
}
}
sub DisplaySecSubmit{
&set_submit_strings();
&EchoFile($HTML_PATH, "traincheck.htm");
}
My problem is that it seems as though each individual CGI call will
only return a single page of output. For example, I show my "please
wait" message while I'm processing and when processing is done the
results are appended to the "please wait" message instead of replacing
it.
Another problem is that the cookie stuff shows in the browser too.
Is there any way to flush or start with a clear screen? Can I run the
process on a different thread? Can I use refreshes to handle this? Or
should I use a combination of approaches?
I only use Perl once a year or so as necessary, and as a consequence
this may be a simple problem with a simple answer, so please forgive
me.
Thanks in advance for any help,
Corky