A more complete overview of working examples with the changes as outlined in the previous email to make the feeds validate & display properly in atom consumers, using my self (user id = 1) on the http://www.partuza.nl/ demo site as an example:

App data for my horoscope gadget:
http://modules.partuza.nl/social/rest/appdata/1/@self/82?format=atom

My friends's app data for the same gadget:
http://modules.partuza.nl/social/rest/appdata/1/@friends/82?format=atom

My activities:
http://modules.partuza.nl/social/rest/activities/1/@friends?format=atom

My friends:
http://modules.partuza.nl/social/rest/people/1/@friends?format=atom

Me as 'collection':
http://modules.partuza.nl/social/rest/people/1/@me?format=atom

Me as single entry:
http://modules.partuza.nl/social/rest/people/1/@self?format=atom

All comments & feedback welcome!

        -- Chris

On Jul 13, 2008, at 2:58 PM, Chris Chabot wrote:

Question about the osearch fields:

When i include the <feed xmlns="http://www.w3.org/2005/Atom"; xmlos:osearch="http://a9.com/-/spec/opensearch/1.1";> tag the feed validator complains about that line with : "XML parsing error: <unknown>:2:0: unbound prefix"

If i'd omit that tag it complains about the osearch: fields them selves with much the same: "XML parsing error: <unknown>:12:2: unbound prefix"

Currently it seems the only way to produce an 'Atom 1.0 valid feed', is by removing the opensearch xmlos tag, and removing the osearch:... entries.

I didn't study the why's and what's very much on this topic, but i have to admit i do like having a pretty button ( http://validator.w3.org/feed/images/valid-atom.png ) and have the feed display properly as a feed in firefox :)

To become 'valid' i had to add an author name field, currently i'm using '<server name>:<id>' as the name .. it's descriptive enough i guess. And as titles (which are also not allowed to be empty) i construct titles like "person feed entry for id modules.partuza.nl: 1"... not very pretty but enough to give developers a hint what feed / entry their looking at when debugging i guess.

With the osearch fields + tag removed & the author name added i get a feed that both firefox and the atom feed validator understand:

http://modules.partuza.nl/social/rest/people/1/@friends?format=atom

        -- Chris


On Jul 13, 2008, at 8:24 AM, John Panzer wrote:


John Panzer (http://abstractioneer.org)

On Sat, Jul 12, 2008 at 4:21 PM, Chris Chabot <[EMAIL PROTECTED]> wrote:
ps that namespace is defined as being : http://ns.opensocial.org/2008/opensocial
Which doesn't really exist ..

Namespace URIs don't need to resolve to anything (they just need to be unique). It's better if they resolve to a document explaining what it is in case you peek at it of course!


likewise it refers to http://a9.com/-/spec/opensearch/1.1 .. which returns a 302 moved temporary to a http://localhost:8080/ <someuri>... Probably not what it's supposed to be ? :)




        -- Chris

On Jul 13, 2008, at 1:11 AM, John Panzer wrote:


John Panzer (http://abstractioneer.org)

On Sat, Jul 12, 2008 at 3:40 PM, Chris Chabot <[EMAIL PROTECTED]> wrote:

And another question that arrised while implementing the atom entry /
feed bit.

In the examples the entry always includes the namespace:
    <appdata xmlns="http://opensocial.org/2008/opensocial";>
        <pokes>3</poke>
        <last_poke>2008-02-13T18:30:02Z</last_poke>
      </appdata>

However in the feed output it doesn't:
      <appdata>
        <pokes>3</poke>
        <last_poke>"2008-02-13T18:30:02Z"</last_poke>
      </appdata>

Is that intentional?
No, this looks like another typo :)


On Jul 13, 2008, at 12:37 AM, Chris Chabot wrote:

>
> Oh while being pedantic, i ran into a few small typo's in the
> document:
>
> "<author><url>uurn:guid:example.org:58UIDCSIOP233FDKK3HD44</url></
> author>"
> should be: s/uurn/urn
>
> application/json representation (with indexBy=id):
> .. json example ...
> application/atom+xml representation:
> .. would expect an example here of how indexBy work work in the atom > representation, but to my eyes it seems to be just a regular entry and
> no indexBy's applied to it?
>
>
> "The default representation of a collection is simply a JSON list of > records ([ {...}, {....}, ...]). The special type "index" means that > the collection is instead to be represented as a mapping, using the
> index field; this is requested by supplying a query parameter
> "indexBy" (see below). "
>
> Actually in the document its ABOVE and not below :)
>
> ps is the uurn:guid:<Real ID> required? from an app development
> perspective just the raw ID value would seem easier to me.. but i'm no
> atom expert yet so i might be missing something obvious.
>
>       -- Chris
>
>
> On Jul 13, 2008, at 12:02 AM, David Primmer wrote:
>
>>
>> You're right Chris, the spec has 'hosting' rules that do not cover
>> the
>> required fields in author:
>> atom:entry/atom:author/atom:uri aliases "userId"
>>
>> author is a person construct
>> http://atompub.org/rfc4287.html#atomPersonConstruct
>> and requires name, as you mention. the spec only includes uri
>>
>> I posted what I thought was a more complete example of an activity
>> here:
>> 
http://groups.google.com/group/opensocial-and-gadgets-spec/browse_thread/thread/9f7cbb93d187763e/63ca4da4cedeea7f
>>
>> I didn't run it through validation, but I did just now and found some
>> of the issues you mention in your feeds and more.
>>
>> You have your content tags flipped around. content should be a child >> of entry and it's required, unless you have an alternate link (that's
>> the third error you got)
>>
>> this is a spec example:
>>
>> <entry xmlns="http://www.w3.org/2005/Atom";>
>> <content type="application/xml">
>>   <person xmlns="http://ns.opensocial.org/2008/opensocial";>
>>     <name>
>>       <unstructured>Jane Doe</unstructured>
>>     </name>
>> ..etc...
>>
>>
>>
>> On Sat, Jul 12, 2008 at 2:27 PM, Chris Chabot <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> To validate what i've got so far in the atom/rest implementation in >>> the php version of shindig I've been running the output through http://validator.w3.org/feed/
>>>
>>> Everything checks out except for 3 things:
>>>   * line 20, column 4: Undefined author element: url [help]
>>>             <url>urn:guid::1</url>
>>>   * line 21, column 2: Missing author element: name [help]
>>>           </author>
>>>   *line 24, column 0: Missing content or alternate link [help]
>>>         </entry>
>>>
>>> In other words it doesn't dig the URL in the author, but would
>>> rather
>>> see a NAME there; Plus it's complaining that there's no 'alternate'
>>> link.
>>>
>>> Is this a case of ignore and move on, or something we could / should
>>> improve upon?
>>>
>>>      -- Chris
>>>
>>> ps, the output i was validating is:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <entry xmlns="http://www.w3.org/2005/Atom";>
>>> <person xmlns="http://ns.opensocial.org/2008/opensocial";>
>>>   <content type="application/xml">
>>>     <isOwner></isOwner>
>>>     <isViewer></isViewer>
>>>     <name>
>>>       <familyName>Chabot</familyName>
>>>       <givenName>Chris</givenName>
>>>       <unstructured>Chris Chabot</unstructured>
>>>     </name>
>>>     <id>1</id>
>>> <thumbnailUrl>http://www.partuza.nl/images/people/1.96x96.jpg </
>>> thumbnailUrl>
>>>   </content>
>>> </person>
>>> <title>fetch people[1]</title>
>>> <author>
>>>   <url>urn:guid::1</url>
>>> </author>
>>> <updated>2008-07-12T23:19:38+02:00</updated>
>>> <id>urn:guid::1</id>
>>> </entry>
>>>
>>>
>>>>
>>>
>>
>>
>
>















--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "OpenSocial and Gadgets Specification Discussion" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en
-~----------~----~----~----~------~----~------~--~---


Reply via email to