SiteNodeVO siteNodeVO = SiteNodeController.getController().getSiteNodeVOWithId(new Integer(transactionQueueVO.getTransactionObjectId()), db);
if(siteNodeVO != null)
{
SiteNodeVersionVO version = SiteNodeVersionController.getController().getLatestSiteNodeVersionVO(db, siteNodeVO.getId());
SubscriptionVO creatorSubscriptionVO = new SubscriptionVO();
creatorSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
creatorSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
creatorSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
creatorSubscriptionVO.setName("Standard subscription");
creatorSubscriptionVO.setUserName(siteNodeVO.getCreatorName());
subscriptionVOList.add(creatorSubscriptionVO);
if(version != null)
{
if(!version.getVersionModifier().equals(siteNodeVO.getCreatorName()))
{
SubscriptionVO modifyerSubscriptionVO = new SubscriptionVO();
modifyerSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
modifyerSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
modifyerSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
modifyerSubscriptionVO.setName("Standard subscription");
modifyerSubscriptionVO.setUserName(version.getVersionModifier());
subscriptionVOList.add(modifyerSubscriptionVO);
}
}
}
}
else if(transactionQueueVO.getInterceptionPointVO().getName().equalsIgnoreCase("Content.ExpireDateComingUp"))
{
logger.info("It's a expiredate coming up event... let's find add a fake subscription on the last modifier.");
ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(transactionQueueVO.getTransactionObjectId()), db);
if(contentVO != null)
{
SubscriptionVO creatorSubscriptionVO = new SubscriptionVO();
creatorSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
creatorSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
creatorSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
creatorSubscriptionVO.setName("Standard subscription");
creatorSubscriptionVO.setUserName(contentVO.getCreatorName());
subscriptionVOList.add(creatorSubscriptionVO);
List languages = LanguageController.getController().getLanguageVOList(contentVO.getRepositoryId(), db);
Iterator languagesIterator = languages.iterator();
while(languagesIterator.hasNext())
{
LanguageVO languageVO = (LanguageVO)languagesIterator.next();
ContentVersionVO version = ContentVersionController.getContentVersionController().getLatestContentVersionVO(contentVO.getId(), languageVO.getId(), db);
if(version != null)
{
if(!version.getVersionModifier().equals(contentVO.getCreatorName()))
{
SubscriptionVO modifyerSubscriptionVO = new SubscriptionVO();
modifyerSubscriptionVO.setEntityId(transactionQueueVO.getTransactionObjectId());
modifyerSubscriptionVO.setEntityName(transactionQueueVO.getTransactionObjectName());
modifyerSubscriptionVO.setInterceptionPointId(transactionQueueVO.getInterceptionPointVO().getId());
modifyerSubscriptionVO.setName("Standard subscription");
modifyerSubscriptionVO.setUserName(version.getVersionModifier());
subscriptionVOList.add(modifyerSubscriptionVO);
}
}
}
}
}
Iterator<SubscriptionVO> subscriptionVOListIterator = subscriptionVOList.iterator();
while(subscriptionVOListIterator.hasNext())
{
SubscriptionVO subscriptionVO = subscriptionVOListIterator.next();
boolean subscriptionHandled = handleSubscription(subscriptionVO, transactionQueueVO, db);
if(subscriptionHandled)
completeTransactions.add(transactionQueueVO);
}