diff --git a/server/oslc-ui-model/src/main/java/org/eclipse/lyo/server/ui/model/PreviewFactory.java b/server/oslc-ui-model/src/main/java/org/eclipse/lyo/server/ui/model/PreviewFactory.java index b73948037..13c3d99d2 100644 --- a/server/oslc-ui-model/src/main/java/org/eclipse/lyo/server/ui/model/PreviewFactory.java +++ b/server/oslc-ui-model/src/main/java/org/eclipse/lyo/server/ui/model/PreviewFactory.java @@ -68,12 +68,25 @@ public static Preview getPreview(final AbstractResource aResource, List value = constructPropertyValue(PropertyDefintion.RepresentationType.LINK, multiple, l); } else { Link link = (Link) getterMethod.invoke(aResource); - value = constructPropertyValue(PropertyDefintion.RepresentationType.LINK, multiple, - constructLink(link)); + value = constructPropertyValue(PropertyDefintion.RepresentationType.LINK, multiple, constructLink(link)); } } else { - value = constructPropertyValue(PropertyDefintion.RepresentationType.TEXT, multiple, - getterMethod.invoke(aResource)); + if (!isNotInlinedRepresentation) { + if (multiple) { + Collection rs = (Collection) getterMethod.invoke(aResource); + List l = new ArrayList<>(); + for (AbstractResource r: rs) { + l.add(constructLink(r.getAbout().toString(), r.toString())); + } + value = constructPropertyValue(PropertyDefintion.RepresentationType.LINK, multiple, l); + } else { + AbstractResource r = (AbstractResource) getterMethod.invoke(aResource); + value = constructPropertyValue(PropertyDefintion.RepresentationType.LINK, multiple, constructLink(r.getAbout().toString(), r.toString())); + } + } + else { + value = constructPropertyValue(PropertyDefintion.RepresentationType.TEXT, multiple, getterMethod.invoke(aResource)); + } } previewItems.add(constructProperty(key, value)); }