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

@ -288,7 +288,15 @@ sub view {
# get other shelves
my @childShelves = ();
SHELF: foreach my $child (@{$self->getLineage(['children'],{returnObjects=>1,includeOnlyClasses=>['WebGUI::Asset::Wobject::Shelf']})}) {
my $childIter = $self->getLineageIterator(['children'],{includeOnlyClasses=>['WebGUI::Asset::Wobject::Shelf']});
SHELF: while ( 1 ) {
my $child;
eval { $child = $childIter->() };
if ( my $x = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound') ) {
$session->log->error($x->full_message);
next;
}
last unless $child;
next SHELF unless $child->canView;
my $properties = $child->get;
$properties->{url} = $child->getUrl;