@@ -13,6 +13,7 @@ use WebGUI::Workflow;
13
13
use WebGUI::Workflow::Instance;
14
14
use WebGUI::User;
15
15
use WebGUI::Text;
16
+ use WebGUI::ProgressBar;
16
17
17
18
=head1 NAME
18
19
@@ -84,15 +85,26 @@ The name of the file to create inside the storage object.
84
85
85
86
sub exportSomething {
86
87
my ($session , $sth , $filename ) = @_ ;
88
+ my $pb = WebGUI::ProgressBar-> new($session );
89
+ my $i18n = WebGUI::International-> new($session , ' Asset_Thingy' );
90
+ $pb -> start($i18n -> get(' export label' ), $session -> url-> extras(' adminConsole/passiveAnalytics.png' ));
91
+ $pb -> update($i18n -> get(' Creating column headers' ));
87
92
my $storage = WebGUI::Storage-> createTemp($session );
88
93
my @columns = $sth -> getColumnNames;
89
94
my $csvData = WebGUI::Text::joinCSV( @columns ). " \n " ;
95
+ $pb -> update($i18n -> get(' Writing data' ));
96
+ my $rowCounter =0;
90
97
while (my $row = $sth -> hashRef()) {
91
98
my @row = @{ $row }{@columns };
92
99
$csvData .= WebGUI::Text::joinCSV(@row ) . " \n " ;
100
+ if (! ++$rowCounter % 25) {
101
+ $pb -> update($i18n -> get(' Writing data' ));
102
+ }
93
103
}
94
104
$storage -> addFileFromScalar($filename , $csvData );
95
105
$session -> http-> setRedirect($storage -> getUrl($filename ));
106
+ $pb -> update(sprintf q| <a href="%s">%s</a>| , $session -> url-> page(' op=passiveAnalytics;func=editRuleflow' ), sprintf ($i18n -> get(' Return to %s' ), $i18n -> get(' Passive Analytics' ,' PassiveAnalytics' )));
107
+ return $pb -> finish($storage -> getUrl($filename ));
96
108
}
97
109
98
110
# -------------------------------------------------------------------
0 commit comments