You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Astha Bhatnagar <as...@gmail.com> on 2008/11/07 14:44:02 UTC

Query regarding SortOrder

Hi Shindig Dev,

I was just looking at the code and tried to relate things with the spec. I
found some inforrmation from API reference and some from Restful
Specification. I am a bit confused with what I read.

The point is related to SortOrder parameter in request.

Accroding to API (0.8.1)
http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.DataRequest.SortOrder

SortOrder can be Top_Friends and Name for the People (there is nothing
mentioned about activities & AppData sort order.)

According to Restful protocol specification (0.8.1)
http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/restful-protocol(section
6.5)
SortOrder can be Ascending or Descending, default ascending. It does not say
anything about service for which this SortOrder can be
used(People/Activity/AppData)


In PHP code
JsonDbOpensocialService::getPeople() uses CollectionObject to get SortOrder
and by looking seems that it is meant to work on TopFriends and Name.

and in ActivityService->getActivities() uses sortBy parameter but not using
sortOrder. by looking at the code it seems that it does not expect anything
related to sorting that is supported by the API.

So, now my point of confusion is do we need sorting for Activities/AppData ?
if not then what is the meaning of sortOrder parameter in Restful
Apecification and ActivityService->getActivities(). Is it me who is not
getting it right or there is some mismatch in API refernce and resful
specification ?

Please clarify.

Astha

Re: Query regarding SortOrder

Posted by Chris Chabot <ch...@google.com>.
It's important to keep in mind that shindig implements the OpenSocial
specification, and in this case indeed the specification doesn't say much
about the sort order on activities and app data.. the same can be said about
support for paging on the same result sets.

There is a proposed patch to add paging to activities:
https://issues.apache.org/jira/browse/SHINDIG-668 but as Paul Lindner
pointed out in that issue, it might be better to apply the same
CollectionOptions on those result sets too.

But, to be able to do this it first needs to become spec, and then we can
implement it; So could you please post this question to the
opensocial-gadget-and-spec list?

Thanks!

   -- Chris

On Fri, Nov 7, 2008 at 2:44 PM, Astha Bhatnagar <
asthabhatnagar2008@gmail.com> wrote:

> Hi Shindig Dev,
>
> I was just looking at the code and tried to relate things with the spec. I
> found some inforrmation from API reference and some from Restful
> Specification. I am a bit confused with what I read.
>
> The point is related to SortOrder parameter in request.
>
> Accroding to API (0.8.1)
>
> http://code.google.com/apis/opensocial/docs/0.8/reference/#opensocial.DataRequest.SortOrder
>
> SortOrder can be Top_Friends and Name for the People (there is nothing
> mentioned about activities & AppData sort order.)
>
> According to Restful protocol specification (0.8.1)
>
> http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/restful-protocol(section<http://www.opensocial.org/Technical-Resources/opensocial-spec-v081/restful-protocol%28section>
> 6.5)
> SortOrder can be Ascending or Descending, default ascending. It does not
> say
> anything about service for which this SortOrder can be
> used(People/Activity/AppData)
>
>
> In PHP code
> JsonDbOpensocialService::getPeople() uses CollectionObject to get SortOrder
> and by looking seems that it is meant to work on TopFriends and Name.
>
> and in ActivityService->getActivities() uses sortBy parameter but not using
> sortOrder. by looking at the code it seems that it does not expect anything
> related to sorting that is supported by the API.
>
> So, now my point of confusion is do we need sorting for Activities/AppData
> ?
> if not then what is the meaning of sortOrder parameter in Restful
> Apecification and ActivityService->getActivities(). Is it me who is not
> getting it right or there is some mismatch in API refernce and resful
> specification ?
>
> Please clarify.
>
> Astha
>