+ product.getProductName()
+ "] that isn't in the index or the local cache!");
}
Metadata currMet = p.getMetadata();
List<Element> metadataTypes = null;
try {
metadataTypes = valLayer.getElements(product.getProductType());
} catch (ValidationLayerException e) {
e.printStackTrace();
throw new CatalogException(
"ValidationLayerException when trying to obtain element list for product type: "
+ product.getProductType().getName()
+ ": Message: " + e.getMessage());
}
for (Iterator<Element> i = metadataTypes.iterator(); i.hasNext();) {
Element element = i.next();
currMet.removeMetadata(element.getElementName());
}
p.setMetadata(currMet);
if (hasMetadataAndRefs(p)) {