setProperty(modelNode, JcrId.PRODUCER_NAME, reader.getProducerName());
setProperty(modelNode, JcrId.PRODUCER_VERSION, reader.getProducerVersion());
setProperty(modelNode, JcrId.ORIGINAL_FILE, reader.getPath());
if (getVdbModel() != null) {
final VdbModel vdbModel = getVdbModel();
modelNode.setProperty(VdbLexicon.Model.VISIBLE, vdbModel.isVisible());
modelNode.setProperty(VdbLexicon.Model.CHECKSUM, vdbModel.getChecksum());
modelNode.setProperty(VdbLexicon.Model.BUILT_IN, vdbModel.isBuiltIn());
setProperty(modelNode, VdbLexicon.Model.DESCRIPTION, vdbModel.getDescription());
setProperty(modelNode, VdbLexicon.Model.PATH_IN_VDB, vdbModel.getPathInVdb());
setProperty(modelNode, VdbLexicon.Model.SOURCE_TRANSLATOR, vdbModel.getSourceTranslator());
setProperty(modelNode, VdbLexicon.Model.SOURCE_NAME, vdbModel.getSourceName());
setProperty(modelNode, VdbLexicon.Model.SOURCE_JNDI_NAME, vdbModel.getSourceJndiName());
// write out any model properties from vdb.xml file
for (final Entry<String, String> entry : vdbModel.getProperties().entrySet()) {
setProperty(modelNode, entry.getKey(), entry.getValue());
}
// write out and validation markers
if (!vdbModel.getProblems().isEmpty()) {
// add group node
final Node markersGroupNode = modelNode.addNode(VdbLexicon.Model.MARKERS, VdbLexicon.Model.MARKERS);
for (final ValidationMarker marker : vdbModel.getProblems()) {
final Node markerNode = markersGroupNode.addNode(VdbLexicon.Model.Marker.MARKER,
VdbLexicon.Model.Marker.MARKER);
setProperty(markerNode, VdbLexicon.Model.Marker.PATH, marker.getPath());
setProperty(markerNode, VdbLexicon.Model.Marker.MESSAGE, marker.getMessage());
setProperty(markerNode, VdbLexicon.Model.Marker.SEVERITY, marker.getSeverity().toString());