private void removePageNode(Page page, Event<UIPageBrowser> event) throws Exception
{
UIPageBrowser uiPageBrowser = event.getSource();
DataStorage dataService = uiPageBrowser.getApplicationComponent(DataStorage.class);
PageNavigation pageNavigation = null;
UIPortalApplication portalApplication = Util.getUIPortalApplication();
List<PageNavigation> listPageNavigation = portalApplication.getNavigations();
for (PageNavigation pageNvg : listPageNavigation)
{
if (pageNvg.getOwnerType().equals(PortalConfig.USER_TYPE))
{
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)