no, what i wanted was to remove www_ methods from AssetExportHtml

This commit is contained in:
Doug Bell 2011-02-10 17:04:00 -06:00
parent 1002ac3bae
commit b332d828e7

View file

@ -918,156 +918,4 @@ sub exportHtml_view {
$self->www_view(@_);
}
#-------------------------------------------------------------------
=head2 www_export
Displays the export page administrative interface
=cut
sub www_export {
my $self = shift;
return $self->session->privilege->insufficient() unless ($self->session->user->isInGroup(13));
my $i18n = WebGUI::International->new($self->session, "Asset");
my $f = WebGUI::FormBuilder->new($self->session, action => $self->getUrl);
$f->addField( "hidden",
name => "func",
value => "exportStatus"
);
$f->addField( "integer",
label => $i18n->get('Depth'),
hoverHelp => $i18n->get('Depth description'),
name => "depth",
value => 99,
);
$f->addField( "selectBox",
label => $i18n->get('Export as user'),
hoverHelp => $i18n->get('Export as user description'),
name => "userId",
options => $self->session->db->buildHashRef("select userId, username from users"),
value => [1],
);
$f->addField( "text",
label => $i18n->get("directory index"),
hoverHelp => $i18n->get("directory index description"),
name => "index",
value => "index.html"
);
$f->addField( "text",
label => $i18n->get("Export site root URL"),
name => 'exportUrl',
value => '',
hoverHelp => $i18n->get("Export site root URL description"),
);
# TODO: maybe add copy options to these boxes alongside symlink
$f->addField( "selectBox",
label => $i18n->get('extrasUploads form label'),
hoverHelp => $i18n->get('extrasUploads form hoverHelp'),
name => "extrasUploadsAction",
options => {
'symlink' => $i18n->get('extrasUploads form option symlink'),
'none' => $i18n->get('extrasUploads form option none') },
value => ['none'],
);
$f->addField( "selectBox",
label => $i18n->get('rootUrl form label'),
hoverHelp => $i18n->get('rootUrl form hoverHelp'),
name => "rootUrlAction",
options => {
'symlink' => $i18n->get('rootUrl form option symlinkDefault'),
'none' => $i18n->get('rootUrl form option none') },
value => ['none'],
);
$f->addField( "submit", name => "submit" );
my $message;
eval { $self->exportCheckPath };
if($@) {
$message = $@;
}
return '<h1>' . $i18n->get('Export Page') . '</h1>' . $message . $f->toHtml;
}
#-------------------------------------------------------------------
=head2 www_exportStatus
Displays the export status page
=cut
sub www_exportStatus {
my $self = shift;
my $session = $self->session;
return $session->privilege->insufficient
unless $session->user->isInGroup(13);
my $form = $session->form;
my @vars = qw(
index depth userId extrasUploadsAction rootUrlAction exportUrl
);
$self->forkWithStatusPage({
plugin => 'ProgressTree',
title => 'Page Export Status',
method => 'exportInFork',
groupId => 13,
args => {
assetId => $self->getId,
map { $_ => scalar $form->get($_) } @vars
}
}
);
}
#-------------------------------------------------------------------
=head2 www_exportGenerate
Executes the export process and displays real time status. This operation is displayed by exportStatus in an IFRAME.
=cut
# This routine is called in an IFRAME and prints status output directly to the browser.
sub www_exportGenerate {
my $self = shift;
my $session = $self->session;
return $session->privilege->insufficient
unless $session->user->isInGroup(13);
# Unbuffered data output
$|++;
$session->style->useEmptyStyle(1);
$session->http->sendHeader;
my $splitter = $self->getSeparator;
my $style = $session->style->process($splitter);
my ($head, $foot) = split /\Q$splitter/, $style;
$session->output->print($head, 1);
my $i18n = WebGUI::International->new($session, 'Asset');
my $args = {
quiet => 0,
userId => $session->form->process('userId'),
indexFileName => $session->form->process('index'),
extrasUploadAction => $session->form->process('extrasUploadsAction'),
rootUrlAction => $session->form->process('rootUrlAction'),
depth => $session->form->process('depth'),
exportUrl => $session->form->process('exportUrl'),
};
eval {
my $message = $self->exportAsHtml( $args );
$self->session->output->print($message, 1);
$self->session->output->print(
'<a target="_parent" href="' . $self->getUrl . '">' . $i18n->get(493, 'WebGUI') . '</a>'
);
};
if ($@) {
$self->session->output->print("$@", 1);
}
$session->output->print($foot, 1);
return "chunked";
}
1;