names.addAll(Arrays.asList(defs));
}
ArrayList<JcrProperty> list = new ArrayList<>();
for (PropertyDefinition def : names) {
JcrProperty prop = null;
String name = def.getName();
String type = PropertyType.nameFromValue(def.getRequiredType());
String value = null;
String display = null;
Property p = null;
try {
p = node.getProperty(def.getName());
} catch (PathNotFoundException e) {
}
display = values(def, p);
switch (def.getRequiredType()) {
case PropertyType.BINARY:
HttpServletRequest request = this.getThreadLocalRequest();
String context = request.getContextPath();
value = String.format("%s/binary/node?repository=%s&workspace=%s&path=%s&property=%s",
context, repository, workspace, path, def.getName());
break;
default:
value = p == null ? "N/A" : p.getValue() != null ? p.getValue().getString() : "N/A";
break;
}
list.add(new JcrProperty(name, type, value, display));
}
return list;
}