package WebGUI::Fork::AssetExport;
=head1 LEGAL
-------------------------------------------------------------------
WebGUI is Copyright 2001-2009 Plain Black Corporation.
-------------------------------------------------------------------
Please read the legal notices (docs/legal.txt) and the license
(docs/license.txt) that came with this distribution before using
this software.
-------------------------------------------------------------------
http://www.plainblack.com info@plainblack.com
-------------------------------------------------------------------
=cut
use strict;
use warnings;
=head1 NAME
WebGUI::Fork::AssetExport
=head1 DESCRIPTION
Renders an admin console page that polls ::Status to draw a friendly graphical
representation of how an export is coming along.
=head1 SUBROUTINES
These subroutines are available from this package:
=cut
use Template;
my $template = <<'TEMPLATE';
Currently exporting
(/).
seconds elapsed.
[% MACRO yui(file) BLOCK %]
[% END %]
[% yui("yahoo/yahoo-min.js") %]
[% yui("json/json-min.js") %]
[% yui("event/event-min.js") %]
[% yui("connection/connection_core-min.js") %]
TEMPLATE
my $stylesheet = <<'STYLESHEET';
STYLESHEET
#-------------------------------------------------------------------
=head2 handler ( process )
See WebGUI::Operation::Fork.
=cut
sub handler {
my $process = shift;
my $session = $process->session;
my $url = $session->url;
my $tt = Template->new( { INTERPOLATE => 1 } );
my %vars = (
statusUrl => $url->page( $process->contentPairs('Status') ),
extras => $session->url->extras,
);
$tt->process( \$template, \%vars, \my $content ) or die $tt->error;
my $console = WebGUI::AdminConsole->new( $process->session, 'assets' );
$session->style->setRawHeadTags($stylesheet);
my $i18n = WebGUI::International->new( $session, 'Asset' );
return $console->render( $content, $i18n->get('Page Export Status') );
} ## end sub handler
1;