private ModelAndView showElementInfo(String elementId, String partId,
String format) {
Map<String, Object> model = new HashMap<String, Object>();
try {
CatalogObject<String> object = catalogFacade
.getObject(new YaddaObjectID(elementId, null, null));
model.put("objectData", object);
if (object != null && StringUtils.isNotBlank(partId)) {
CatalogObjectPart<String> part = catalogFacade.getPart(
object.getId(), partId, null);
if (part != null && part.getData() != null) {
model.put("partId", part.getType());
model.put("part", part.getData());
} else {
model.put("part", "");
}
}
} catch (CatalogException e) {
throw new SystemException(Modules.CATALOG, e.getMessage(), e);
}
ModelAndView mdv;
if (format != null && format.equals("raw")) {
mdv = new ModelAndView(rawView, "catalog", model);
} else {
mdv = new ModelAndView(catalogView, "catalog", model);
}
return mdv;
}