abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vijayakumar, Manju" <Manju.Vijayaku...@gs.com>
Subject How to add Extension elements to feed?
Date Fri, 20 Jun 2008 14:29:03 GMT

Hi,

I have a requirement to add custom elements in an entry, so I am trying
to implement that using the abdera ExtensionFactory.

I want an element <mynamespace:priority> to be added to my feed. This is
the code I have written.
...
String namespace = "http://somesite.com/ns/1.0";
QName priorityExtension = new QName(namespace,PRIORITY,"mynamespace");
// StringElement extends ElementWrapper, implements Element
StringElement priorityElem = new
StringElement(entry.addExtension(priorityExtension));
priorityElem.setValue(HIGH);
...
// entry should now have
<mynamespace:priority>HIGH</mynamespace:priority> element
//adding the entry to the feed
Feed.addEntry(entry) 

..

// Post the entry to a URI using abdera client
ClientResponse res = client.post(colUri.toString(), entry, opts);
// Asserting if the return status is HTTP 201
Assert.assertEquals(201, res.getStatus());

..

When I debug, I can see that entry contains the extension element, but
after the feed is posted at a URL,
I cannot see the extension elements (through View->Source in IE)

Is there any kind of registering these extension elements on the server
side?
Or is the browser ignoring the extension elements?
Please let me know what I am missing.

Thanks,
Manju	





Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message