//If its a published version we just deletes the event - we don't want to delete the version.
EventController.delete(event, db);
}
else
{
SiteNode siteNode = siteNodeVersion.getOwningSiteNode();
//event.setEntityId(SiteNodeVersionController.getPreviousSiteNodeVersionVO(siteNode.getId(), siteNodeVersion.getId()).getId());
SiteNodeVersion previousSiteNodeVersion = SiteNodeVersionController.getController().getPreviousActiveSiteNodeVersion(siteNode.getId(), siteNodeVersion.getId(), db);
if(previousSiteNodeVersion != null && event != null)
event.setEntityId(previousSiteNodeVersion.getId());
SiteNodeVersionController.getController().delete(siteNodeVersion, db);
SiteNodeStateController.getController().changeStateOnMetaInfo(db, siteNode.getValueObject(), previousSiteNodeVersion.getValueObject(), previousSiteNodeVersion.getStateId(), "Denied publication", true, infoGluePrincipal, new ArrayList());
//db.remove(siteNodeVersion);
}
}
}
else if(event.getTypeId().intValue() == EventVO.UNPUBLISH_LATEST.intValue())