migrate to getLineageIterator to save memory

This commit is contained in:
Doug Bell 2010-06-01 16:22:42 -05:00
parent cc87552a22
commit 2c75ab27e6
34 changed files with 794 additions and 187 deletions

View file

@ -383,13 +383,20 @@ ENDHTML
### Crumbtrail
my $crumb_markup = '<li><a href="%s">%s</a> &gt;</li>';
my $ancestors = $currentAsset->getLineage( ['ancestors'], { returnObjects => 1 } );
my $ancestorIter = $currentAsset->getLineageIterator( ['ancestors'] );
$output .= '<ol id="crumbtrail">';
for my $asset ( @{ $ancestors } ) {
while ( 1 ) {
my $ancestor;
eval { $ancestor = $ancestorIter->() };
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
$session->log->error($x->full_message);
next;
}
last unless $ancestor;
$output .= sprintf $crumb_markup,
$asset->getUrl( 'op=assetManager;method=manage' ),
$asset->get( "menuTitle" ),
$ancestor->getUrl( 'op=assetManager;method=manage' ),
$ancestor->get( "menuTitle" ),
;
}

View file

@ -61,7 +61,6 @@ sub handler {
}
my $pages = WebGUI::Asset->getRoot($session)->getLineageIterator(["self","descendants"],{
returnObjects => 1,
includeOnlyClasses => ["WebGUI::Asset::Wobject::Layout"],
whereClause => $whereClause,
limit => 20000