WorkspaceImpl currentWorkspace = (WorkspaceImpl) (workspaceId != null && !"".equals(workspaceId) ? UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId) : NavigationManager.lookup().getCurrentWorkspace());
Section[] rootSections;
if (StringUtils.isEmpty(rootSectionId)) {
rootSections = currentWorkspace.getAllRootSections();
} else {
Section parentSection = currentWorkspace.getSection(Long.decode(rootSectionId));
List<Section> children = parentSection.getChildren();
rootSections = children.toArray(new Section[children.size()]);
}
renderFragment("outputStart");
for (Section rootSection : rootSections) {
renderSection(httpServletRequest, httpServletResponse, rootSection, visibleIds, checkedIds, selectableIds, Boolean.TRUE.equals(checkPermissions), showHiddenPages);