* @param context @return
*/
public List<ChoiceListValue> getChoiceListValues(ExtendedPropertyDefinition epd, String param, List<ChoiceListValue> values, Locale locale,
Map<String, Object> context) {
if (values != null && values.size() > 0) {
final JahiaTemplatesPackage template = ServicesRegistry.getInstance().getJahiaTemplateManagerService().getTemplatePackage(
epd.getDeclaringNodeType().getSystemId());
for (ChoiceListValue value : values) {
try {
final File imagePath = new File(
template.getFilePath() + File.separator + "img" + File.separator + value.getValue().getString() + "." + param);
if (imagePath.exists()) {
String s = Jahia.getContextPath();
if (s.equals("/")) {
s = "";
}
value.addProperty("image", s + (template.getRootFolderPath().startsWith("/")?"":"/")+template.getRootFolderPath() + "/img/" + value.getValue().getString() + "." + param);
} else {
logger.debug("ModuleImageChoiceListInitializerImpl : unable to find image " + template.getFilePath() + File.separator + "img" + File.separator + value.getValue().getString() + "." + param
+ " for property " + epd.getName()
+ " for type " + epd.getDeclaringNodeType().getName() );
}
} catch (RepositoryException e) {
logger.error(e.getMessage(), e);