public void delete(final Long portalPageId) { notNull("portalPageId", portalPageId); PortalPage oldPage = null; try { oldPage = delegateStore.getPortalPage(portalPageId); delegateStore.delete(portalPageId); } finally { cacheById.remove(portalPageId); if (oldPage != null && oldPage.getOwner() != null) { cacheByUser.remove(oldPage.getOwner().getKey()); } } }
@Override public void delete(final Long portalPageId) { notNull("portalPageId", portalPageId); // // delete all PortletConfigs associated with the page first. The underlying portletConfigurationManager/Store // also cleans associated propertySets // final List<PortletConfiguration> portlectConfigurations = portletConfigurationManager.getByPortalPage(portalPageId); for (final PortletConfiguration portletConfiguration : portlectConfigurations) { portletConfigurationManager.delete(portletConfiguration); } final SharedEntity identifier = new SharedEntity.Identifier(portalPageId, PortalPage.ENTITY_TYPE, (ApplicationUser) null); portalPageStore.delete(portalPageId); shareManager.deletePermissions(identifier); indexer.deIndex(identifier).await(); eventPublisher.publish(new DashboardDeleted(identifier, authenticationContext.getUser())); }