Re: Handling collections with Aegis in JAX-RS

2009-09-07 Thread Sergey Beryozkin

How about dropping the namespaces from the produced JSON ? A simple wrapper
around XMLStreamWriter woud do it. And Jettison can produce natural JSONs
too (some configuration is needed for that)

As I said in the other email, some users may've invested in Aegis already.
So suppose they have a method which returns 

Map 

how would Jackson serialize it in this case, and how would Aegis + JSON  do
it ?
I'm not a JSON expert and I haven't tried Jackson but I'm nearly sure Aegis
will do pretty well here too (especially an 'unqualified' one)

I'd be keen on Aegis + JSON working for this reason : let Aegis users output
their explicit collections in JSON. I'm not thinking of presenting
Aegis+JSON as the best CXF JSON offer.

So, I'd say it's your call. 

Sergey


bimargulies wrote:
> 
> Sergey,
> 
> Fine when producing JSON, albeit very ugly JSON. Completely impractical
> when
> reading the stuff. I can see no way to make it work in a live application.
> I
> also can't see why anyone would want this, as compared to what comes out
> of
> the Jackson provider. Which can be tuned with annotations, etc, etc.
> 
> --benson
> 
> 
> On Sun, Sep 6, 2009 at 5:58 PM, Sergey Beryozkin
> wrote:
> 
>>
>> Hi Benson
>>
>> JSON has no idea of what namespaces so it needs to map namespaces to
>> something, hence the need for
>> a namespace map being setup. In simple cases it's now being done
>> automatically...
>>
>> cheers, Sergey
>>
>>
>> bimargulies wrote:
>> >
>> > Sergey,
>> >
>> > I've made it as far as the namespace issues with JSON, since the
>> changes
>> > I've made to deal with generic types have made them worse.
>> >
>> > There's something here that I just don't follow.
>> >
>> > When the output is XML, all the namespaces just take care of
>> themselves.
>> > Aegis assigns prefixes and StaX writes them. Admittedly, if Aegis ever
>> > forgot to assign a prefix StaX would just go add an xmlns=, but I don't
>> > (yet) think that this is something that happens.
>> >
>> > Do you have any idea why the JSON environment ends up being so much
>> more
>> > fussy?
>> >
>> > --benson
>> >
>> >
>> > On Mon, Aug 24, 2009 at 8:58 AM, Sergey Beryozkin
>> > > >> wrote:
>> >
>> >>
>> >> Hi Benson
>> >>
>> >> Thanks for spending your time on these tests, and fixing CXF 2401. I
>> was
>> >> also able to add few more tests, including the one which writes/reads
>> a
>> >> complex Map to/from JSON.
>> >>
>> >> AegisJSONProvider tries its best for users to avoid setting up a
>> >> namespace
>> >> map manually, but in cases when it does not guess properly the users
>> >> would
>> >> be able to overwrite namespaces and their prefixes as needed. This
>> isssue
>> >> would likely arise on the read side only, when CXF reads it. JSON is
>> >> namespace-unaware so when reading, one needs to setup a namespace map
>> for
>> >> Jettison to report values like @ns1.bar to the JAXB reader... (but
>> only
>> >> if
>> >> AegisJSONProvider has not guessed how to map prefixes to namespaces)
>> >>
>> >> There's a couple of issues I'd like to discuss. First one is that
>> >> AegisJsonProviderTest.testReadWriteComplexMap does have to setup a
>> >> namespace
>> >> for a map root element, but it does not have to do it for
>> >> testWrite/ReadCollection tests. I'm wondering, can it be avoided in
>> cases
>> >> when Maps are being written/read ? That is, can we modify
>> >> createReader/Writer methods such that QNames for containers like
>> >> Map/Collections and its member types are available ?
>> >>
>> >> Another one is that DataBindingJSONProvider test (aegis tests) still
>> can
>> >> not
>> >> handle collections. I think the problem there is that when
>> >> DataBindingProvider (the one DataBindingJSONProvider extends) is being
>> >> initialized, it uses a workaround which we discussed in the other
>> thread.
>> >> Namely, it attempts to convert a JAXRS model info into WSDL-like one
>> and
>> >> set
>> >> calls DataBinding.initialize(Service). It's quite limiting for a
>> number
>> >> of
>> >> reasons, and one of them is that the generic types are not visible to
>> >> data
>> >> bindings
>> >> So we introduced PropertiesAwareDataBinding interface and I've just
>> >> updated
>> >> the JAXRS code to call it like this :
>> >>
>> >> Map, Type> allClasses = getAllJAXRSResponseInputTypes();
>> >> Map props = new HashMap();
>> >> props.put(PropertiesAwareDataBinding.TYPES_PROPERTY, allClasses);
>> >> ((PropertiesAwareDataBinding)db).initialize(props);
>> >>
>> >> At the moment no CXF DataBindings implement this newly introduced
>> >> interface.
>> >> I think the only way for  DataBindingJSONProvider aegis tests which
>> >> handle
>> >> collections to start passing is for Aegis DataBinding to implement
>> >> PropertiesAwareDataBinding and initialize itself using the provided
>> >> Map, Type>, as opposed to Service. Would you be open to
>> updating
>> >> the Aegis databinding ?
>> >>
>> >> thanks, Sergey
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >

Re: Handling collections with Aegis in JAX-RS

2009-09-06 Thread Benson Margulies
Sergey,

Fine when producing JSON, albeit very ugly JSON. Completely impractical when
reading the stuff. I can see no way to make it work in a live application. I
also can't see why anyone would want this, as compared to what comes out of
the Jackson provider. Which can be tuned with annotations, etc, etc.

--benson


On Sun, Sep 6, 2009 at 5:58 PM, Sergey Beryozkin
wrote:

>
> Hi Benson
>
> JSON has no idea of what namespaces so it needs to map namespaces to
> something, hence the need for
> a namespace map being setup. In simple cases it's now being done
> automatically...
>
> cheers, Sergey
>
>
> bimargulies wrote:
> >
> > Sergey,
> >
> > I've made it as far as the namespace issues with JSON, since the changes
> > I've made to deal with generic types have made them worse.
> >
> > There's something here that I just don't follow.
> >
> > When the output is XML, all the namespaces just take care of themselves.
> > Aegis assigns prefixes and StaX writes them. Admittedly, if Aegis ever
> > forgot to assign a prefix StaX would just go add an xmlns=, but I don't
> > (yet) think that this is something that happens.
> >
> > Do you have any idea why the JSON environment ends up being so much more
> > fussy?
> >
> > --benson
> >
> >
> > On Mon, Aug 24, 2009 at 8:58 AM, Sergey Beryozkin
> >  >> wrote:
> >
> >>
> >> Hi Benson
> >>
> >> Thanks for spending your time on these tests, and fixing CXF 2401. I was
> >> also able to add few more tests, including the one which writes/reads a
> >> complex Map to/from JSON.
> >>
> >> AegisJSONProvider tries its best for users to avoid setting up a
> >> namespace
> >> map manually, but in cases when it does not guess properly the users
> >> would
> >> be able to overwrite namespaces and their prefixes as needed. This
> isssue
> >> would likely arise on the read side only, when CXF reads it. JSON is
> >> namespace-unaware so when reading, one needs to setup a namespace map
> for
> >> Jettison to report values like @ns1.bar to the JAXB reader... (but only
> >> if
> >> AegisJSONProvider has not guessed how to map prefixes to namespaces)
> >>
> >> There's a couple of issues I'd like to discuss. First one is that
> >> AegisJsonProviderTest.testReadWriteComplexMap does have to setup a
> >> namespace
> >> for a map root element, but it does not have to do it for
> >> testWrite/ReadCollection tests. I'm wondering, can it be avoided in
> cases
> >> when Maps are being written/read ? That is, can we modify
> >> createReader/Writer methods such that QNames for containers like
> >> Map/Collections and its member types are available ?
> >>
> >> Another one is that DataBindingJSONProvider test (aegis tests) still can
> >> not
> >> handle collections. I think the problem there is that when
> >> DataBindingProvider (the one DataBindingJSONProvider extends) is being
> >> initialized, it uses a workaround which we discussed in the other
> thread.
> >> Namely, it attempts to convert a JAXRS model info into WSDL-like one and
> >> set
> >> calls DataBinding.initialize(Service). It's quite limiting for a number
> >> of
> >> reasons, and one of them is that the generic types are not visible to
> >> data
> >> bindings
> >> So we introduced PropertiesAwareDataBinding interface and I've just
> >> updated
> >> the JAXRS code to call it like this :
> >>
> >> Map, Type> allClasses = getAllJAXRSResponseInputTypes();
> >> Map props = new HashMap();
> >> props.put(PropertiesAwareDataBinding.TYPES_PROPERTY, allClasses);
> >> ((PropertiesAwareDataBinding)db).initialize(props);
> >>
> >> At the moment no CXF DataBindings implement this newly introduced
> >> interface.
> >> I think the only way for  DataBindingJSONProvider aegis tests which
> >> handle
> >> collections to start passing is for Aegis DataBinding to implement
> >> PropertiesAwareDataBinding and initialize itself using the provided
> >> Map, Type>, as opposed to Service. Would you be open to
> updating
> >> the Aegis databinding ?
> >>
> >> thanks, Sergey
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> bimargulies wrote:
> >> >
> >> > I have a rather clear memory of working on these, there wasn't enough
> >> > passing of Generic classes around. I'll go have a look.
> >> >
> >> >
> >> > On Fri, Aug 21, 2009 at 6:38 AM, Sergey
> >> > Beryozkin wrote:
> >> >>
> >> >> Hi Benson
> >> >>
> >> >> if you could look at any of these tests or at least point me in the
> >> right
> >> >> direction then it would be great.
> >> >> I know you're busy - so just look at it whenever you get a chance,
> not
> >> >> urgent...
> >> >>
> >> >> cheers, Sergey
> >> >>
> >> >>
> >> >> Sergey Beryozkin-2 wrote:
> >> >>>
> >> >>>
> >> >>>
> >> >>> Hi Benson
> >> >>>
> >> >>> I can't make the Aegis tests writing/reading collections working in
> >> CXF
> >> >>> JAX-RS.
> >> >>> I've found that AegisProviderTest#testReadWriteComplexMap is still
> >> >>> @Ignored, it might've passed for you because it was @Ignored :-)
> >> >>>
> >> >>> I've also added testWriteColle

Re: Handling collections with Aegis in JAX-RS

2009-09-06 Thread Sergey Beryozkin

Hi Benson

JSON has no idea of what namespaces so it needs to map namespaces to
something, hence the need for
a namespace map being setup. In simple cases it's now being done
automatically...

cheers, Sergey
 

bimargulies wrote:
> 
> Sergey,
> 
> I've made it as far as the namespace issues with JSON, since the changes
> I've made to deal with generic types have made them worse.
> 
> There's something here that I just don't follow.
> 
> When the output is XML, all the namespaces just take care of themselves.
> Aegis assigns prefixes and StaX writes them. Admittedly, if Aegis ever
> forgot to assign a prefix StaX would just go add an xmlns=, but I don't
> (yet) think that this is something that happens.
> 
> Do you have any idea why the JSON environment ends up being so much more
> fussy?
> 
> --benson
> 
> 
> On Mon, Aug 24, 2009 at 8:58 AM, Sergey Beryozkin
> > wrote:
> 
>>
>> Hi Benson
>>
>> Thanks for spending your time on these tests, and fixing CXF 2401. I was
>> also able to add few more tests, including the one which writes/reads a
>> complex Map to/from JSON.
>>
>> AegisJSONProvider tries its best for users to avoid setting up a
>> namespace
>> map manually, but in cases when it does not guess properly the users
>> would
>> be able to overwrite namespaces and their prefixes as needed. This isssue
>> would likely arise on the read side only, when CXF reads it. JSON is
>> namespace-unaware so when reading, one needs to setup a namespace map for
>> Jettison to report values like @ns1.bar to the JAXB reader... (but only
>> if
>> AegisJSONProvider has not guessed how to map prefixes to namespaces)
>>
>> There's a couple of issues I'd like to discuss. First one is that
>> AegisJsonProviderTest.testReadWriteComplexMap does have to setup a
>> namespace
>> for a map root element, but it does not have to do it for
>> testWrite/ReadCollection tests. I'm wondering, can it be avoided in cases
>> when Maps are being written/read ? That is, can we modify
>> createReader/Writer methods such that QNames for containers like
>> Map/Collections and its member types are available ?
>>
>> Another one is that DataBindingJSONProvider test (aegis tests) still can
>> not
>> handle collections. I think the problem there is that when
>> DataBindingProvider (the one DataBindingJSONProvider extends) is being
>> initialized, it uses a workaround which we discussed in the other thread.
>> Namely, it attempts to convert a JAXRS model info into WSDL-like one and
>> set
>> calls DataBinding.initialize(Service). It's quite limiting for a number
>> of
>> reasons, and one of them is that the generic types are not visible to
>> data
>> bindings
>> So we introduced PropertiesAwareDataBinding interface and I've just
>> updated
>> the JAXRS code to call it like this :
>>
>> Map, Type> allClasses = getAllJAXRSResponseInputTypes();
>> Map props = new HashMap();
>> props.put(PropertiesAwareDataBinding.TYPES_PROPERTY, allClasses);
>> ((PropertiesAwareDataBinding)db).initialize(props);
>>
>> At the moment no CXF DataBindings implement this newly introduced
>> interface.
>> I think the only way for  DataBindingJSONProvider aegis tests which
>> handle
>> collections to start passing is for Aegis DataBinding to implement
>> PropertiesAwareDataBinding and initialize itself using the provided
>> Map, Type>, as opposed to Service. Would you be open to updating
>> the Aegis databinding ?
>>
>> thanks, Sergey
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> bimargulies wrote:
>> >
>> > I have a rather clear memory of working on these, there wasn't enough
>> > passing of Generic classes around. I'll go have a look.
>> >
>> >
>> > On Fri, Aug 21, 2009 at 6:38 AM, Sergey
>> > Beryozkin wrote:
>> >>
>> >> Hi Benson
>> >>
>> >> if you could look at any of these tests or at least point me in the
>> right
>> >> direction then it would be great.
>> >> I know you're busy - so just look at it whenever you get a chance, not
>> >> urgent...
>> >>
>> >> cheers, Sergey
>> >>
>> >>
>> >> Sergey Beryozkin-2 wrote:
>> >>>
>> >>>
>> >>>
>> >>> Hi Benson
>> >>>
>> >>> I can't make the Aegis tests writing/reading collections working in
>> CXF
>> >>> JAX-RS.
>> >>> I've found that AegisProviderTest#testReadWriteComplexMap is still
>> >>> @Ignored, it might've passed for you because it was @Ignored :-)
>> >>>
>> >>> I've also added testWriteCollections() (which writes
>> >>> List)
>> >>> to AegisJSONProviderTest. I also updated DataBindingJSONProviderTest,
>> >>> one
>> >>> of its internal classes to return List. AegisJSONProvider
>> extends
>> >>> AegisElementProvider, DataBindingJSONProvider extends
>> >>> DataBindingProvider
>> >>> which actually (in this case) delegates to Aegis DataBinding.
>> >>>
>> >>> AegisJSONProviderTest fails at the write time, it can't find the
>> mapping
>> >>> for List. DataBindingJSONProviderTest fails early at the Aegis
>> >>> DataBinding
>> >>> initialization time for the same reason. I thought Lists were
>> supported
>> >>> by
>> >>> default ? I h

Re: Handling collections with Aegis in JAX-RS

2009-09-05 Thread Benson Margulies
Sergey,

I've made it as far as the namespace issues with JSON, since the changes
I've made to deal with generic types have made them worse.

There's something here that I just don't follow.

When the output is XML, all the namespaces just take care of themselves.
Aegis assigns prefixes and StaX writes them. Admittedly, if Aegis ever
forgot to assign a prefix StaX would just go add an xmlns=, but I don't
(yet) think that this is something that happens.

Do you have any idea why the JSON environment ends up being so much more
fussy?

--benson


On Mon, Aug 24, 2009 at 8:58 AM, Sergey Beryozkin  wrote:

>
> Hi Benson
>
> Thanks for spending your time on these tests, and fixing CXF 2401. I was
> also able to add few more tests, including the one which writes/reads a
> complex Map to/from JSON.
>
> AegisJSONProvider tries its best for users to avoid setting up a namespace
> map manually, but in cases when it does not guess properly the users would
> be able to overwrite namespaces and their prefixes as needed. This isssue
> would likely arise on the read side only, when CXF reads it. JSON is
> namespace-unaware so when reading, one needs to setup a namespace map for
> Jettison to report values like @ns1.bar to the JAXB reader... (but only if
> AegisJSONProvider has not guessed how to map prefixes to namespaces)
>
> There's a couple of issues I'd like to discuss. First one is that
> AegisJsonProviderTest.testReadWriteComplexMap does have to setup a
> namespace
> for a map root element, but it does not have to do it for
> testWrite/ReadCollection tests. I'm wondering, can it be avoided in cases
> when Maps are being written/read ? That is, can we modify
> createReader/Writer methods such that QNames for containers like
> Map/Collections and its member types are available ?
>
> Another one is that DataBindingJSONProvider test (aegis tests) still can
> not
> handle collections. I think the problem there is that when
> DataBindingProvider (the one DataBindingJSONProvider extends) is being
> initialized, it uses a workaround which we discussed in the other thread.
> Namely, it attempts to convert a JAXRS model info into WSDL-like one and
> set
> calls DataBinding.initialize(Service). It's quite limiting for a number of
> reasons, and one of them is that the generic types are not visible to data
> bindings
> So we introduced PropertiesAwareDataBinding interface and I've just updated
> the JAXRS code to call it like this :
>
> Map, Type> allClasses = getAllJAXRSResponseInputTypes();
> Map props = new HashMap();
> props.put(PropertiesAwareDataBinding.TYPES_PROPERTY, allClasses);
> ((PropertiesAwareDataBinding)db).initialize(props);
>
> At the moment no CXF DataBindings implement this newly introduced
> interface.
> I think the only way for  DataBindingJSONProvider aegis tests which handle
> collections to start passing is for Aegis DataBinding to implement
> PropertiesAwareDataBinding and initialize itself using the provided
> Map, Type>, as opposed to Service. Would you be open to updating
> the Aegis databinding ?
>
> thanks, Sergey
>
>
>
>
>
>
>
>
>
>
>
> bimargulies wrote:
> >
> > I have a rather clear memory of working on these, there wasn't enough
> > passing of Generic classes around. I'll go have a look.
> >
> >
> > On Fri, Aug 21, 2009 at 6:38 AM, Sergey
> > Beryozkin wrote:
> >>
> >> Hi Benson
> >>
> >> if you could look at any of these tests or at least point me in the
> right
> >> direction then it would be great.
> >> I know you're busy - so just look at it whenever you get a chance, not
> >> urgent...
> >>
> >> cheers, Sergey
> >>
> >>
> >> Sergey Beryozkin-2 wrote:
> >>>
> >>>
> >>>
> >>> Hi Benson
> >>>
> >>> I can't make the Aegis tests writing/reading collections working in CXF
> >>> JAX-RS.
> >>> I've found that AegisProviderTest#testReadWriteComplexMap is still
> >>> @Ignored, it might've passed for you because it was @Ignored :-)
> >>>
> >>> I've also added testWriteCollections() (which writes
> >>> List)
> >>> to AegisJSONProviderTest. I also updated DataBindingJSONProviderTest,
> >>> one
> >>> of its internal classes to return List. AegisJSONProvider extends
> >>> AegisElementProvider, DataBindingJSONProvider extends
> >>> DataBindingProvider
> >>> which actually (in this case) delegates to Aegis DataBinding.
> >>>
> >>> AegisJSONProviderTest fails at the write time, it can't find the
> mapping
> >>> for List. DataBindingJSONProviderTest fails early at the Aegis
> >>> DataBinding
> >>> initialization time for the same reason. I thought Lists were supported
> >>> by
> >>> default ? I haven't found any exam[le showing how a type mapping for
> >>> Lists
> >>> can be created.
> >>> Can you please, whenever you have a chance, have a look at these tests
> ?
> >>>
> >>> thanks, Sergey
> >>>
> >>>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Handling-collections-with-Aegis-in-JAX-RS-tp24933144p25076146.html
> >> Sent from the cxf-dev mailing list archive at Nabble.com.

RE: Handling collections with Aegis in JAX-RS

2009-08-31 Thread Sergey Beryozkin
Hi Benson

I'll update the javaDocs, now it is the Map, Type> that will be
passed. For example, 

List updateList(@PathParam("someParam") FooBean param,  List
bars);

In this method a Foo type won't be of interest to Aegis but only
List and List.

So the map containing :

1. updateListMethod.getReturnType() :
updateListMethod.getGenericReturnType()
2. updateListMethod.getParameterTypes()[1] :
updateListMethod.getGenericParameterTypes()[1] 
 
Will be passed to the databinding

So it will provide all the required information. Do you think it will
work for Aegis ? I think it should...


> Aegis has a perfectly
good API for passing in a set of root classes. Why is it better to pass
that
collection through this property map instead of calling setRootClasses?

JAXRS DataBindingProvider is not coded against specific DataBinding
implementations, it is only aware of DataBinding interface, so it should
work with JAXB/Aegis/SDO and XMLBeans. The idea behind introducing this
provider is to let users to use databinding beans as JAXRS provider
instances... 

Cheers, Sergey

-Original Message-
From: Benson Margulies [mailto:bimargul...@gmail.com] 
Sent: 31 August 2009 12:59
To: dev@cxf.apache.org
Subject: Re: Handling collections with Aegis in JAX-RS

The more I look at this, the less I understand it. Aegis has a perfectly
good API for passing in a set of root classes. Why is it better to pass
that
collection through this property map instead of calling setRootClasses?
So
that you can get to the other data bindings the same way? It still won't
work for generics.

The problem is this. Aegis has a pre-generic concept of root classes,
because they are *classes*, not reflection types. Classes don't carry
generic information. While Aegis has a default mappings, it won't use it
for
root types. Root types have to be in the root classes or derived from
the
service model. My memory isn't good enough to recall how JAXB deals.
When a
bean has a generic type as a property, the code is using reflection, so
it
can do generic type processing.

So, to get what you want, we'd need to rework your interface to use
java.lang.reflect.Type. I'm willing to look into the Aegis-specific
angle
here for now and see how to add generic roots. I think the new interface
needs more thinks.

On Mon, Aug 24, 2009 at 8:58 AM, Sergey
Beryozkin
wrote:
>
> Hi Benson
>
> Thanks for spending your time on these tests, and fixing CXF 2401. I
was
> also able to add few more tests, including the one which writes/reads
a
> complex Map to/from JSON.
>
> AegisJSONProvider tries its best for users to avoid setting up a
namespace
> map manually, but in cases when it does not guess properly the users
would
> be able to overwrite namespaces and their prefixes as needed. This
isssue
> would likely arise on the read side only, when CXF reads it. JSON is
> namespace-unaware so when reading, one needs to setup a namespace map
for
> Jettison to report values like @ns1.bar to the JAXB reader... (but
only if
> AegisJSONProvider has not guessed how to map prefixes to namespaces)
>
> There's a couple of issues I'd like to discuss. First one is that
> AegisJsonProviderTest.testReadWriteComplexMap does have to setup a
namespace
> for a map root element, but it does not have to do it for
> testWrite/ReadCollection tests. I'm wondering, can it be avoided in
cases
> when Maps are being written/read ? That is, can we modify
> createReader/Writer methods such that QNames for containers like
> Map/Collections and its member types are available ?
>
> Another one is that DataBindingJSONProvider test (aegis tests) still
can
not
> handle collections. I think the problem there is that when
> DataBindingProvider (the one DataBindingJSONProvider extends) is being
> initialized, it uses a workaround which we discussed in the other
thread.
> Namely, it attempts to convert a JAXRS model info into WSDL-like one
and
set
> calls DataBinding.initialize(Service). It's quite limiting for a
number of
> reasons, and one of them is that the generic types are not visible to
data
> bindings
> So we introduced PropertiesAwareDataBinding interface and I've just
updated
> the JAXRS code to call it like this :
>
> Map, Type> allClasses = getAllJAXRSResponseInputTypes();
> Map props = new HashMap();
> props.put(PropertiesAwareDataBinding.TYPES_PROPERTY, allClasses);
> ((PropertiesAwareDataBinding)db).initialize(props);
>
> At the moment no CXF DataBindings implement this newly introduced
interface.
> I think the only way for  DataBindingJSONProvider aegis tests which
handle
> collections to start passing is for Aegis DataBinding to implement
> PropertiesAwareDataBinding and initialize itself using the provided
> Map, Type>, as opposed to Service. Would you be open to
updating
&g

Re: Handling collections with Aegis in JAX-RS

2009-08-31 Thread Benson Margulies
The more I look at this, the less I understand it. Aegis has a perfectly
good API for passing in a set of root classes. Why is it better to pass that
collection through this property map instead of calling setRootClasses? So
that you can get to the other data bindings the same way? It still won't
work for generics.

The problem is this. Aegis has a pre-generic concept of root classes,
because they are *classes*, not reflection types. Classes don't carry
generic information. While Aegis has a default mappings, it won't use it for
root types. Root types have to be in the root classes or derived from the
service model. My memory isn't good enough to recall how JAXB deals. When a
bean has a generic type as a property, the code is using reflection, so it
can do generic type processing.

So, to get what you want, we'd need to rework your interface to use
java.lang.reflect.Type. I'm willing to look into the Aegis-specific angle
here for now and see how to add generic roots. I think the new interface
needs more thinks.

On Mon, Aug 24, 2009 at 8:58 AM, Sergey Beryozkin
wrote:
>
> Hi Benson
>
> Thanks for spending your time on these tests, and fixing CXF 2401. I was
> also able to add few more tests, including the one which writes/reads a
> complex Map to/from JSON.
>
> AegisJSONProvider tries its best for users to avoid setting up a namespace
> map manually, but in cases when it does not guess properly the users would
> be able to overwrite namespaces and their prefixes as needed. This isssue
> would likely arise on the read side only, when CXF reads it. JSON is
> namespace-unaware so when reading, one needs to setup a namespace map for
> Jettison to report values like @ns1.bar to the JAXB reader... (but only if
> AegisJSONProvider has not guessed how to map prefixes to namespaces)
>
> There's a couple of issues I'd like to discuss. First one is that
> AegisJsonProviderTest.testReadWriteComplexMap does have to setup a
namespace
> for a map root element, but it does not have to do it for
> testWrite/ReadCollection tests. I'm wondering, can it be avoided in cases
> when Maps are being written/read ? That is, can we modify
> createReader/Writer methods such that QNames for containers like
> Map/Collections and its member types are available ?
>
> Another one is that DataBindingJSONProvider test (aegis tests) still can
not
> handle collections. I think the problem there is that when
> DataBindingProvider (the one DataBindingJSONProvider extends) is being
> initialized, it uses a workaround which we discussed in the other thread.
> Namely, it attempts to convert a JAXRS model info into WSDL-like one and
set
> calls DataBinding.initialize(Service). It's quite limiting for a number of
> reasons, and one of them is that the generic types are not visible to data
> bindings
> So we introduced PropertiesAwareDataBinding interface and I've just
updated
> the JAXRS code to call it like this :
>
> Map, Type> allClasses = getAllJAXRSResponseInputTypes();
> Map props = new HashMap();
> props.put(PropertiesAwareDataBinding.TYPES_PROPERTY, allClasses);
> ((PropertiesAwareDataBinding)db).initialize(props);
>
> At the moment no CXF DataBindings implement this newly introduced
interface.
> I think the only way for  DataBindingJSONProvider aegis tests which handle
> collections to start passing is for Aegis DataBinding to implement
> PropertiesAwareDataBinding and initialize itself using the provided
> Map, Type>, as opposed to Service. Would you be open to updating
> the Aegis databinding ?
>
> thanks, Sergey
>
>
>
>
>
>
>
>
>
>
>
> bimargulies wrote:
>>
>> I have a rather clear memory of working on these, there wasn't enough
>> passing of Generic classes around. I'll go have a look.
>>
>>
>> On Fri, Aug 21, 2009 at 6:38 AM, Sergey
>> Beryozkin wrote:
>>>
>>> Hi Benson
>>>
>>> if you could look at any of these tests or at least point me in the
right
>>> direction then it would be great.
>>> I know you're busy - so just look at it whenever you get a chance, not
>>> urgent...
>>>
>>> cheers, Sergey
>>>
>>>
>>> Sergey Beryozkin-2 wrote:



 Hi Benson

 I can't make the Aegis tests writing/reading collections working in CXF
 JAX-RS.
 I've found that AegisProviderTest#testReadWriteComplexMap is still
 @Ignored, it might've passed for you because it was @Ignored :-)

 I've also added testWriteCollections() (which writes
 List)
 to AegisJSONProviderTest. I also updated DataBindingJSONProviderTest,
 one
 of its internal classes to return List. AegisJSONProvider extends
 AegisElementProvider, DataBindingJSONProvider extends
 DataBindingProvider
 which actually (in this case) delegates to Aegis DataBinding.

 AegisJSONProviderTest fails at the write time, it can't find the
mapping
 for List. DataBindingJSONProviderTest fails early at the Aegis
 DataBinding
 initialization time for the same reason. I thought Lists were supported
 by
 default ?

Re: Handling collections with Aegis in JAX-RS

2009-08-31 Thread Benson Margulies
Sergey,

If you want to me to tackle PADB  for Aegis, you have a writing
assignment.  Please write up a comprehensive explanation in the
javadoc. Just calling it an 'alternative' does not give an implementor
much to go with.

I think the top-level issue with namespaces is going to boil down to
the existence, or nonexistence, of 'parts', but I'll report back
presently.

--benson

On Mon, Aug 24, 2009 at 8:58 AM, Sergey
Beryozkin wrote:
>
> Hi Benson
>
> Thanks for spending your time on these tests, and fixing CXF 2401. I was
> also able to add few more tests, including the one which writes/reads a
> complex Map to/from JSON.
>
> AegisJSONProvider tries its best for users to avoid setting up a namespace
> map manually, but in cases when it does not guess properly the users would
> be able to overwrite namespaces and their prefixes as needed. This isssue
> would likely arise on the read side only, when CXF reads it. JSON is
> namespace-unaware so when reading, one needs to setup a namespace map for
> Jettison to report values like @ns1.bar to the JAXB reader... (but only if
> AegisJSONProvider has not guessed how to map prefixes to namespaces)
>
> There's a couple of issues I'd like to discuss. First one is that
> AegisJsonProviderTest.testReadWriteComplexMap does have to setup a namespace
> for a map root element, but it does not have to do it for
> testWrite/ReadCollection tests. I'm wondering, can it be avoided in cases
> when Maps are being written/read ? That is, can we modify
> createReader/Writer methods such that QNames for containers like
> Map/Collections and its member types are available ?
>
> Another one is that DataBindingJSONProvider test (aegis tests) still can not
> handle collections. I think the problem there is that when
> DataBindingProvider (the one DataBindingJSONProvider extends) is being
> initialized, it uses a workaround which we discussed in the other thread.
> Namely, it attempts to convert a JAXRS model info into WSDL-like one and set
> calls DataBinding.initialize(Service). It's quite limiting for a number of
> reasons, and one of them is that the generic types are not visible to data
> bindings
> So we introduced PropertiesAwareDataBinding interface and I've just updated
> the JAXRS code to call it like this :
>
> Map, Type> allClasses = getAllJAXRSResponseInputTypes();
> Map props = new HashMap();
> props.put(PropertiesAwareDataBinding.TYPES_PROPERTY, allClasses);
> ((PropertiesAwareDataBinding)db).initialize(props);
>
> At the moment no CXF DataBindings implement this newly introduced interface.
> I think the only way for  DataBindingJSONProvider aegis tests which handle
> collections to start passing is for Aegis DataBinding to implement
> PropertiesAwareDataBinding and initialize itself using the provided
> Map, Type>, as opposed to Service. Would you be open to updating
> the Aegis databinding ?
>
> thanks, Sergey
>
>
>
>
>
>
>
>
>
>
>
> bimargulies wrote:
>>
>> I have a rather clear memory of working on these, there wasn't enough
>> passing of Generic classes around. I'll go have a look.
>>
>>
>> On Fri, Aug 21, 2009 at 6:38 AM, Sergey
>> Beryozkin wrote:
>>>
>>> Hi Benson
>>>
>>> if you could look at any of these tests or at least point me in the right
>>> direction then it would be great.
>>> I know you're busy - so just look at it whenever you get a chance, not
>>> urgent...
>>>
>>> cheers, Sergey
>>>
>>>
>>> Sergey Beryozkin-2 wrote:



 Hi Benson

 I can't make the Aegis tests writing/reading collections working in CXF
 JAX-RS.
 I've found that AegisProviderTest#testReadWriteComplexMap is still
 @Ignored, it might've passed for you because it was @Ignored :-)

 I've also added testWriteCollections() (which writes
 List)
 to AegisJSONProviderTest. I also updated DataBindingJSONProviderTest,
 one
 of its internal classes to return List. AegisJSONProvider extends
 AegisElementProvider, DataBindingJSONProvider extends
 DataBindingProvider
 which actually (in this case) delegates to Aegis DataBinding.

 AegisJSONProviderTest fails at the write time, it can't find the mapping
 for List. DataBindingJSONProviderTest fails early at the Aegis
 DataBinding
 initialization time for the same reason. I thought Lists were supported
 by
 default ? I haven't found any exam[le showing how a type mapping for
 Lists
 can be created.
 Can you please, whenever you have a chance, have a look at these tests ?

 thanks, Sergey


>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Handling-collections-with-Aegis-in-JAX-RS-tp24933144p25076146.html
>>> Sent from the cxf-dev mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Handling-collections-with-Aegis-in-JAX-RS-tp24933144p25115676.html
> Sent from the cxf-dev mailing list archive at Nabble.com.
>
>


Re: Handling collections with Aegis in JAX-RS

2009-08-24 Thread Sergey Beryozkin

Hi Benson

Thanks for spending your time on these tests, and fixing CXF 2401. I was
also able to add few more tests, including the one which writes/reads a
complex Map to/from JSON.

AegisJSONProvider tries its best for users to avoid setting up a namespace
map manually, but in cases when it does not guess properly the users would
be able to overwrite namespaces and their prefixes as needed. This isssue
would likely arise on the read side only, when CXF reads it. JSON is
namespace-unaware so when reading, one needs to setup a namespace map for
Jettison to report values like @ns1.bar to the JAXB reader... (but only if
AegisJSONProvider has not guessed how to map prefixes to namespaces)

There's a couple of issues I'd like to discuss. First one is that
AegisJsonProviderTest.testReadWriteComplexMap does have to setup a namespace
for a map root element, but it does not have to do it for
testWrite/ReadCollection tests. I'm wondering, can it be avoided in cases
when Maps are being written/read ? That is, can we modify
createReader/Writer methods such that QNames for containers like
Map/Collections and its member types are available ?

Another one is that DataBindingJSONProvider test (aegis tests) still can not
handle collections. I think the problem there is that when
DataBindingProvider (the one DataBindingJSONProvider extends) is being
initialized, it uses a workaround which we discussed in the other thread.
Namely, it attempts to convert a JAXRS model info into WSDL-like one and set
calls DataBinding.initialize(Service). It's quite limiting for a number of
reasons, and one of them is that the generic types are not visible to data
bindings
So we introduced PropertiesAwareDataBinding interface and I've just updated
the JAXRS code to call it like this :

Map, Type> allClasses = getAllJAXRSResponseInputTypes();
Map props = new HashMap();
props.put(PropertiesAwareDataBinding.TYPES_PROPERTY, allClasses);
((PropertiesAwareDataBinding)db).initialize(props);

At the moment no CXF DataBindings implement this newly introduced interface.
I think the only way for  DataBindingJSONProvider aegis tests which handle
collections to start passing is for Aegis DataBinding to implement
PropertiesAwareDataBinding and initialize itself using the provided
Map, Type>, as opposed to Service. Would you be open to updating
the Aegis databinding ?

thanks, Sergey











bimargulies wrote:
> 
> I have a rather clear memory of working on these, there wasn't enough
> passing of Generic classes around. I'll go have a look.
> 
> 
> On Fri, Aug 21, 2009 at 6:38 AM, Sergey
> Beryozkin wrote:
>>
>> Hi Benson
>>
>> if you could look at any of these tests or at least point me in the right
>> direction then it would be great.
>> I know you're busy - so just look at it whenever you get a chance, not
>> urgent...
>>
>> cheers, Sergey
>>
>>
>> Sergey Beryozkin-2 wrote:
>>>
>>>
>>>
>>> Hi Benson
>>>
>>> I can't make the Aegis tests writing/reading collections working in CXF
>>> JAX-RS.
>>> I've found that AegisProviderTest#testReadWriteComplexMap is still
>>> @Ignored, it might've passed for you because it was @Ignored :-)
>>>
>>> I've also added testWriteCollections() (which writes
>>> List)
>>> to AegisJSONProviderTest. I also updated DataBindingJSONProviderTest,
>>> one
>>> of its internal classes to return List. AegisJSONProvider extends
>>> AegisElementProvider, DataBindingJSONProvider extends
>>> DataBindingProvider
>>> which actually (in this case) delegates to Aegis DataBinding.
>>>
>>> AegisJSONProviderTest fails at the write time, it can't find the mapping
>>> for List. DataBindingJSONProviderTest fails early at the Aegis
>>> DataBinding
>>> initialization time for the same reason. I thought Lists were supported
>>> by
>>> default ? I haven't found any exam[le showing how a type mapping for
>>> Lists
>>> can be created.
>>> Can you please, whenever you have a chance, have a look at these tests ?
>>>
>>> thanks, Sergey
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Handling-collections-with-Aegis-in-JAX-RS-tp24933144p25076146.html
>> Sent from the cxf-dev mailing list archive at Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Handling-collections-with-Aegis-in-JAX-RS-tp24933144p25115676.html
Sent from the cxf-dev mailing list archive at Nabble.com.



Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Benson Margulies
Right, a location I know well.

On Fri, Aug 21, 2009 at 4:02 PM, D G wrote:
> Ha - I am in Waltham on the line of Lexington and Waltham close to IBM. How
> funny is that man.
>
>
>
> On Aug 21, 2009, at 2:36 PM, Benson Margulies  wrote:
>
>> Lexington, MA, outside of Boston.
>>
>> On Fri, Aug 21, 2009 at 2:26 PM, D G wrote:
>>>
>>> You are a funny man Benson - do you mind if I ask where you are located?
>>>
>>>
>>>
>>> On Aug 21, 2009, at 2:14 PM, Benson Margulies 
>>> wrote:
>>>
>>>> I are at whole foods with iPhone - will engage when I get home.
>>>>
>>>> On Aug 21, 2009, at 1:28 PM, "Sergey Beryozkin" 
>>>> wrote:
>>>>
>>>>> This one
>>>>>
>>>>> testWriteTo(org.apache.cxf.jaxrs.provider.AegisProviderTest)
>>>>>
>>>>> also fails
>>>>>
>>>>> Hudson provides some strange info
>>>>> http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/
>>>>>
>>>>> shows that Benson's changes has made it into the build but
>>>>>
>>>>>
>>>>>
>>>>> http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/org.apache.cxf$cxf-rt-frontend-jaxrs/
>>>>>
>>>>> shows that no changes has been applied
>>>>>
>>>>> Sergey
>>>>>
>>>>>
>>>>>
>>>>> - Original Message - From: "Daniel Kulp" 
>>>>> To: 
>>>>> Cc: "Benson Margulies" 
>>>>> Sent: Friday, August 21, 2009 6:22 PM
>>>>> Subject: Re: Handling collections with Aegis in JAX-RS
>>>>>
>>>>>
>>>>>> On Fri August 21 2009 12:52:32 pm Benson Margulies wrote:
>>>>>>>
>>>>>>> It appears to be you. I ran mvn in rt/databinding/aegis again, and
>>>>>>> still no hate mail from hudson as well.
>>>>>>
>>>>>> No.  He's refering to the
>>>>>> org.apache.cxf.jaxrs.provider.AegisJSONProviderTest
>>>>>> in the jaxrs frontend.
>>>>>> Dan
>>>>>>>
>>>>>>> On Fri, Aug 21, 2009 at 12:39 PM, Sergey
>>>>>>> Beryozkin
>>>>>>
>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi Benson
>>>>>>>>
>>>>>>>> I'm seeing all the Aegis write tests failing at the momentOr is
>>>>>>>> it
>>>>>>>> only me ?
>>>>>>>>
>>>>>>>> cheers, Sergey
>>>>>>>>
>>>>>>>> - Original Message - From: "Benson Margulies"
>>>>>>>> 
>>>>>>>> To: 
>>>>>>>> Sent: Friday, August 21, 2009 5:00 PM
>>>>>>>> Subject: Re: Handling collections with Aegis in JAX-RS
>>>>>>>>
>>>>>>>>> All fixed now.
>>>>>>>>>
>>>>>>>>> I finally remembered the history of this. When you first inveigled
>>>>>>>>> me
>>>>>>>>> into working up the Aegis provider, I got as far as this test, and
>>>>>>>>> sent you email saying, 'OK, you fix the test, and I'll work out the
>>>>>>>>> rest of the kinks.' And then if you even fixed up the test I missed
>>>>>>>>> the email, so I never went back to it.
>>>>>>
>>>>>> --
>>>>>> Daniel Kulp
>>>>>> dk...@apache.org
>>>>>> http://www.dankulp.com/blog
>>>
>


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread D G
Ha - I am in Waltham on the line of Lexington and Waltham close to  
IBM. How funny is that man.




On Aug 21, 2009, at 2:36 PM, Benson Margulies   
wrote:



Lexington, MA, outside of Boston.

On Fri, Aug 21, 2009 at 2:26 PM, D G wrote:
You are a funny man Benson - do you mind if I ask where you are  
located?




On Aug 21, 2009, at 2:14 PM, Benson Margulies  
 wrote:



I are at whole foods with iPhone - will engage when I get home.

On Aug 21, 2009, at 1:28 PM, "Sergey Beryozkin" >

wrote:


This one

testWriteTo(org.apache.cxf.jaxrs.provider.AegisProviderTest)

also fails

Hudson provides some strange info
http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/

shows that Benson's changes has made it into the build but


http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/org.apache.cxf$cxf-rt-frontend-jaxrs/

shows that no changes has been applied

Sergey



- Original Message - From: "Daniel Kulp" 
To: 
Cc: "Benson Margulies" 
Sent: Friday, August 21, 2009 6:22 PM
Subject: Re: Handling collections with Aegis in JAX-RS



On Fri August 21 2009 12:52:32 pm Benson Margulies wrote:


It appears to be you. I ran mvn in rt/databinding/aegis again,  
and

still no hate mail from hudson as well.


No.  He's refering to the
org.apache.cxf.jaxrs.provider.AegisJSONProviderTest
in the jaxrs frontend.
Dan


On Fri, Aug 21, 2009 at 12:39 PM, Sergey
Beryozkin


wrote:



Hi Benson

I'm seeing all the Aegis write tests failing at the  
momentOr is

it
only me ?

cheers, Sergey

- Original Message - From: "Benson Margulies"

To: 
Sent: Friday, August 21, 2009 5:00 PM
Subject: Re: Handling collections with Aegis in JAX-RS


All fixed now.

I finally remembered the history of this. When you first  
inveigled

me
into working up the Aegis provider, I got as far as this  
test, and
sent you email saying, 'OK, you fix the test, and I'll work  
out the
rest of the kinks.' And then if you even fixed up the test I  
missed

the email, so I never went back to it.


--
Daniel Kulp
dk...@apache.org
http://www.dankulp.com/blog




Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Benson Margulies
We've got canned XML being checked, I'll have to recan some of it.

On Fri, Aug 21, 2009 at 1:28 PM, Sergey Beryozkin wrote:
> This one
>
> testWriteTo(org.apache.cxf.jaxrs.provider.AegisProviderTest)
>
> also fails
>
> Hudson provides some strange info
> http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/
>
> shows that Benson's changes has made it into the build but
>
> http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/org.apache.cxf$cxf-rt-frontend-jaxrs/
>
> shows that no changes has been applied
>
> Sergey
>
>
>
> - Original Message - From: "Daniel Kulp" 
> To: 
> Cc: "Benson Margulies" 
> Sent: Friday, August 21, 2009 6:22 PM
> Subject: Re: Handling collections with Aegis in JAX-RS
>
>
>> On Fri August 21 2009 12:52:32 pm Benson Margulies wrote:
>>>
>>> It appears to be you. I ran mvn in rt/databinding/aegis again, and
>>> still no hate mail from hudson as well.
>>
>> No.  He's refering to the
>> org.apache.cxf.jaxrs.provider.AegisJSONProviderTest
>> in the jaxrs frontend.
>>
>> Dan
>>
>>
>>> On Fri, Aug 21, 2009 at 12:39 PM, Sergey Beryozkin
>>
>> wrote:
>>>
>>> > Hi Benson
>>> >
>>> > I'm seeing all the Aegis write tests failing at the momentOr is it
>>> > only me ?
>>> >
>>> > cheers, Sergey
>>> >
>>> > - Original Message - From: "Benson Margulies"
>>> > 
>>> > To: 
>>> > Sent: Friday, August 21, 2009 5:00 PM
>>> > Subject: Re: Handling collections with Aegis in JAX-RS
>>> >
>>> >> All fixed now.
>>> >>
>>> >> I finally remembered the history of this. When you first inveigled me
>>> >> into working up the Aegis provider, I got as far as this test, and
>>> >> sent you email saying, 'OK, you fix the test, and I'll work out the
>>> >> rest of the kinks.' And then if you even fixed up the test I missed
>>> >> the email, so I never went back to it.
>>
>> --
>> Daniel Kulp
>> dk...@apache.org
>> http://www.dankulp.com/blog
>


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Benson Margulies
Lexington, MA, outside of Boston.

On Fri, Aug 21, 2009 at 2:26 PM, D G wrote:
> You are a funny man Benson - do you mind if I ask where you are located?
>
>
>
> On Aug 21, 2009, at 2:14 PM, Benson Margulies  wrote:
>
>> I are at whole foods with iPhone - will engage when I get home.
>>
>> On Aug 21, 2009, at 1:28 PM, "Sergey Beryozkin" 
>> wrote:
>>
>>> This one
>>>
>>> testWriteTo(org.apache.cxf.jaxrs.provider.AegisProviderTest)
>>>
>>> also fails
>>>
>>> Hudson provides some strange info
>>> http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/
>>>
>>> shows that Benson's changes has made it into the build but
>>>
>>>
>>> http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/org.apache.cxf$cxf-rt-frontend-jaxrs/
>>>
>>> shows that no changes has been applied
>>>
>>> Sergey
>>>
>>>
>>>
>>> - Original Message - From: "Daniel Kulp" 
>>> To: 
>>> Cc: "Benson Margulies" 
>>> Sent: Friday, August 21, 2009 6:22 PM
>>> Subject: Re: Handling collections with Aegis in JAX-RS
>>>
>>>
>>>> On Fri August 21 2009 12:52:32 pm Benson Margulies wrote:
>>>>>
>>>>> It appears to be you. I ran mvn in rt/databinding/aegis again, and
>>>>> still no hate mail from hudson as well.
>>>>
>>>> No.  He's refering to the
>>>> org.apache.cxf.jaxrs.provider.AegisJSONProviderTest
>>>> in the jaxrs frontend.
>>>> Dan
>>>>>
>>>>> On Fri, Aug 21, 2009 at 12:39 PM, Sergey
>>>>> Beryozkin
>>>>
>>>> wrote:
>>>>>
>>>>> > Hi Benson
>>>>> >
>>>>> > I'm seeing all the Aegis write tests failing at the momentOr is
>>>>> > it
>>>>> > only me ?
>>>>> >
>>>>> > cheers, Sergey
>>>>> >
>>>>> > - Original Message - From: "Benson Margulies"
>>>>> > 
>>>>> > To: 
>>>>> > Sent: Friday, August 21, 2009 5:00 PM
>>>>> > Subject: Re: Handling collections with Aegis in JAX-RS
>>>>> >
>>>>> >> All fixed now.
>>>>> >>
>>>>> >> I finally remembered the history of this. When you first inveigled
>>>>> >> me
>>>>> >> into working up the Aegis provider, I got as far as this test, and
>>>>> >> sent you email saying, 'OK, you fix the test, and I'll work out the
>>>>> >> rest of the kinks.' And then if you even fixed up the test I missed
>>>>> >> the email, so I never went back to it.
>>>>
>>>> --
>>>> Daniel Kulp
>>>> dk...@apache.org
>>>> http://www.dankulp.com/blog
>


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread D G

You are a funny man Benson - do you mind if I ask where you are located?



On Aug 21, 2009, at 2:14 PM, Benson Margulies   
wrote:



I are at whole foods with iPhone - will engage when I get home.

On Aug 21, 2009, at 1:28 PM, "Sergey Beryozkin"  
 wrote:



This one

testWriteTo(org.apache.cxf.jaxrs.provider.AegisProviderTest)

also fails

Hudson provides some strange info
http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/

shows that Benson's changes has made it into the build but

http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/org.apache.cxf$cxf-rt-frontend-jaxrs/

shows that no changes has been applied

Sergey



- Original Message - From: "Daniel Kulp" 
To: 
Cc: "Benson Margulies" 
Sent: Friday, August 21, 2009 6:22 PM
Subject: Re: Handling collections with Aegis in JAX-RS



On Fri August 21 2009 12:52:32 pm Benson Margulies wrote:

It appears to be you. I ran mvn in rt/databinding/aegis again, and
still no hate mail from hudson as well.
No.  He's refering to the  
org.apache.cxf.jaxrs.provider.AegisJSONProviderTest

in the jaxrs frontend.
Dan
On Fri, Aug 21, 2009 at 12:39 PM, Sergey Beryozkin>

wrote:

> Hi Benson
>
> I'm seeing all the Aegis write tests failing at the  
momentOr is it

> only me ?
>
> cheers, Sergey
>
> - Original Message - From: "Benson Margulies"
> 
> To: 
> Sent: Friday, August 21, 2009 5:00 PM
> Subject: Re: Handling collections with Aegis in JAX-RS
>
>> All fixed now.
>>
>> I finally remembered the history of this. When you first  
inveigled me
>> into working up the Aegis provider, I got as far as this test,  
and
>> sent you email saying, 'OK, you fix the test, and I'll work  
out the
>> rest of the kinks.' And then if you even fixed up the test I  
missed

>> the email, so I never went back to it.

--
Daniel Kulp
dk...@apache.org
http://www.dankulp.com/blog


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Benson Margulies

I are at whole foods with iPhone - will engage when I get home.

On Aug 21, 2009, at 1:28 PM, "Sergey Beryozkin"  
 wrote:



This one

testWriteTo(org.apache.cxf.jaxrs.provider.AegisProviderTest)

also fails

Hudson provides some strange info
http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk- 
JDK15/676/


shows that Benson's changes has made it into the build but

http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/org.apache.cxf$cxf-rt-frontend-jaxrs/

shows that no changes has been applied

Sergey



- Original Message - From: "Daniel Kulp" 
To: 
Cc: "Benson Margulies" 
Sent: Friday, August 21, 2009 6:22 PM
Subject: Re: Handling collections with Aegis in JAX-RS



On Fri August 21 2009 12:52:32 pm Benson Margulies wrote:

It appears to be you. I ran mvn in rt/databinding/aegis again, and
still no hate mail from hudson as well.
No.  He's refering to the  
org.apache.cxf.jaxrs.provider.AegisJSONProviderTest

in the jaxrs frontend.
Dan
On Fri, Aug 21, 2009 at 12:39 PM, Sergey Beryozkin>

wrote:

> Hi Benson
>
> I'm seeing all the Aegis write tests failing at the momentOr  
is it

> only me ?
>
> cheers, Sergey
>
> - Original Message - From: "Benson Margulies"
> 
> To: 
> Sent: Friday, August 21, 2009 5:00 PM
> Subject: Re: Handling collections with Aegis in JAX-RS
>
>> All fixed now.
>>
>> I finally remembered the history of this. When you first  
inveigled me
>> into working up the Aegis provider, I got as far as this test,  
and
>> sent you email saying, 'OK, you fix the test, and I'll work out  
the
>> rest of the kinks.' And then if you even fixed up the test I  
missed

>> the email, so I never went back to it.

--
Daniel Kulp
dk...@apache.org
http://www.dankulp.com/blog


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Sergey Beryozkin

This one

testWriteTo(org.apache.cxf.jaxrs.provider.AegisProviderTest)

also fails

Hudson provides some strange info
http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/

shows that Benson's changes has made it into the build but

http://hudson.zones.apache.org/hudson/view/CXF/job/CXF-Trunk-JDK15/676/org.apache.cxf$cxf-rt-frontend-jaxrs/

shows that no changes has been applied

Sergey



- Original Message - 
From: "Daniel Kulp" 

To: 
Cc: "Benson Margulies" 
Sent: Friday, August 21, 2009 6:22 PM
Subject: Re: Handling collections with Aegis in JAX-RS



On Fri August 21 2009 12:52:32 pm Benson Margulies wrote:

It appears to be you. I ran mvn in rt/databinding/aegis again, and
still no hate mail from hudson as well.


No.  He's refering to the 
org.apache.cxf.jaxrs.provider.AegisJSONProviderTest

in the jaxrs frontend.

Dan


On Fri, Aug 21, 2009 at 12:39 PM, Sergey Beryozkin 

wrote:

> Hi Benson
>
> I'm seeing all the Aegis write tests failing at the momentOr is it
> only me ?
>
> cheers, Sergey
>
> - Original Message - From: "Benson Margulies"
> 
> To: 
> Sent: Friday, August 21, 2009 5:00 PM
> Subject: Re: Handling collections with Aegis in JAX-RS
>
>> All fixed now.
>>
>> I finally remembered the history of this. When you first inveigled me
>> into working up the Aegis provider, I got as far as this test, and
>> sent you email saying, 'OK, you fix the test, and I'll work out the
>> rest of the kinks.' And then if you even fixed up the test I missed
>> the email, so I never went back to it.


--
Daniel Kulp
dk...@apache.org
http://www.dankulp.com/blog


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Sergey Beryozkin

I'm confused... Hudson has apparently run the build with your changes - I'll do 
the clean build

cheers, Sergey

- Original Message - 
From: "Sergey Beryozkin" 

To: 
Sent: Friday, August 21, 2009 6:19 PM
Subject: Re: Handling collections with Aegis in JAX-RS



Hmm...

Still seeing them - Hudson has not run the build yet with the latest changes
I've done 'mvn clean install' on rt/databinding/aegis and rt/frontend/jaxrs...

By the way, I mean Aegis JAXRS tests

cheers, Sergey

- Original Message - 
From: "Benson Margulies" 

To: 
Sent: Friday, August 21, 2009 5:52 PM
Subject: Re: Handling collections with Aegis in JAX-RS



It appears to be you. I ran mvn in rt/databinding/aegis again, and
still no hate mail from hudson as well.

On Fri, Aug 21, 2009 at 12:39 PM, Sergey Beryozkin wrote:

Hi Benson

I'm seeing all the Aegis write tests failing at the momentOr is it only
me ?

cheers, Sergey

- Original Message - From: "Benson Margulies"

To: 
Sent: Friday, August 21, 2009 5:00 PM
Subject: Re: Handling collections with Aegis in JAX-RS



All fixed now.

I finally remembered the history of this. When you first inveigled me
into working up the Aegis provider, I got as far as this test, and
sent you email saying, 'OK, you fix the test, and I'll work out the
rest of the kinks.' And then if you even fixed up the test I missed
the email, so I never went back to it.




Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Daniel Kulp
On Fri August 21 2009 12:52:32 pm Benson Margulies wrote:
> It appears to be you. I ran mvn in rt/databinding/aegis again, and
> still no hate mail from hudson as well.

No.  He's refering to the 
org.apache.cxf.jaxrs.provider.AegisJSONProviderTest
in the jaxrs frontend.

Dan


> On Fri, Aug 21, 2009 at 12:39 PM, Sergey Beryozkin 
wrote:
> > Hi Benson
> >
> > I'm seeing all the Aegis write tests failing at the momentOr is it
> > only me ?
> >
> > cheers, Sergey
> >
> > - Original Message - From: "Benson Margulies"
> > 
> > To: 
> > Sent: Friday, August 21, 2009 5:00 PM
> > Subject: Re: Handling collections with Aegis in JAX-RS
> >
> >> All fixed now.
> >>
> >> I finally remembered the history of this. When you first inveigled me
> >> into working up the Aegis provider, I got as far as this test, and
> >> sent you email saying, 'OK, you fix the test, and I'll work out the
> >> rest of the kinks.' And then if you even fixed up the test I missed
> >> the email, so I never went back to it.

-- 
Daniel Kulp
dk...@apache.org
http://www.dankulp.com/blog


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Sergey Beryozkin

Hmm...

Still seeing them - Hudson has not run the build yet with the latest changes
I've done 'mvn clean install' on rt/databinding/aegis and rt/frontend/jaxrs...

By the way, I mean Aegis JAXRS tests

cheers, Sergey

- Original Message - 
From: "Benson Margulies" 

To: 
Sent: Friday, August 21, 2009 5:52 PM
Subject: Re: Handling collections with Aegis in JAX-RS



It appears to be you. I ran mvn in rt/databinding/aegis again, and
still no hate mail from hudson as well.

On Fri, Aug 21, 2009 at 12:39 PM, Sergey Beryozkin wrote:

Hi Benson

I'm seeing all the Aegis write tests failing at the momentOr is it only
me ?

cheers, Sergey

- Original Message - From: "Benson Margulies"

To: 
Sent: Friday, August 21, 2009 5:00 PM
Subject: Re: Handling collections with Aegis in JAX-RS



All fixed now.

I finally remembered the history of this. When you first inveigled me
into working up the Aegis provider, I got as far as this test, and
sent you email saying, 'OK, you fix the test, and I'll work out the
rest of the kinks.' And then if you even fixed up the test I missed
the email, so I never went back to it.




Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Benson Margulies
It appears to be you. I ran mvn in rt/databinding/aegis again, and
still no hate mail from hudson as well.

On Fri, Aug 21, 2009 at 12:39 PM, Sergey Beryozkin wrote:
> Hi Benson
>
> I'm seeing all the Aegis write tests failing at the momentOr is it only
> me ?
>
> cheers, Sergey
>
> - Original Message - From: "Benson Margulies"
> 
> To: 
> Sent: Friday, August 21, 2009 5:00 PM
> Subject: Re: Handling collections with Aegis in JAX-RS
>
>
>> All fixed now.
>>
>> I finally remembered the history of this. When you first inveigled me
>> into working up the Aegis provider, I got as far as this test, and
>> sent you email saying, 'OK, you fix the test, and I'll work out the
>> rest of the kinks.' And then if you even fixed up the test I missed
>> the email, so I never went back to it.
>


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Benson Margulies
Let me look again. I did run them, and the hudson build is not complaining.


On Fri, Aug 21, 2009 at 12:39 PM, Sergey Beryozkin wrote:
> Hi Benson
>
> I'm seeing all the Aegis write tests failing at the momentOr is it only
> me ?
>
> cheers, Sergey
>
> - Original Message - From: "Benson Margulies"
> 
> To: 
> Sent: Friday, August 21, 2009 5:00 PM
> Subject: Re: Handling collections with Aegis in JAX-RS
>
>
>> All fixed now.
>>
>> I finally remembered the history of this. When you first inveigled me
>> into working up the Aegis provider, I got as far as this test, and
>> sent you email saying, 'OK, you fix the test, and I'll work out the
>> rest of the kinks.' And then if you even fixed up the test I missed
>> the email, so I never went back to it.
>


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Sergey Beryozkin

Hi Benson

I'm seeing all the Aegis write tests failing at the momentOr is it only me ?

cheers, Sergey

- Original Message - 
From: "Benson Margulies" 

To: 
Sent: Friday, August 21, 2009 5:00 PM
Subject: Re: Handling collections with Aegis in JAX-RS



All fixed now.

I finally remembered the history of this. When you first inveigled me
into working up the Aegis provider, I got as far as this test, and
sent you email saying, 'OK, you fix the test, and I'll work out the
rest of the kinks.' And then if you even fixed up the test I missed
the email, so I never went back to it.


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Benson Margulies
All fixed now.

I finally remembered the history of this. When you first inveigled me
into working up the Aegis provider, I got as far as this test, and
sent you email saying, 'OK, you fix the test, and I'll work out the
rest of the kinks.' And then if you even fixed up the test I missed
the email, so I never went back to it.


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Benson Margulies
Well,

That depends on your definition of 'the problem'.

I have coded the code to write the map, I think, but the baroque
JAX-RS business with passing generic types around is not my
speciality.

Indeed, that moves the problem to an issue of Aegis not understanding
the desired type mapping.

I'm looking at it.

--benson


On Fri, Aug 21, 2009 at 8:46 AM, Sergey Beryozkin wrote:
> Hi Benson
>
> As far as I remember writing a map (that is fixing the code) won't make a
> difference, I tried it when I spotted this test was still ignored...
>
>
> cheers, Sergey
>
> - Original Message - From: "Benson Margulies"
> 
> To: 
> Sent: Friday, August 21, 2009 1:34 PM
> Subject: Re: Handling collections with Aegis in JAX-RS
>
>
>> Sergey,
>>
>> You have to be kidding me. The test (testReadWriteComplexMap) writes a
>> plain bean and then expects to read a map. Of course if fails!
>>
>> --benson
>>
>>
>> On Fri, Aug 21, 2009 at 6:38 AM, Sergey
>> Beryozkin wrote:
>>>
>>> Hi Benson
>>>
>>> if you could look at any of these tests or at least point me in the right
>>> direction then it would be great.
>>> I know you're busy - so just look at it whenever you get a chance, not
>>> urgent...
>>>
>>> cheers, Sergey
>>>
>>>
>>> Sergey Beryozkin-2 wrote:
>>>>
>>>>
>>>>
>>>> Hi Benson
>>>>
>>>> I can't make the Aegis tests writing/reading collections working in CXF
>>>> JAX-RS.
>>>> I've found that AegisProviderTest#testReadWriteComplexMap is still
>>>> @Ignored, it might've passed for you because it was @Ignored :-)
>>>>
>>>> I've also added testWriteCollections() (which writes
>>>> List)
>>>> to AegisJSONProviderTest. I also updated DataBindingJSONProviderTest,
>>>> one
>>>> of its internal classes to return List. AegisJSONProvider extends
>>>> AegisElementProvider, DataBindingJSONProvider extends
>>>> DataBindingProvider
>>>> which actually (in this case) delegates to Aegis DataBinding.
>>>>
>>>> AegisJSONProviderTest fails at the write time, it can't find the mapping
>>>> for List. DataBindingJSONProviderTest fails early at the Aegis
>>>> DataBinding
>>>> initialization time for the same reason. I thought Lists were supported
>>>> by
>>>> default ? I haven't found any exam[le showing how a type mapping for
>>>> Lists
>>>> can be created.
>>>> Can you please, whenever you have a chance, have a look at these tests ?
>>>>
>>>> thanks, Sergey
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Handling-collections-with-Aegis-in-JAX-RS-tp24933144p25076146.html
>>> Sent from the cxf-dev mailing list archive at Nabble.com.
>>>
>>>
>
>


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Sergey Beryozkin

Hi Benson

As far as I remember writing a map (that is fixing the code) won't make a difference, I tried it when I spotted this test was still 
ignored...



cheers, Sergey

- Original Message - 
From: "Benson Margulies" 

To: 
Sent: Friday, August 21, 2009 1:34 PM
Subject: Re: Handling collections with Aegis in JAX-RS



Sergey,

You have to be kidding me. The test (testReadWriteComplexMap) writes a
plain bean and then expects to read a map. Of course if fails!

--benson


On Fri, Aug 21, 2009 at 6:38 AM, Sergey
Beryozkin wrote:


Hi Benson

if you could look at any of these tests or at least point me in the right
direction then it would be great.
I know you're busy - so just look at it whenever you get a chance, not
urgent...

cheers, Sergey


Sergey Beryozkin-2 wrote:




Hi Benson

I can't make the Aegis tests writing/reading collections working in CXF
JAX-RS.
I've found that AegisProviderTest#testReadWriteComplexMap is still
@Ignored, it might've passed for you because it was @Ignored :-)

I've also added testWriteCollections() (which writes List)
to AegisJSONProviderTest. I also updated DataBindingJSONProviderTest, one
of its internal classes to return List. AegisJSONProvider extends
AegisElementProvider, DataBindingJSONProvider extends DataBindingProvider
which actually (in this case) delegates to Aegis DataBinding.

AegisJSONProviderTest fails at the write time, it can't find the mapping
for List. DataBindingJSONProviderTest fails early at the Aegis DataBinding
initialization time for the same reason. I thought Lists were supported by
default ? I haven't found any exam[le showing how a type mapping for Lists
can be created.
Can you please, whenever you have a chance, have a look at these tests ?

thanks, Sergey




--
View this message in context: 
http://www.nabble.com/Handling-collections-with-Aegis-in-JAX-RS-tp24933144p25076146.html
Sent from the cxf-dev mailing list archive at Nabble.com.






Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Benson Margulies
Sergey,

You have to be kidding me. The test (testReadWriteComplexMap) writes a
plain bean and then expects to read a map. Of course if fails!

--benson


On Fri, Aug 21, 2009 at 6:38 AM, Sergey
Beryozkin wrote:
>
> Hi Benson
>
> if you could look at any of these tests or at least point me in the right
> direction then it would be great.
> I know you're busy - so just look at it whenever you get a chance, not
> urgent...
>
> cheers, Sergey
>
>
> Sergey Beryozkin-2 wrote:
>>
>>
>>
>> Hi Benson
>>
>> I can't make the Aegis tests writing/reading collections working in CXF
>> JAX-RS.
>> I've found that AegisProviderTest#testReadWriteComplexMap is still
>> @Ignored, it might've passed for you because it was @Ignored :-)
>>
>> I've also added testWriteCollections() (which writes List)
>> to AegisJSONProviderTest. I also updated DataBindingJSONProviderTest, one
>> of its internal classes to return List. AegisJSONProvider extends
>> AegisElementProvider, DataBindingJSONProvider extends DataBindingProvider
>> which actually (in this case) delegates to Aegis DataBinding.
>>
>> AegisJSONProviderTest fails at the write time, it can't find the mapping
>> for List. DataBindingJSONProviderTest fails early at the Aegis DataBinding
>> initialization time for the same reason. I thought Lists were supported by
>> default ? I haven't found any exam[le showing how a type mapping for Lists
>> can be created.
>> Can you please, whenever you have a chance, have a look at these tests ?
>>
>> thanks, Sergey
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Handling-collections-with-Aegis-in-JAX-RS-tp24933144p25076146.html
> Sent from the cxf-dev mailing list archive at Nabble.com.
>
>


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Benson Margulies
I have a rather clear memory of working on these, there wasn't enough
passing of Generic classes around. I'll go have a look.


On Fri, Aug 21, 2009 at 6:38 AM, Sergey
Beryozkin wrote:
>
> Hi Benson
>
> if you could look at any of these tests or at least point me in the right
> direction then it would be great.
> I know you're busy - so just look at it whenever you get a chance, not
> urgent...
>
> cheers, Sergey
>
>
> Sergey Beryozkin-2 wrote:
>>
>>
>>
>> Hi Benson
>>
>> I can't make the Aegis tests writing/reading collections working in CXF
>> JAX-RS.
>> I've found that AegisProviderTest#testReadWriteComplexMap is still
>> @Ignored, it might've passed for you because it was @Ignored :-)
>>
>> I've also added testWriteCollections() (which writes List)
>> to AegisJSONProviderTest. I also updated DataBindingJSONProviderTest, one
>> of its internal classes to return List. AegisJSONProvider extends
>> AegisElementProvider, DataBindingJSONProvider extends DataBindingProvider
>> which actually (in this case) delegates to Aegis DataBinding.
>>
>> AegisJSONProviderTest fails at the write time, it can't find the mapping
>> for List. DataBindingJSONProviderTest fails early at the Aegis DataBinding
>> initialization time for the same reason. I thought Lists were supported by
>> default ? I haven't found any exam[le showing how a type mapping for Lists
>> can be created.
>> Can you please, whenever you have a chance, have a look at these tests ?
>>
>> thanks, Sergey
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Handling-collections-with-Aegis-in-JAX-RS-tp24933144p25076146.html
> Sent from the cxf-dev mailing list archive at Nabble.com.
>
>


Re: Handling collections with Aegis in JAX-RS

2009-08-21 Thread Sergey Beryozkin

Hi Benson

if you could look at any of these tests or at least point me in the right
direction then it would be great.
I know you're busy - so just look at it whenever you get a chance, not
urgent...

cheers, Sergey


Sergey Beryozkin-2 wrote:
> 
> 
> 
> Hi Benson
> 
> I can't make the Aegis tests writing/reading collections working in CXF
> JAX-RS.
> I've found that AegisProviderTest#testReadWriteComplexMap is still
> @Ignored, it might've passed for you because it was @Ignored :-)
> 
> I've also added testWriteCollections() (which writes List)
> to AegisJSONProviderTest. I also updated DataBindingJSONProviderTest, one
> of its internal classes to return List. AegisJSONProvider extends
> AegisElementProvider, DataBindingJSONProvider extends DataBindingProvider
> which actually (in this case) delegates to Aegis DataBinding.
> 
> AegisJSONProviderTest fails at the write time, it can't find the mapping
> for List. DataBindingJSONProviderTest fails early at the Aegis DataBinding
> initialization time for the same reason. I thought Lists were supported by
> default ? I haven't found any exam[le showing how a type mapping for Lists
> can be created. 
> Can you please, whenever you have a chance, have a look at these tests ?
> 
> thanks, Sergey
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Handling-collections-with-Aegis-in-JAX-RS-tp24933144p25076146.html
Sent from the cxf-dev mailing list archive at Nabble.com.