String name = qualifyer.getName();
String value = qualifyer.getValue();
try
{
RegistryVO registryVO = new RegistryVO();
registryVO.setReferenceType(RegistryVO.PAGE_BINDING);
if(name.equalsIgnoreCase("contentId"))
{
// TODO REMOVE OPTMIZ!
// Content content = ContentController.getContentController().getContentWithId(new Integer(value), db);
ContentVO contentVO = ContentController.getContentController().getContentVOWithId(new Integer(value), db);
registryVO.setEntityId(value);
registryVO.setEntityName(Content.class.getName());
registryVO.setReferencingEntityId(siteNodeVersionVO.getId().toString());
registryVO.setReferencingEntityName(SiteNodeVersion.class.getName());
registryVO.setReferencingEntityCompletingId("" + siteNodeId);
registryVO.setReferencingEntityCompletingName(SiteNode.class.getName());
SiteNodeVO snVO = SiteNodeController.getController().getSiteNodeVOWithId(siteNodeId);
LanguageVO masterLanguage = LanguageController.getController().getMasterLanguage(snVO.getRepositoryId(), db);
ContentVersionVO contentVersionVO = ContentVersionController.getContentVersionController().getLatestActiveContentVersionVO(contentVO.getContentId(), masterLanguage.getId(), db);
getComponents(siteNodeVersionVO, contentVersionVO.getVersionValue(), db);
getComponentBindings(siteNodeVersionVO, contentVersionVO.getVersionValue(), db);
/*
Collection contentVersions = content.getContentVersions();
Iterator contentVersionIterator = contentVersions.iterator();
while(contentVersionIterator.hasNext())
{
ContentVersion contentVersion = (ContentVersion)contentVersionIterator.next();
getComponents(siteNodeVersion, contentVersion.getVersionValue(), db);
getComponentBindings(siteNodeVersion, contentVersion.getVersionValue(), db);
}
*/
}
else if(name.equalsIgnoreCase("siteNodeId"))
{
registryVO.setEntityId(value);
registryVO.setEntityName(SiteNode.class.getName());
registryVO.setReferencingEntityId(siteNodeVersionVO.getId().toString());
registryVO.setReferencingEntityName(SiteNodeVersion.class.getName());
registryVO.setReferencingEntityCompletingId("" + siteNodeId);
registryVO.setReferencingEntityCompletingName(SiteNode.class.getName());
}
logger.info("Before creating registry entry...");
this.create(registryVO, db);