You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Ian Boston <ie...@tfd.co.uk> on 2008/11/03 11:38:54 UTC

What Does AppData look like in XML ?

I am reading the spec at http://www.opensocial.org/Technical- 
Resources/opensocial-spec-v081/restful-protocol
section 2.5
"
application/json representation:
(maps directly to the xml format)
{
   "entry" : {
     "example.org:34KJDCSKJN2HHF0DW20394" : {"pokes" : 3,  
"last_poke" : "2008-02-13T18:30:02Z" },
     "example.org:58UIDCSIOP233FDKK3HD44" : {"pokes" : 2,  
"last_poke" : "2007-12-16T18:30:02Z" }
   }
}

"

What is the xml ? Its not clear to me and I think the XSD is wrong,  
so no help.
is it ?

<entry>
    <key>example.org:34KJDCSKJN2HHF0DW20394</key>
    <value>
         <entry>
               <key>pokes</key>
              <value>3</value>
         </entry>
        <entry>
              <key>last_poke</key>
             <value>2008-02-13T18:30:02Z</value>
        </entry>
   </value>
</entry>
<entry>
    <key>example.org:58UIDCSIOP233FDKK3HD44</key>
    <value>
         <entry>
               <key>pokes</key>
              <value>2</value>
         </entry>
        <entry>
              <key>last_poke</key>
              <value>2007-12-16T18:30:02Z</value>
        </entry>
   </value>
</entry>

Re: What Does AppData look like in XML ?

Posted by Ian Boston <ie...@tfd.co.uk>.
Another question, based on you xml.
in the link below there is a

<response>
     <appdata>
      ^^^^^^^^^^
          <entry>

which does make sense  but doesn't appear to match the multiple  
response in the spec.
<response>
    <startIndex> 1 </startIndex>
    <itemsPerPage> 10 <itemsPerPage>
    <totalResults> 100 <totalResults>
    <entry>...first item...</entry>
    <entry>...second item...</entry>
       ...
</response>

and
Looking at the person response
http://modules.partuza.nl/social/rest/people/1/@friends? 
fields=*&format=xml

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <startIndex>0</startIndex>
   <itemsPerPage>20</itemsPerPage>
   <totalResults>721</totalResults>
   <person>
^^^^^^^^^^
     <isOwner></isOwner>
     <isViewer></isViewer>

     <displayName>Bruno rovagnati</displayName>
     <id>5</id>
     <thumbnailUrl>http://www.partuza.nl/images/people/5.96x96.jpg</ 
thumbnailUrl>
     <profileUrl>http://www.partuza.nl/profile/5</profileUrl>
   </person>


I think the spec is a bit open to interpretation at the moment and  
does need fixing.

Ian

On 3 Nov 2008, at 14:24, Chris Chabot wrote:

> currently a collection looks like this in php-shindig:
>
>
> however having a closer look at it, I do notice that the xml  
> response seems
> to be missing something crucial that the json response does have  
> (spoiler
> alert, it's the: userId's):
> http://modules.partuza.nl/social/rest/appdata/1/@friends/2? 
> fields=*&format=json
>
> So yea, I guess in the end I do have the same question as you, what  
> should
> the response look like in regards to the key'ing of the results :)
>
>    -- Chris
>
> On Mon, Nov 3, 2008 at 2:24 PM, Ian Boston <ie...@tfd.co.uk> wrote:
>
>> Yes that covers the single response, but when you ask for app data  
>> from a
>> set of users, as per the JSon unit tests in RestfulJsonDataTest  
>> they are all
>> keyed by the userId, even for single response. The format appears  
>> to be
>> defined for the single response (as you mention), but not for a  
>> set of
>> responses. Logically mapping from the JSON in the same way  
>> generates the xml
>> in my original message, but I have no idea if that was intended.
>>
>> Presumably the PHP code doesnt deal with collections of app data ?
>>
>> Ian
>>
>>
>> On 3 Nov 2008, at 12:15, Chris Chabot wrote:
>>
>>  i've been going of the rest spec document for the format of the  
>> structure
>>> while implementing this in php-shindig:
>>>
>>> <appdata xmlns="http://ns.opensocial.org/2008/opensocial">
>>>  <entry>
>>>    <key>pokes</key>
>>>    <value>3</value>
>>>  </entry>
>>>  <entry>
>>>    <key>last_poke</key>
>>>    <value>2008-02-13T18:30:02Z</value>
>>>  </entry>
>>> </appdata>
>>>
>>>
>>>
>>> On Mon, Nov 3, 2008 at 11:38 AM, Ian Boston <ie...@tfd.co.uk> wrote:
>>>
>>>  I am reading the spec at http://www.opensocial.org/Technical-
>>>> Resources/opensocial-spec-v081/restful-protocol
>>>> section 2.5
>>>> "
>>>> application/json representation:
>>>> (maps directly to the xml format)
>>>> {
>>>>  "entry" : {
>>>>   "example.org:34KJDCSKJN2HHF0DW20394" : {"pokes" : 3,  
>>>> "last_poke" :
>>>> "2008-02-13T18:30:02Z" },
>>>>   "example.org:58UIDCSIOP233FDKK3HD44" : {"pokes" : 2,  
>>>> "last_poke" :
>>>> "2007-12-16T18:30:02Z" }
>>>>  }
>>>> }
>>>>
>>>> "
>>>>
>>>> What is the xml ? Its not clear to me and I think the XSD is  
>>>> wrong, so no
>>>> help.
>>>> is it ?
>>>>
>>>> <entry>
>>>>  <key>example.org:34KJDCSKJN2HHF0DW20394</key>
>>>>  <value>
>>>>       <entry>
>>>>             <key>pokes</key>
>>>>            <value>3</value>
>>>>       </entry>
>>>>      <entry>
>>>>            <key>last_poke</key>
>>>>           <value>2008-02-13T18:30:02Z</value>
>>>>      </entry>
>>>>  </value>
>>>> </entry>
>>>> <entry>
>>>>  <key>example.org:58UIDCSIOP233FDKK3HD44</key>
>>>>  <value>
>>>>       <entry>
>>>>             <key>pokes</key>
>>>>            <value>2</value>
>>>>       </entry>
>>>>      <entry>
>>>>            <key>last_poke</key>
>>>>            <value>2007-12-16T18:30:02Z</value>
>>>>      </entry>
>>>>  </value>
>>>> </entry>
>>>>
>>>>
>>


Re: What Does AppData look like in XML ?

Posted by Chris Chabot <ch...@google.com>.
nope not at the moment

On Mon, Nov 3, 2008 at 3:33 PM, Ian Boston <ie...@tfd.co.uk> wrote:

> One quick question,
>
> do you use the xsd at all in the php code ?
>
> Ian
>
>
> On 3 Nov 2008, at 14:24, Chris Chabot wrote:
>
>  currently a collection looks like this in php-shindig:
>> http://modules.partuza.nl/social/rest/appdata/1/@friends/2
>> ?fields=*&format=xml
>>
>> however having a closer look at it, I do notice that the xml response
>> seems
>> to be missing something crucial that the json response does have (spoiler
>> alert, it's the: userId's):
>> http://modules.partuza.nl/social/rest/appdata/1/@friends/2
>> ?fields=*&format=json
>>
>> So yea, I guess in the end I do have the same question as you, what should
>> the response look like in regards to the key'ing of the results :)
>>
>>   -- Chris
>>
>> On Mon, Nov 3, 2008 at 2:24 PM, Ian Boston <ie...@tfd.co.uk> wrote:
>>
>>  Yes that covers the single response, but when you ask for app data from a
>>> set of users, as per the JSon unit tests in RestfulJsonDataTest they are
>>> all
>>> keyed by the userId, even for single response. The format appears to be
>>> defined for the single response (as you mention), but not for a set of
>>> responses. Logically mapping from the JSON in the same way generates the
>>> xml
>>> in my original message, but I have no idea if that was intended.
>>>
>>> Presumably the PHP code doesnt deal with collections of app data ?
>>>
>>> Ian
>>>
>>>
>>> On 3 Nov 2008, at 12:15, Chris Chabot wrote:
>>>
>>>  i've been going of the rest spec document for the format of the
>>> structure
>>>
>>>> while implementing this in php-shindig:
>>>>
>>>> <appdata xmlns="http://ns.opensocial.org/2008/opensocial">
>>>>  <entry>
>>>>   <key>pokes</key>
>>>>   <value>3</value>
>>>>  </entry>
>>>>  <entry>
>>>>   <key>last_poke</key>
>>>>   <value>2008-02-13T18:30:02Z</value>
>>>>  </entry>
>>>> </appdata>
>>>>
>>>>
>>>>
>>>> On Mon, Nov 3, 2008 at 11:38 AM, Ian Boston <ie...@tfd.co.uk> wrote:
>>>>
>>>>  I am reading the spec at http://www.opensocial.org/Technical-
>>>>
>>>>> Resources/opensocial-spec-v081/restful-protocol
>>>>> section 2.5
>>>>> "
>>>>> application/json representation:
>>>>> (maps directly to the xml format)
>>>>> {
>>>>>  "entry" : {
>>>>>  "example.org:34KJDCSKJN2HHF0DW20394" : {"pokes" : 3, "last_poke" :
>>>>> "2008-02-13T18:30:02Z" },
>>>>>  "example.org:58UIDCSIOP233FDKK3HD44" : {"pokes" : 2, "last_poke" :
>>>>> "2007-12-16T18:30:02Z" }
>>>>>  }
>>>>> }
>>>>>
>>>>> "
>>>>>
>>>>> What is the xml ? Its not clear to me and I think the XSD is wrong, so
>>>>> no
>>>>> help.
>>>>> is it ?
>>>>>
>>>>> <entry>
>>>>>  <key>example.org:34KJDCSKJN2HHF0DW20394</key>
>>>>>  <value>
>>>>>      <entry>
>>>>>            <key>pokes</key>
>>>>>           <value>3</value>
>>>>>      </entry>
>>>>>     <entry>
>>>>>           <key>last_poke</key>
>>>>>          <value>2008-02-13T18:30:02Z</value>
>>>>>     </entry>
>>>>>  </value>
>>>>> </entry>
>>>>> <entry>
>>>>>  <key>example.org:58UIDCSIOP233FDKK3HD44</key>
>>>>>  <value>
>>>>>      <entry>
>>>>>            <key>pokes</key>
>>>>>           <value>2</value>
>>>>>      </entry>
>>>>>     <entry>
>>>>>           <key>last_poke</key>
>>>>>           <value>2007-12-16T18:30:02Z</value>
>>>>>     </entry>
>>>>>  </value>
>>>>> </entry>
>>>>>
>>>>>
>>>>>
>>>
>

Re: What Does AppData look like in XML ?

Posted by Ian Boston <ie...@tfd.co.uk>.
One quick question,

do you use the xsd at all in the php code ?

Ian

On 3 Nov 2008, at 14:24, Chris Chabot wrote:

> currently a collection looks like this in php-shindig:
> http://modules.partuza.nl/social/rest/appdata/1/@friends/2? 
> fields=*&format=xml
>
> however having a closer look at it, I do notice that the xml  
> response seems
> to be missing something crucial that the json response does have  
> (spoiler
> alert, it's the: userId's):
> http://modules.partuza.nl/social/rest/appdata/1/@friends/2? 
> fields=*&format=json
>
> So yea, I guess in the end I do have the same question as you, what  
> should
> the response look like in regards to the key'ing of the results :)
>
>    -- Chris
>
> On Mon, Nov 3, 2008 at 2:24 PM, Ian Boston <ie...@tfd.co.uk> wrote:
>
>> Yes that covers the single response, but when you ask for app data  
>> from a
>> set of users, as per the JSon unit tests in RestfulJsonDataTest  
>> they are all
>> keyed by the userId, even for single response. The format appears  
>> to be
>> defined for the single response (as you mention), but not for a  
>> set of
>> responses. Logically mapping from the JSON in the same way  
>> generates the xml
>> in my original message, but I have no idea if that was intended.
>>
>> Presumably the PHP code doesnt deal with collections of app data ?
>>
>> Ian
>>
>>
>> On 3 Nov 2008, at 12:15, Chris Chabot wrote:
>>
>>  i've been going of the rest spec document for the format of the  
>> structure
>>> while implementing this in php-shindig:
>>>
>>> <appdata xmlns="http://ns.opensocial.org/2008/opensocial">
>>>  <entry>
>>>    <key>pokes</key>
>>>    <value>3</value>
>>>  </entry>
>>>  <entry>
>>>    <key>last_poke</key>
>>>    <value>2008-02-13T18:30:02Z</value>
>>>  </entry>
>>> </appdata>
>>>
>>>
>>>
>>> On Mon, Nov 3, 2008 at 11:38 AM, Ian Boston <ie...@tfd.co.uk> wrote:
>>>
>>>  I am reading the spec at http://www.opensocial.org/Technical-
>>>> Resources/opensocial-spec-v081/restful-protocol
>>>> section 2.5
>>>> "
>>>> application/json representation:
>>>> (maps directly to the xml format)
>>>> {
>>>>  "entry" : {
>>>>   "example.org:34KJDCSKJN2HHF0DW20394" : {"pokes" : 3,  
>>>> "last_poke" :
>>>> "2008-02-13T18:30:02Z" },
>>>>   "example.org:58UIDCSIOP233FDKK3HD44" : {"pokes" : 2,  
>>>> "last_poke" :
>>>> "2007-12-16T18:30:02Z" }
>>>>  }
>>>> }
>>>>
>>>> "
>>>>
>>>> What is the xml ? Its not clear to me and I think the XSD is  
>>>> wrong, so no
>>>> help.
>>>> is it ?
>>>>
>>>> <entry>
>>>>  <key>example.org:34KJDCSKJN2HHF0DW20394</key>
>>>>  <value>
>>>>       <entry>
>>>>             <key>pokes</key>
>>>>            <value>3</value>
>>>>       </entry>
>>>>      <entry>
>>>>            <key>last_poke</key>
>>>>           <value>2008-02-13T18:30:02Z</value>
>>>>      </entry>
>>>>  </value>
>>>> </entry>
>>>> <entry>
>>>>  <key>example.org:58UIDCSIOP233FDKK3HD44</key>
>>>>  <value>
>>>>       <entry>
>>>>             <key>pokes</key>
>>>>            <value>2</value>
>>>>       </entry>
>>>>      <entry>
>>>>            <key>last_poke</key>
>>>>            <value>2007-12-16T18:30:02Z</value>
>>>>      </entry>
>>>>  </value>
>>>> </entry>
>>>>
>>>>
>>


Re: What Does AppData look like in XML ?

Posted by Chris Chabot <ch...@google.com>.
currently a collection looks like this in php-shindig:
http://modules.partuza.nl/social/rest/appdata/1/@friends/2?fields=*&format=xml

however having a closer look at it, I do notice that the xml response seems
to be missing something crucial that the json response does have (spoiler
alert, it's the: userId's):
http://modules.partuza.nl/social/rest/appdata/1/@friends/2?fields=*&format=json

So yea, I guess in the end I do have the same question as you, what should
the response look like in regards to the key'ing of the results :)

   -- Chris

On Mon, Nov 3, 2008 at 2:24 PM, Ian Boston <ie...@tfd.co.uk> wrote:

> Yes that covers the single response, but when you ask for app data from a
> set of users, as per the JSon unit tests in RestfulJsonDataTest they are all
> keyed by the userId, even for single response. The format appears to be
> defined for the single response (as you mention), but not for a set of
> responses. Logically mapping from the JSON in the same way generates the xml
> in my original message, but I have no idea if that was intended.
>
> Presumably the PHP code doesnt deal with collections of app data ?
>
> Ian
>
>
> On 3 Nov 2008, at 12:15, Chris Chabot wrote:
>
>  i've been going of the rest spec document for the format of the structure
>> while implementing this in php-shindig:
>>
>> <appdata xmlns="http://ns.opensocial.org/2008/opensocial">
>>  <entry>
>>    <key>pokes</key>
>>    <value>3</value>
>>  </entry>
>>  <entry>
>>    <key>last_poke</key>
>>    <value>2008-02-13T18:30:02Z</value>
>>  </entry>
>> </appdata>
>>
>>
>>
>> On Mon, Nov 3, 2008 at 11:38 AM, Ian Boston <ie...@tfd.co.uk> wrote:
>>
>>  I am reading the spec at http://www.opensocial.org/Technical-
>>> Resources/opensocial-spec-v081/restful-protocol
>>> section 2.5
>>> "
>>> application/json representation:
>>> (maps directly to the xml format)
>>> {
>>>  "entry" : {
>>>   "example.org:34KJDCSKJN2HHF0DW20394" : {"pokes" : 3, "last_poke" :
>>> "2008-02-13T18:30:02Z" },
>>>   "example.org:58UIDCSIOP233FDKK3HD44" : {"pokes" : 2, "last_poke" :
>>> "2007-12-16T18:30:02Z" }
>>>  }
>>> }
>>>
>>> "
>>>
>>> What is the xml ? Its not clear to me and I think the XSD is wrong, so no
>>> help.
>>> is it ?
>>>
>>> <entry>
>>>  <key>example.org:34KJDCSKJN2HHF0DW20394</key>
>>>  <value>
>>>       <entry>
>>>             <key>pokes</key>
>>>            <value>3</value>
>>>       </entry>
>>>      <entry>
>>>            <key>last_poke</key>
>>>           <value>2008-02-13T18:30:02Z</value>
>>>      </entry>
>>>  </value>
>>> </entry>
>>> <entry>
>>>  <key>example.org:58UIDCSIOP233FDKK3HD44</key>
>>>  <value>
>>>       <entry>
>>>             <key>pokes</key>
>>>            <value>2</value>
>>>       </entry>
>>>      <entry>
>>>            <key>last_poke</key>
>>>            <value>2007-12-16T18:30:02Z</value>
>>>      </entry>
>>>  </value>
>>> </entry>
>>>
>>>
>

Re: What Does AppData look like in XML ?

Posted by Ian Boston <ie...@tfd.co.uk>.
Yes that covers the single response, but when you ask for app data  
from a set of users, as per the JSon unit tests in  
RestfulJsonDataTest they are all keyed by the userId, even for single  
response. The format appears to be defined for the single response  
(as you mention), but not for a set of responses. Logically mapping  
from the JSON in the same way generates the xml in my original  
message, but I have no idea if that was intended.

Presumably the PHP code doesnt deal with collections of app data ?

Ian

On 3 Nov 2008, at 12:15, Chris Chabot wrote:

> i've been going of the rest spec document for the format of the  
> structure
> while implementing this in php-shindig:
>
> <appdata xmlns="http://ns.opensocial.org/2008/opensocial">
>   <entry>
>     <key>pokes</key>
>     <value>3</value>
>   </entry>
>   <entry>
>     <key>last_poke</key>
>     <value>2008-02-13T18:30:02Z</value>
>   </entry>
> </appdata>
>
>
>
> On Mon, Nov 3, 2008 at 11:38 AM, Ian Boston <ie...@tfd.co.uk> wrote:
>
>> I am reading the spec at http://www.opensocial.org/Technical-
>> Resources/opensocial-spec-v081/restful-protocol
>> section 2.5
>> "
>> application/json representation:
>> (maps directly to the xml format)
>> {
>>  "entry" : {
>>    "example.org:34KJDCSKJN2HHF0DW20394" : {"pokes" : 3, "last_poke" :
>> "2008-02-13T18:30:02Z" },
>>    "example.org:58UIDCSIOP233FDKK3HD44" : {"pokes" : 2, "last_poke" :
>> "2007-12-16T18:30:02Z" }
>>  }
>> }
>>
>> "
>>
>> What is the xml ? Its not clear to me and I think the XSD is  
>> wrong, so no
>> help.
>> is it ?
>>
>> <entry>
>>   <key>example.org:34KJDCSKJN2HHF0DW20394</key>
>>   <value>
>>        <entry>
>>              <key>pokes</key>
>>             <value>3</value>
>>        </entry>
>>       <entry>
>>             <key>last_poke</key>
>>            <value>2008-02-13T18:30:02Z</value>
>>       </entry>
>>  </value>
>> </entry>
>> <entry>
>>   <key>example.org:58UIDCSIOP233FDKK3HD44</key>
>>   <value>
>>        <entry>
>>              <key>pokes</key>
>>             <value>2</value>
>>        </entry>
>>       <entry>
>>             <key>last_poke</key>
>>             <value>2007-12-16T18:30:02Z</value>
>>       </entry>
>>  </value>
>> </entry>
>>


Re: What Does AppData look like in XML ?

Posted by Chris Chabot <ch...@google.com>.
i've been going of the rest spec document for the format of the structure
while implementing this in php-shindig:

<appdata xmlns="http://ns.opensocial.org/2008/opensocial">
  <entry>
    <key>pokes</key>
    <value>3</value>
  </entry>
  <entry>
    <key>last_poke</key>
    <value>2008-02-13T18:30:02Z</value>
  </entry>
</appdata>



On Mon, Nov 3, 2008 at 11:38 AM, Ian Boston <ie...@tfd.co.uk> wrote:

> I am reading the spec at http://www.opensocial.org/Technical-
> Resources/opensocial-spec-v081/restful-protocol
> section 2.5
> "
> application/json representation:
> (maps directly to the xml format)
> {
>  "entry" : {
>    "example.org:34KJDCSKJN2HHF0DW20394" : {"pokes" : 3, "last_poke" :
> "2008-02-13T18:30:02Z" },
>    "example.org:58UIDCSIOP233FDKK3HD44" : {"pokes" : 2, "last_poke" :
> "2007-12-16T18:30:02Z" }
>  }
> }
>
> "
>
> What is the xml ? Its not clear to me and I think the XSD is wrong, so no
> help.
> is it ?
>
> <entry>
>   <key>example.org:34KJDCSKJN2HHF0DW20394</key>
>   <value>
>        <entry>
>              <key>pokes</key>
>             <value>3</value>
>        </entry>
>       <entry>
>             <key>last_poke</key>
>            <value>2008-02-13T18:30:02Z</value>
>       </entry>
>  </value>
> </entry>
> <entry>
>   <key>example.org:58UIDCSIOP233FDKK3HD44</key>
>   <value>
>        <entry>
>              <key>pokes</key>
>             <value>2</value>
>        </entry>
>       <entry>
>             <key>last_poke</key>
>             <value>2007-12-16T18:30:02Z</value>
>       </entry>
>  </value>
> </entry>
>