[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.cosmos] Re: parsing query results from multiple MDRs

Dave,

To help flesh out my idea a bit further, maybe you could post examples of the incoming XML so we could together figure out something to key off of. If you want to disguise your model types for confidentiality, change them to fruits & vegetables or something.

Regarding your 2nd point, I would consider that a bug, at least without looking at it in great detail. I authorize you to create a defect for that. ;-) It should go against the DataCollection component. Don't worry about picking the wrong choices, we can always fix it up. And also don't worry if there might be a duplicate defect - we'd rather you create it and not lose time or track of the details, and we can always close it as a duplicate with minimal effort. In general, the Eclipse way is to err on the side of creating the defect. For this one, please be sure to put dlwhiteman @ us.ibm.com (without the spaces) on the cc: line.

Regards,
David

David Loewenstern wrote:
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