{
if(message.getClassName().indexOf("AccessRightImpl") > -1)
{
try
{
AccessRightVO acVO;
InterceptionPointVO icpVO;
try
{
acVO = AccessRightController.getController().getAccessRightVOWithId((Integer)message.getObjectId());
icpVO = InterceptionPointController.getController().getInterceptionPointVOWithId(acVO.getInterceptionPointId());
}
catch (Exception e)
{
logger.info("No access right found", e);
continue;
}
if(acVO != null && icpVO != null && !processedEntities.contains("" + icpVO.getCategory() + "_" + acVO.getParameters()))
{
//logger.info("icpVO:" + icpVO.getName());
if(icpVO.getName().indexOf("Content.") > -1)
{
//logger.info("Was a content access... let's clear caches for that content.");
String idAsString = acVO.getParameters();
if(idAsString != null && !idAsString.equals(""))
{
ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(idAsString));
publicationVO.setRepositoryId(new Integer(contentVO.getRepositoryId()));
PublicationDetailVO publicationDetailVO = new PublicationDetailVO();
publicationDetailVO.setCreationDateTime(DateHelper.getSecondPreciseDate());
publicationDetailVO.setDescription("Access rights change publication");
publicationDetailVO.setEntityClass("org.infoglue.cms.entities.content.Content");
publicationDetailVO.setEntityId(contentVO.getId());
publicationDetailVO.setName("" + contentVO.getName());
publicationDetailVO.setTypeId(PublicationDetailVO.PUBLISH);
publicationDetailVO.setCreator(this.getInfoGluePrincipal().getName());
publicationDetailVOList.add(publicationDetailVO);
}
}
else if(icpVO.getName().indexOf("ContentVersion.") > -1)
{
//logger.info("Was a contentversion access... let's clear caches for that content.");
String idAsString = acVO.getParameters();
if(idAsString != null && !idAsString.equals(""))
{
ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getContentVersionVOWithId(new Integer(idAsString));
ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(contentVersionVO.getContentId()));
publicationVO.setRepositoryId(new Integer(contentVO.getRepositoryId()));
PublicationDetailVO publicationDetailVO = new PublicationDetailVO();
publicationDetailVO.setCreationDateTime(DateHelper.getSecondPreciseDate());
publicationDetailVO.setDescription("Access rights change publication");
publicationDetailVO.setEntityClass("org.infoglue.cms.entities.content.ContentVersion");
publicationDetailVO.setEntityId(contentVersionVO.getId());
publicationDetailVO.setName("" + contentVO.getName() + "/" + contentVersionVO.getId());
publicationDetailVO.setTypeId(PublicationDetailVO.PUBLISH);
publicationDetailVO.setCreator(this.getInfoGluePrincipal().getName());
publicationDetailVOList.add(publicationDetailVO);
PublicationDetailVO publicationDetailVO2 = new PublicationDetailVO();
publicationDetailVO2.setCreationDateTime(DateHelper.getSecondPreciseDate());
publicationDetailVO2.setDescription("Access rights change publication");
publicationDetailVO2.setEntityClass("org.infoglue.cms.entities.content.Content");
publicationDetailVO2.setEntityId(contentVO.getId());
publicationDetailVO2.setName("" + contentVO.getName());
publicationDetailVO2.setTypeId(PublicationDetailVO.PUBLISH);
publicationDetailVO2.setCreator(this.getInfoGluePrincipal().getName());
publicationDetailVOList.add(publicationDetailVO2);
}
}
else if(icpVO.getName().indexOf("SiteNodeVersion.") > -1)
{
//logger.info("Was a sitenode version access... let's clear caches for that siteNodeVersion.");
String idAsString = acVO.getParameters();
if(idAsString != null && !idAsString.equals(""))
{
SiteNodeVersionVO siteNodeVersionVO = SiteNodeVersionController.getController().getSiteNodeVersionVOWithId(new Integer(idAsString));
SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(new Integer(siteNodeVersionVO.getSiteNodeId()));
publicationVO.setRepositoryId(new Integer(siteNodeVO.getRepositoryId()));
PublicationDetailVO publicationDetailVO = new PublicationDetailVO();
publicationDetailVO.setCreationDateTime(DateHelper.getSecondPreciseDate());
publicationDetailVO.setDescription("Access rights change publication");
publicationDetailVO.setEntityClass("org.infoglue.cms.entities.structure.SiteNode");
publicationDetailVO.setEntityId(siteNodeVO.getId());
publicationDetailVO.setName("" + siteNodeVO.getName());
publicationDetailVO.setTypeId(PublicationDetailVO.PUBLISH);
publicationDetailVO.setCreator(this.getInfoGluePrincipal().getName());
publicationDetailVOList.add(publicationDetailVO);
PublicationDetailVO publicationDetailVO2 = new PublicationDetailVO();
publicationDetailVO2.setCreationDateTime(DateHelper.getSecondPreciseDate());
publicationDetailVO2.setDescription("Access rights change publication");
publicationDetailVO2.setEntityClass("org.infoglue.cms.entities.structure.SiteNodeVersion");
publicationDetailVO2.setEntityId(siteNodeVersionVO.getId());
publicationDetailVO2.setName("" + siteNodeVO.getName() + "/" + siteNodeVersionVO.getId());
publicationDetailVO2.setTypeId(PublicationDetailVO.PUBLISH);
publicationDetailVO2.setCreator(this.getInfoGluePrincipal().getName());
publicationDetailVOList.add(publicationDetailVO2);}
}
else
{
//logger.info("****************************");
//logger.info("* WHAT TO DO WITH: " + icpVO.getName() + " *");
//logger.info("****************************");
}
//logger.info("Feeling done with " + "" + icpVO.getCategory() + "_" + acVO.getParameters());
processedEntities.add("" + icpVO.getCategory() + "_" + acVO.getParameters());
}
else
{
//logger.info("Allready processed " + icpVO.getCategory() + "_" + acVO.getParameters());
}