Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-782

Create and read Atom extension element

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None
    • None

      We are looking for a way to create and read Atom Extension element (http://tools.ietf.org/html/rfc4287#section-6.4). For example, below is how we add a custom extension to Atom using Abdera:

      Abdera abdera = new Abdera();
      Entry entry = abdera.newEntry();
      entry.setTitle("testCreatePackageFromAtom1");
      entry.setSummary("desc for testCreatePackageFromAtom");
      ExtensibleElement extension = entry.addExtension(new QName("",
      "metadata"));
      ExtensibleElement childExtension = extension.addExtension(new
      QName("", "categories"));
      childExtension.addSimpleExtension(new QName("", "value")),
      "AssetPackageResourceTestCategory");

      Basically we are looking for sth similar in RESTEasy. Unfortunately methods likes getAnyOther, getAnyOtherJaxbObject etc were added into RESTEasy after 2.3.4.Final, and they are not working. getAnyOtherJAXBObject returns null. I also verified the object returned by getAnyOther, yes, it is not null, but it is a ElementNSImpl object. I dont think you should expect RESTEasy users to retrieve a raw xml object using getAnyOther then marshall the raw xml to object using JAXB by themselves. This does not sound like a correct way to read Atom extension.

      I hope we can have explicit methods to read and create extension element on Entry, Feed and any other elements that are valid to have extension element per spec : http://tools.ietf.org/html/rfc4287#section-6.4. Eg, sth like Entry.addExentionElement(Object o) and Entry.getExtensionElemnt(), this API will be easier to understand than getAnyOther or getAnyOtherJaxbObject.

      Thanks.

            weli@redhat.com Weinan Li
            jervisliu Jervis Liu (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: