users@jersey.java.net

[Jersey] Re: Looking for JAXB to ATOM feed adapter example

From: Gerard Davison <Gerard.Davison_at_oracle.com>
Date: Fri, 16 Sep 2011 15:16:15 +0100

You can always just apply a XSL to the JAX-B object to transform it into the feed format, I did this a while back, to transform Atom into RSS, see the last code sample:

http://kingsfleet.blogspot.com/2008/12/bugfeed-with-jersey-aka-my-first-jax-rs.html

I have since found out that you can skip a few steps and use a JAXBSource as the input to the transformer which makes the code a little bit tidier. I wonder if there is a better way to do the final output without creating a DOM model in memory.

To be honest I looked at using a Atom framework at the time; but it was just as easy to generate the JAX-B nodes from the Atom XML Schema and work from there,

Hope this is of some help,

Gerard



On 15 Sep 2011, at 22:20, Farrukh Najmi wrote:

> Hi Guys,
>
> I have a server engine that is built using JAXB generated binding objects and is accessed via SOAP and REST interfaces. The REST interface is implemented using Jersey. The format of the response may currently be the XML marshaled from the response JAXB binding object.
>
> I am working on adding support for ATOM feed format (application/atom+xml) next. This will require writing some sort of adapter that will marshal my response JAXB binding object to an ATOM feed format XML.
>
> What is the suggested way to do this?
>
> I am currently looking at rome rather than Abdera for generating the ATOM feed as it has incubator support for PubSubHubPub. Thanks for sharing any insights and experience.
> --
> Regards,
> Farrukh Najmi
>
> Web: http://www.wellfleetsoftware.com
>

-- 
Gerard Davison | Senior Principal Software Engineer | +44 118 924 5095
Oracle JDeveloper Web Service Tooling Development
Oracle Corporation UK Ltd is a company incorporated in England & Wales.
Company Reg. No. 1782505.
Reg. office: Oracle Parkway, Thames Valley Park, Reading RG6 1RA.
Blog http://kingsfleet.blogspot.com