for (Iterator iterator = workspaceIds.iterator(); iterator.hasNext();) {
currentWorkspaceId = (String) iterator.next();
WorkspaceImpl workspace = doGetCurrentWorkspace();
Section[] pages = workspace.getAllRootSections();
for (int i = 0; i < pages.length; i++) { //First search root sections in order
Section page = pages[i];
setCurrentSectionId(page.getDbid());
clearRequestCache();
if (isValidUbication()) return;
}
pages = workspace.getAllSections();
for (int i = 0; i < pages.length; i++) { // Then, the rest of sections
Section page = pages[i];
if (!page.isRoot()) {
setCurrentSectionId(page.getId());
clearRequestCache();
if (isValidUbication()) return;
}
}
}