weaken all session refs

This commit is contained in:
Doug Bell 2010-05-31 10:18:45 -05:00
parent 387942e68d
commit cc87552a22
20 changed files with 90 additions and 19 deletions

View file

@ -312,20 +312,22 @@ sub exportBranch {
my $indexFileName = $options->{indexFileName};
my $extrasUploadAction = $options->{extrasUploadAction};
my $rootUrlAction = $options->{rootUrlAction};
my $exportedCount = 0;
my $i18n;
if ( $reportSession ) {
$i18n = WebGUI::International->new($self->session, 'Asset');
}
my $exportedCount = 0;
my $assetIds = $self->exportGetDescendants(undef, $depth);
foreach my $assetId ( @{$assetIds} ) {
my $exportAsset = sub {
my ( $assetId ) = @_;
# Must be created once for each asset, since session is supposed to only handle
# one main asset
my $outputSession = $self->session->duplicate;
my $osGuard = Scope::Guard->new(sub {
$outputSession->close;
$outputSession = undef;
});
my $asset = WebGUI::Asset->new($outputSession, $assetId);
@ -380,6 +382,16 @@ sub exportBranch {
if ( $reportSession ) {
$reportSession->output->print($i18n->get('done'));
}
#use Devel::Cycle;
#warn "CHECKING on " . ref( $asset ) . ' ID: ' . $asset->getId . "\n";
#find_cycle( $asset );
};
my $assetIds = $self->exportGetDescendants(undef, $depth);
foreach my $assetId ( @{$assetIds} ) {
$exportAsset->( $assetId );
}
# handle symlinking
@ -531,6 +543,9 @@ sub exportGetDescendants {
orderByClause => 'assetData.url DESC',
} );
use Data::Dumper;
warn "Assets: " . scalar( @$assetIds );
return $assetIds;
}