{
Collection assets = userProperties.getDigitalAssets();
Iterator assetsIterator = assets.iterator();
while(assetsIterator.hasNext())
{
DigitalAsset digitalAsset = (DigitalAsset)assetsIterator.next();
if(digitalAsset.getAssetKey().equalsIgnoreCase(assetKey))
{
SiteNode siteNode = SiteNodeController.getController().getSiteNodeWithId(siteNodeId, db);
assetUrl = DigitalAssetDeliveryController.getDigitalAssetDeliveryController().getAssetThumbnailUrl(digitalAsset, siteNode.getRepository(), width, height, deliveryContext);
break;
}
}
}
}
if(assetUrl.equals(""))
{
List roles = infoGluePrincipal.getRoles();
Iterator rolesIterator = roles.iterator();
while(rolesIterator.hasNext())
{
InfoGlueRole role = (InfoGlueRole)rolesIterator.next();
Collection rolePropertiesList = RolePropertiesController.getController().getRolePropertiesList(role.getName(), languageId, db, true);
Iterator rolePropertiesListIterator = rolePropertiesList.iterator();
while(rolePropertiesListIterator.hasNext())
{
RoleProperties roleProperties = (RoleProperties)rolePropertiesListIterator.next();
if(roleProperties != null && roleProperties.getLanguage().getLanguageId().equals(languageId))
{
Collection assets = roleProperties.getDigitalAssets();
Iterator assetsIterator = assets.iterator();
while(assetsIterator.hasNext())
{
DigitalAsset digitalAsset = (DigitalAsset)assetsIterator.next();
if(digitalAsset.getAssetKey().equalsIgnoreCase(assetKey))
{
SiteNode siteNode = SiteNodeController.getController().getSiteNodeWithId(siteNodeId, db);
assetUrl = DigitalAssetDeliveryController.getDigitalAssetDeliveryController().getAssetThumbnailUrl(digitalAsset, siteNode.getRepository(), width, height, deliveryContext);
break;
}
}
}
}
}
if(assetUrl.equals("") && useLanguageFallback)
{
LanguageVO masterLanguageVO = LanguageDeliveryController.getLanguageDeliveryController().getMasterLanguageForSiteNode(db, siteNodeId);
if(!masterLanguageVO.getLanguageId().equals(languageId))
return getPrincipalThumbnailAssetUrl(db, infoGluePrincipal, assetKey, masterLanguageVO.getLanguageId(), siteNodeId, useLanguageFallback, width, height, deliveryContext);
}
}
if(assetUrl.equals(""))
{
List groups = infoGluePrincipal.getGroups();
Iterator groupsIterator = groups.iterator();
while(groupsIterator.hasNext())
{
InfoGlueGroup group = (InfoGlueGroup)groupsIterator.next();
Collection groupPropertiesList = GroupPropertiesController.getController().getGroupPropertiesList(group.getName(), languageId, db, true);
Iterator groupPropertiesListIterator = groupPropertiesList.iterator();
while(groupPropertiesListIterator.hasNext())
{
GroupProperties groupProperties = (GroupProperties)groupPropertiesListIterator.next();
if(groupProperties != null && groupProperties.getLanguage().getLanguageId().equals(languageId))
{
Collection assets = groupProperties.getDigitalAssets();
Iterator assetsIterator = assets.iterator();
while(assetsIterator.hasNext())
{
DigitalAsset digitalAsset = (DigitalAsset)assetsIterator.next();
if(digitalAsset.getAssetKey().equalsIgnoreCase(assetKey))
{
SiteNode siteNode = SiteNodeController.getController().getSiteNodeWithId(siteNodeId, db);
assetUrl = DigitalAssetDeliveryController.getDigitalAssetDeliveryController().getAssetThumbnailUrl(digitalAsset, siteNode.getRepository(), width, height, deliveryContext);
break;
}