if(property != null)
{
List<ComponentBinding> bindings = (List<ComponentBinding>)property.get("bindings");
Iterator<ComponentBinding> bindingsIterator = bindings.iterator();
EntityVOWithSupplementingEntityVO entity;
while(bindingsIterator.hasNext())
{
try
{
ComponentBinding componentBinding = bindingsIterator.next();
entity = new EntityVOWithSupplementingEntityVO();
if ("Content".equalsIgnoreCase(componentBinding.getEntityClass()))
{
Integer contentId = componentBinding.getEntityId();
entity.setEntity(this.templateController.getContent(contentId));
}
else if ("External".equalsIgnoreCase(componentBinding.getEntityClass()))
{
Integer entityId = componentBinding.getEntityId();
entity.setEntity(new EntityVOWithSupplementingEntityVO.IdOnlyBaseEntityVO(entityId));
}
if (componentBinding instanceof SupplementedComponentBinding)
{
try
{
SupplementedComponentBinding supplementedComponentBinding = (SupplementedComponentBinding)componentBinding;
Integer supplementingEntityId = supplementedComponentBinding.getSupplementingEntityId();
String supplementingAssetKey = supplementedComponentBinding.getSupplementingAssetKey();
DigitalAssetVO asset = this.templateController.getAsset(supplementingEntityId, supplementingAssetKey);
entity.setSupplementingEntity(asset);
}
catch (Exception ex)
{
logger.warn("Error when getting asset for supplemented content.", ex);
}