String eventName = event.getEventName();
// get the MOP page from the event data
final Object eventData = event.getData();
final Page page;
PageKey pageKey = null;
if (eventData instanceof PageKey) {
pageKey = (PageKey) eventData;
page = structureAccess.getPageFrom(pageKey);
} else {
org.exoplatform.portal.config.model.Page portalPage = (org.exoplatform.portal.config.model.Page) eventData;
page = structureAccess.getPageFrom(portalPage);
}
if (pageKey != null && page == null && EventType.PAGE_DESTROYED.equals(eventName)) {
// if we try to remove a page, when we get this event, the page has already been removed from JCR
// so we need to work around that fact by retrieving the corresponding PageInfo from the portal page title
// which should match the Described name and check that it matches the internal name before removing it
removePageByInternalName(pageKey.getName());
return;
}
if (page != null) {
if (EventType.PAGE_CREATED.equals(eventName)) {