Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] [MOXy] compareSchemaOrder()

Hi Polly,

Unfortunately I don't think I have any great answers for you here. The Workbench code you reference is indeed internal, and would not be easily consumed or reused by an external application. Your best bet is probably to re-use the concept without trying to deal with all of the other behavior present in these classes.

I'm not sure exactly what information you are looking for in question 2. The general business logic in the Workbench is modeling design-time functionality available in the Workbench UI. The MWXmlDescriptor class specifically represents the design-time information necessary to create an XMLDescriptor in an EclipseLink project. MWXmlField and MWXpathStep also exist to represent the design-time information necessary to build EclipseLink projects. Are you asking more specifically about the ordering logic?

Neil



polly.c.chang wrote:
Hi,

I found some code inside the EclipseLink Workbench that sorts XML
descriptors in the order that the schema defines.  The code is in:

org.eclipse.persistence.tools.workbench.mappingsmodel.descriptor.xml.MWXmlDescriptor.orderedMappingComparator()
org.eclipse.persistence.tools.workbench.mappingsmodel.xml.compareSchemaOrder()

This functionality looks really useful, and I would like to be able to call
it instead of trying to duplicate it.  However, I'm having a hard time
trying to figure out if this API can be used outside of the Workbench.  What
I'm finding is that even though the code is well organized, there are not a
lot of comments, and I'm not that familiar with the domain.  So I'm having
some difficulty following it.  My questions are:

1.  Do you think it would be possible to instantiate the domain objects that
this code needs (such as MWXmlField, MWXpathStep, and maybe MWXmlDescriptor)
in order to use the code inside orderedMappingComparator()? 2. What does this business logic do? Can you explain the general flow? Since I need the same functionality, it would help to be able to understand how your system works.
I know I'm deep in the guts of the Workbench here, but this code looks
really nice.  You have obviously thought about this problem a lot more than
I have, and it works, so it would be great if I can make use of it.  Any
other advice that you have would be greatly appreciated.

Thanks!!
--Polly



Back to the top