Jon Britton wrote:
> The parser is also having trouble with casting Strings. For some types (e.g.
> MetadataTypeType and StringOrRefType) it wants a String instead so I get a
> ClassCastException. I tried changing the EMF objects using these types
> manually and replacing MetadataTypeType with String, for example, but this
> is getting a bit complicated.
Are these types complex with simple content. I have found issues with
those sorts of types in the past so I came up with a special binding for
them: SimpleContentComplexEMFBinding.
>
> I'm not even sure what some of the types are - why does EMF use
> StringOrRefType when it can just use a String?
Tough to say... it depends on the schema. If the types are complex (not
sure I don't have the schema) with simple content, that is probably why.
>
> Is changing EMF classes manually the normal way of doing things? I'm
> assuming that when it wants a a LonLatEnvelopeType when I've actually got a
> GeneralEnvelope then I'd need to do this anyway. But what about these other
> types (like StringOrRefType or enumerations like MetadataTypeType...).
Yes, for the exact case you state. For instance when generating the WFS
model, EMF gave me its version of filter classes. But we already have an
object model in geotools for filter so i have to "instrument" (change th
e interface, reload the model, and re-generate).
>
> Argh!
If you can start sharing some of your code somehow I can provide better
feedback and help by having test cases to run.
>
> Jon
>
>
> Jon Britton wrote:
>> Hi,
>>
>> I'm still trying to parse the WCS Capabilities document using the existing
>> EMF model. However, it seems to have trouble creating a RequestType
>> object as in:
>>
>> <complexType name="WCSCapabilityType">
>> <sequence>
>> <element name="Request">
>> <complexType>
>> <sequence>
>> <element name="GetCapabilities">
>> <complexType>
>> ...
>>
>> There is a GetCapabilitiesType1 class which corresponds to the
>> GetCapabilities element above, but this doesn't seem to be getting called.
>> Instead it thinks its a HashMap, so when RequestType's eSet() is called
>> for the GetCapabilities element I get a ClassCastException:
>>
>> public void eSet(int featureID, Object newValue) {
>> switch (featureID) {
>> case Wcs10Package.REQUEST_TYPE__GET_CAPABILITIES:
>> setGetCapabilities((GetCapabilitiesType1)newValue);
>> <--ClassCastException, newValue is a HashMap, not a GetCapabilitiesType1!)
>>
>> I'm a bit confused as to how EMF determines what type an element
>> corresponds to since I can't find anything which tells it to create a
>> HashMap instead of a GetCapabilitiesType1. I'm not sure if that makes any
>> sense, but if anyone can see what's going wrong I'd be greatful for some
>> help!
>>
>> Thanks,
>>
>> Jon
>>
>
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users