abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Woody Anderson" <wo...@xoopit.com>
Subject which is the "most correct" field for a response entry when AbderaClient.post
Date Wed, 24 Oct 2007 23:42:11 GMT
i've posted an image to a collection on a wordpress blog.

            _options.setContentType( type );
            response = _client.post( getUri( type ), is, _options );

what i need from the response is the remote URI that the blog hosts
the image as (not edit link).

the xml looks like:

<entry xmlns="http://www.w3.org/2005/Atom"
       xmlns:app="http://www.w3.org/2007/app" xml:lang="en">
    <id>CORRECT_REMOTE_URI</id>
    <title type="text">NAME.jpg</title>
    <updated>2007-10-24T22:44:39Z</updated>
    <published>2007-10-24T22:44:39Z</published>
    <app:edited>2007-10-24T22:44:39Z</app:edited>
    <app:control>
        <app:draft>no</app:draft>
    </app:control>
    <author>
        <name>me</name>
        <email>me@me.com</email>
    </author>
    <link rel="edit-media" href="EDIT_URL" />
    <content type="image/jpg" src="CORRECT_REMOTE_URI"/>
    <link rel="edit" href="EDIT_URL" />
    <category scheme="http://me.wordpress.com" term="Uncategorized" />
    <summary type="text">NAME.jpg
</summary>
</entry>


so, there are 2 places that the CORRECT_REMOTE_URI is located in the document.

1st, it's the id of the entry
2nd, it's the src of the content.

so,

Document<Entry> doc = response.getDocument();
Entry entry = eoc.getRoot();

// these are the same
entry.getId();
entry.getContentSrc();


which of these is the more robust / "correct"?
or is there a third option?

thanks
-w

Mime
View raw message