Hi Sergey, going back to your earlier email, specifically the point anbout introspecting a given application type.....yes I think this is what I'd like to do.
At the moment I have a class with methods that return my XMLBean objects. I now have providers for getting XML and JSON from the XMLBean objects so that's great. We have a requirement to also provide an ATOM feed off one of the methods. So this is where I'm thinking about how I can write a provider which takes the same XMLBean object and outputs an ATOM feed. The JSON provider was fairly straight forward as I could use the events from the XML stream parser to drive the JSON output. It was just a case of echoing the document structure through the JSON writer. The problem I'm seeing with the ATOM provider is that I have to somehow output specific ATOM elements for arbitrary domain objects. I'm starting to think there's no way of getting this working without it being a solution specific to the project I'm working on. My only idea so far has been to have it look for known element types such as xlink:href and use them to build the feed structure but it feels a bit hack-like. Well, more hack-like than I've made it so far :-) I'd appreciate any thoughts you may have on the subject. Cheers, Brad. On Fri, May 16, 2008 at 2:05 PM, Sergey Beryozkin <[EMAIL PROTECTED]> wrote: > Hi Brad > > >> Hi Sergey, >> >> just to let you know, my employer has given me permission to submit my >> XMLBean providers to the CXF project. >> >> I've got two classes so far that produce and consume XML and JSON from >> XMLBeans. I'm also going to be developing a provider class next week >> to provide ATOM feeds. >> >> If you still think they'd be of use I'd be happy to submit a patch as >> a starting point for XMLBean support within CXF. > > I think it would be great, as XMLBeans is a technology which can be used by > different applications...Please submit a patch. One thing is that I may not > be able to react quickly and apply it fast as currently I can only afford > spending some limited time only outside of my working hours on maintaining > the CXF JAX-RS framework . I'm slowly moving ahead with a 0.7 api upgrade > work and planning to accumulate those changes with your patches, as well as > with any other patches we may've received during the next couple of weeks... > > About Atom. CXF currently ships some core Apache Abdera classes and a couple > of basic Atom Feed/Entry providers, which makes it trivial to expose > application-specific classes as Feeds or Entries, see for example this blog > entry on how one can combine JAX-RS and Abdera : > > http://weblogs.java.net/blog/mhadley/archive/2008/02/integrating_jer_2.html > > This gives a total control to the developer with respect to how a given Feed > or individual Entry is created. > Now, another option is to basically do this : > > @ProduceMime("application/atom+feed") > Bars getBars() {} > > Have you been thinking about creating a provider which can introspect a > given application type like Bars and properly wrap it into an atom feed or > entry ? > > Thanks, Sergey > > >> >> Brad. >> > > ---------------------------- > IONA Technologies PLC (registered in Ireland) > Registered Number: 171387 > Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland >
