webgui/sbin/_utility.skeleton
2006-10-11 19:26:10 +00:00

47 lines
1.1 KiB
Text

use lib "../lib";
use strict;
use Getopt::Long;
use WebGUI::Session;
my $session = start();
# Do your work here
finish($session);
#-------------------------------------------------
# Your sub here
#-------------------------------------------------
sub start {
my $configFile;
$|=1; #disable output buffering
GetOptions(
'configFile=s'=>\$configFile,
);
my $session = WebGUI::Session->open("..",$configFile);
$session->user({userId=>3});
## If your script is adding or changing content you need these lines, otherwise leave them commented
#
# my $versionTag = WebGUI::VersionTag->getWorking($session);
# $versionTag->set({name=>'Name Your Tag'});
#
##
return $session;
}
#-------------------------------------------------
sub finish {
my $session = shift;
my $versionTag = WebGUI::VersionTag->getWorking($session);
## If your script is adding or changing content you need these lines, otherwise leave them commented
#
# my $versionTag = WebGUI::VersionTag->getWorking($session);
# $versionTag->commit;
##
$session->var->end;
$session->close();
}