forked from plainblack/webgui
/
_utility.skeleton
46 lines (37 loc) · 1.08 KB
/
_utility.skeleton
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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;
}