boolean witholdWithheldElements = Util.getParam(params, "hide_withheld", false);
if (XmlSerializer.getThreadLocal(false) != null || witholdWithheldElements) {
XmlSerializer.getThreadLocal(true).setForceFilterEditOperation(witholdWithheldElements);
}
if (id == null) {
throw new MetadataNotFoundEx("Metadata not found.");
}
Lib.resource.checkPrivilege(context, id, ReservedOperation.view);
//-----------------------------------------------------------------------
//--- get metadata
Element elMd;
boolean addEditing = false;
if (!skipInfo) {
boolean withValidationErrors = false, keepXlinkAttributes = false;
elMd = gc.getBean(DataManager.class).getMetadata(context, id, addEditing, withValidationErrors, keepXlinkAttributes);
} else {
elMd = dm.getMetadataNoInfo(context, id);
}
if (elMd == null) {
throw new MetadataNotFoundEx(id);
}
if (addRefs) { // metadata.show for GeoNetwork needs geonet:element
elMd = dm.enumerateTree(elMd);
}