abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Woody Anderson" <wo...@xoopit.com>
Subject Re: exception handling post response
Date Thu, 25 Oct 2007 23:50:18 GMT
sweet.

btw, has anyone (in the public space) written something that'll take a
username and a blog url
and attempt to find the introspection url / or baring that the listed
service.post entries etc. for the prevailing blog systems?

this isn't exactly app, it's more like getting the initial information
set before using app.

i'm basically attempting to do this now, and if there is a framework
for it i'd love to use/contrib etc.
the main issue i'm having is that most systems (with pleasant
exception of wordpress) don't advertise consumable introspection
documents.
and the location of the introspection document is completely varied.

some systems embed this in the www.blog-url.com/ page, others typepad
put a url there, that you must access with x-wsse auth to get a
non-introspection document that kinda indicates where to go if you
look at it just right.

anyway,  once i've found the post url or the introspection url, abdera
seems to be working quite nicely for me.
but the bulk of my work actually comes in trying to attempt to give
abdera the correct starting place, as most systems do not have a
predictable location for any of the introspection or service.post type
urls.

am i reinventing things or is this just as messed up as it seems?
-w


On 10/25/07, James M Snell <jasnell@gmail.com> wrote:
> You could create an ExtensionFactory that could handle this
> transparently.  I'll see if I can work up an example a bit later today.
>
> - James
>
> Woody Anderson wrote:
> > hmm.. ok thanks.
> >
> > is there anyway overcome that? can i provide a map this broken ns to
> > the correct one?
> > with the parser? or by doing a "trivial" subclass of the parser that
> > would be used to deal with the response.
> >
> > i doubt they fix this "soon", so just wondering what i can do to get
> > the url response.
> >
> > Also, is there a standard for the "public url" of what you just posted via APP?
> >
> > i sorta asked this earlier, and you indicated ContentSrc(), which sounded good.
> > Unfortunately, this response doesn't that info there.
> >
> > also the Location header uses the protected edit link etc.
> >
> > so the url i'm looking for in this response is:
> >   <link xmlns="http://purl.org/atom/ns#" rel="alternate"
> > href="http://example.typepad.com/eg/2007/10/example-title.html"
> > title="HTML" type="text/html"/>
> >
> > so, in general is there a standard for this info?
> > typepad seems rather busted (as per wrong ns to begin with), but i
> > don't have the experience to know if there is some standard location
> > (where it's *supposed* to be) that i'm unaware of, or if this kind of
> > information is particular to each and every server impl, and each is
> > considered compliant (aside from the ns issue).
> >
> > thanks
> > -w
> >
> >
> > On 10/25/07, James M Snell <jasnell@gmail.com> wrote:
> >> The response from typepad is invalid.  The namespace is wrong; it is
> >> supposed to be http://www.w3.org/2005/Atom
> >>
> >>> <entry xmlns="http://purl.org/atom/ns#"
> >> - James
> >>
> >> Woody Anderson wrote:
> >>> Hello, so i'm currently posting directly to a typepad.com url (can't
> >>> seem to get introspection working with typepad, which is a separate
> >>> issue)
> >>>
> >>> so i create a post:
> >>>
> >>>        response = client.post(.....);
> >>>        org.apache.abdera.model.Document<Entry> doc = response.getDocument();
> >>>        Entry entry = doc.getRoot();
> >>>
> >>> so i get this exception:
> >>> java.lang.ClassCastException: org.apache.abdera.parser.stax.FOMExtensibleElement
> >>> at the "entry = getRoot()" line
> >>>
> >>> which is pretty odd i think.
> >>>
> >>> i get back a 201 "created" response: Headers follow:
> >>> HTTP/1.1 201 Created
> >>> Date: Thu, 25 Oct 2007 19:28:18 GMT
> >>> Server: Apache
> >>> Location: http://www.typepad.com/t/atom/weblog/blog_id=123456789/entry_id=40686808
> >>> Expires: Mon, 26 Jul 1997 05:00:00 GMT
> >>> Last-Modified: Thu, 25 Oct 2007 19:28:20 GMT
> >>> Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
> >>> Content-Type: application/atom+xml
> >>> Via: 1.1 www.typepad.com (Apache/2.2.3)
> >>> Vary: Accept-Encoding,User-Agent
> >>> Content-Encoding: gzip
> >>> Content-Length: 501
> >>> Connection: close
> >>>
> >>>
> >>> here's the wireshark'd response payload:
> >>>
> >>> <?xml version="1.0" encoding="utf-8"?>
> >>> <entry xmlns="http://purl.org/atom/ns#"
> >>> xmlns:default="http://www.w3.org/1999/xhtml"
> >>> xmlns:post="http://sixapart.com/atom/post#">
> >>>   <title xmlns="http://purl.org/atom/ns#">Example Title</title>
> >>>   <summary xmlns="http://purl.org/atom/ns#"></summary>
> >>>   <content xmlns="http://purl.org/atom/ns#"
> >>> xmlns:default="http://www.w3.org/1999/xhtml" mode="xml">
> >>>     <div xmlns="http://www.w3.org/1999/xhtml"><p>Example Text</p>null</div>
> >>>   </content>
> >>>   <issued xmlns="http://purl.org/atom/ns#">2007-10-25T12:20:05-07:00</issued>
> >>>   <link xmlns="http://purl.org/atom/ns#" rel="alternate"
> >>> href="http://example.typepad.com/eg/2007/10/example-title.html"
> >>> title="HTML" type="text/html"/>
> >>>   <id xmlns="http://purl.org/atom/ns#">tag:typepad.com,2003:post-40686452</id>
> >>>   <post:convertLineBreaks
> >>> xmlns:post="http://sixapart.com/atom/post#">true</post:convertLineBreaks>
> >>>   <author xmlns="http://purl.org/atom/ns#">
> >>>     <name xmlns="http://purl.org/atom/ns#">joey joe joe</name>
> >>>   </author>
> >>>   <link xmlns="http://purl.org/atom/ns#" rel="service.edit"
> >>> href="http://www.typepad.com/t/atom/weblog/blog_id=123456789/entry_id=40686452"
> >>> title="Example Title" type="application/atom+xml"/>
> >>> </entry>
> >>>
> >>>
> >>> which seems quite parseable and looks to be an Entry to me.
> >>> any thoughts?
> >>>
> >>> oh, and i'm using release .6
> >>> -w
> >>>
> >
>

Mime
View raw message