Thanks for the quick response, Dave.
I'm afraid to create defects or enhancements until I understand COSMOS a
bit better. I don't want to spam defects that have already been
addressed or that really work as designed. If we establish that I have
in fact uncovered either a defect or a feature that needs to be
addressed, I'll submit a bug report/feature request.
I thought of using a serializer aggregate but I couldn't figure out what
it would key off of. The problem is that the metadata you'd need to
know which serializer to use (e.g., a schema name or an MDR identifier)
isn't available at the point that the serializer is called.
Yes, a serializer registry could work.
The idea for the last sentence came from the javadoc for
IRecord.setValueFromString:
* Set the value for this record from a string.
* This API is needed because the value coming in
* from XML will be raw text. Implementers are
* responsible for converting this raw text to
* their format of choice.
So, if I created my own implementation of IRecord, I could have it parse
the XML appropriately, using its own serializer instead of the one
registered with CMDBfServicesUtil. But how do I get
QueryOutputStreamHandler to use my IRecord implementation? Here is line
108 of QueryOutputStreamHandler.java:
currentRecord =
CommonArtifactFactory.getInstance().createRecord(currentResultEntity,
null);
Why isn't it this?
currentRecord = getArtifactFactory().createRecord(currentResultEntity,
null);
If it were, then I could create different artifact factories for
different MDRs, although that might not be the easiest method.
Dave