How to substitute PageTreeReader in CMS 5

Vote:
 
Hi there,
We are currently porting a some functionality from 4.x to 5.x and we have come across a few deprecated classes. Hence we're looking for some substitutes that provide the same functionality. Given the following lines of code
PageTreeReader pageTreeReader = new PageTreeReader( new PageTreeLoader().GetCompletePageTree(StartPage,Global.EPDataFactory));
while(pageTreeReader.Read())
{
/* do some processing of pageTreeReader .Page*/
}

 

What would be the best alternatives in 5.x? The sdk hints at using the HierarchicalPageLoader instead but we don't see how it provides the exact same functionality...
Any advice is appreciated!!

Cheers

#19795
May 05, 2008 18:35
Vote:
 
This seems to be the solution... note that the semantics have changed a bit...
HierarchicalPageLoader hierarchicalPageLoader = new HierarchicalPageLoader();
hierarchicalPageLoader.PageLink = PageReference.RootPage;
hierarchicalPageLoader.AccessLevel = AccessLevel.Read;
foreach (PageHierarchyData pageHierarchyData in hierarchicalPageLoader.HierarchicalSelect(null))
{
/* do some processing of pageHierarchyData.Page*/
}

#19796
May 05, 2008 18:43