Iterator siteNodeVersionIterator = siteNodeVersions.iterator();
boolean metaInfoContentDeleted = false;
while (siteNodeVersionIterator.hasNext())
{
SiteNodeVersion siteNodeVersion = (SiteNodeVersion)siteNodeVersionIterator.next();
Collection serviceBindings = Collections.synchronizedCollection(siteNodeVersion.getServiceBindings());
Iterator serviceBindingIterator = serviceBindings.iterator();
while(serviceBindingIterator.hasNext())
{
ServiceBinding serviceBinding = (ServiceBinding)serviceBindingIterator.next();
if(serviceBinding.getAvailableServiceBinding().getName().equalsIgnoreCase("Meta information"))
{
if(!metaInfoContentDeleted)
{
try
{
if(siteNode.getMetaInfoContentId() != null)
{
ContentVO contentVO = ContentController.getContentController().getContentVOWithId(siteNode.getMetaInfoContentId(), db);
ContentController.getContentController().delete(contentVO, db, true, true, true, infoGluePrincipal);
}
//deleteMetaInfoForSiteNodeVersion(db, serviceBinding, infoGluePrincipal);
}
catch(Exception e)
{
logger.error("An error was thrown when we tried to delete the meta info for the version. Could be deleted allready");
}
metaInfoContentDeleted = true;
}
serviceBindingIterator.remove();
db.remove(serviceBinding);
}
else
{
serviceBindingIterator.remove();
db.remove(serviceBinding);
}
}
logger.info("Deleting siteNodeVersion:" + siteNodeVersion.getSiteNodeVersionId());
siteNodeVersionIterator.remove();
db.remove(siteNodeVersion);
}
}