webgui/sbin/_utility.skeleton
2007-09-13 15:45:01 +00:00

46 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;
## 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;
}