EntityEnum entityEnum = EntityEnum.getEntityEnum(entity.getEntityType());
return lookupEntityName(entityEnum,entity.getId());
}
public String lookupEntityName(EntityEnum entityType, String entityId) {
IEntityNameFinder finder;
if (entityType.isGroup()) {
finder = EntityNameFinderService.instance()
.getNameFinder(IEntityGroup.class);
} else {
finder = EntityNameFinderService.instance()
.getNameFinder(entityType.getClazz());
}
try {
return finder.getName(entityId);
} catch (Exception e) {
/* An exception here isn't the end of the world. Just log it
and return null. */
log.warn("Couldn't find name for entity " + entityId, e);
return null;