Hey Andrea,

SO yeah, the way the encoder delegate works now is if an object to be
encoded doesn't match a binding, it is checked as an instance of
EncoderDelegate. And if so the encoder control is passed off to it. So
indeed one option would be to add something like:

  List<Object> getExtendedCapabilities()

To the EMF model. And if those objects implement EncoderDelegate I think it
would just work.

If that doesn't suffice an alternative might be a specialized interface,
something like ExtendedCapabiltiiesEncoder that would look like:

ExtendedCapabilitiesEncoder {
   boolean canEncode(Object);

   Element encode(Object);
}

Then the binding for ExtendedCapabiltieis could look up all instances of
these. To do this it just has to declare the Configuration object as an
argument to the constructor.


ExtendedCapabiltiesBinding {

    ExtendedCapabiltiesBinding(Configuration config) {
        ...
    }

    Element encode(..)  {
        List encoders =
config.getComponentInstnacesOfType(ExtendedCapabilitiesEncoder.class):

       //figure out which one to use, and delegate to it
    }
}

A third potential alternative is a mix of the two. Right now
EncoderDelegate only kicks in if an object is an instance of the interface.
If that is not the case the encoder could fall back on doing this sort of
lookup. To do this i think we would need an EncoderDelegate2 interface.

EncoderDelegate2 extends EncoderDelegate {
    boolean canHandle(Object):

    void encode(Object, ContentHandler handler);
}

Basically more or less making EncoderDelegate the exact parallel to
ParserDelegate.

Sorry, sort of rambled there. But some thoughts for you :)

On Wed, Oct 24, 2012 at 12:11 PM, Andrea Aime
<[email protected]>wrote:

> Hi,
> I was trying to add the extended caps section to the OWS 1.0
> CapabilitiesType
> object but.. discovered it's not there.
>
> Now, the schema just says:
>
> <element name="ExtendedCapabilities" type="anyType"/>
>
> and I have to generate the following:
>
> <!-- parent product id list -->
>     <ows:ExtendedCapabilities
>       xmlns:rim="urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0">
>       <rim:Slot name="urn:ogc:def:slot:OGC-CSW-ebRIM-EO::parentIdentifier"
>         slotType="urn:oasis:names:tc:ebxml-regrep:DataType:String">
>         <rim:ValueList>
>         <rim:Value>urn:ogc:def:EOP:VENDOR:SAT1_50cm_P</rim:Value>
>         <rim:Value>urn:ogc:def:EOP:VENDOR:SAT2_50cm_P</rim:Value>
>         <rim:Value>urn:ogc:def:EOP:VENDOR:SAT2_2m_M</rim:Value>
>         <rim:Value>urn:ogc:def:EOP:VENDOR:SAT3_50cm_P</rim:Value>
>         <rim:Value>urn:ogc:def:EOP:VENDOR:SAT4_2M_P</rim:Value>
>         </rim:ValueList>
>       </rim:Slot>
>     </ows:ExtendedCapabilities>
>
> Hum... I guess I have to add a extendedCapabilties field to the EMF model,
> and then... hum... what?
> The binding for the extended caps should somehow delegate to another
> object, I guess a EncoderDelegate.
> But how do I set this up? Suggestions?
>
> Does it make sense to put the EncoderDelegate instance right into the
> extendedCapabilities field value?
>
> Cheers
> Andrea
>
> --
> ==
> Our support, Your Success! Visit http://opensdi.geo-solutions.it for
> more information.
> ==
>
> Ing. Andrea Aime
> @geowolf
> Technical Lead
>
> GeoSolutions S.A.S.
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
> phone: +39 0584 962313
> fax: +39 0584 1660272
> mob: +39 339 8844549
>
> http://www.geo-solutions.it
> http://twitter.com/geosolutions_it
>
> -------------------------------------------------------
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> GeoTools-Devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>



-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to