{
pageNavigation = pageNvg;
break;
}
}
UIPortal uiPortal = Util.getUIPortal();
PageNode tobeRemoved = null;
List<PageNode> nodes = pageNavigation.getNodes();
for (PageNode pageNode : nodes)
{
String pageReference = pageNode.getPageReference();
String pageId = page.getPageId();
if (pageReference != null && pageReference.equals(pageId))
{
tobeRemoved = pageNode;
break;
}
}
if (tobeRemoved != null)
{
// Remove pageNode
pageNavigation.getNodes().remove(tobeRemoved);
// Update navigation and UserToolbarGroupPortlet
String pageRef = tobeRemoved.getPageReference();
if (pageRef != null && pageRef.length() > 0)
{
// Remove from cache
uiPortal.clearUIPage(pageRef);
}
dataService.save(pageNavigation);
//Update UserToolbarGroupPortlet