Query regarding SortOrder

1 view
Skip to first unread message

asthabhat...@gmail.com

unread,
Nov 7, 2008, 9:00:21 AM11/7/08
to OpenSocial - OpenSocial and Gadgets Specification Discussion, cha...@google.com
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 ?
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 a mismatch in API refernce and resful
specification ?

Please clarify.



---------- Forwarded message ----------
From: Chris Chabot <cha...@google.com>
Date: Fri, Nov 7, 2008 at 7:19 PM
Subject: Re: Query regarding SortOrder
To: shind...@incubator.apache.org


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 <
asthabhat...@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
>


Astha

Scott Seely

unread,
Nov 7, 2008, 3:11:18 PM11/7/08
to shind...@incubator.apache.org, cha...@google.com
Re-posting to shindig-dev
> v081/restful-protocol(section<http://www.opensocial.org/Technical-

asthabhat...@gmail.com

unread,
Nov 28, 2008, 4:37:00 AM11/28/08
to OpenSocial - OpenSocial and Gadgets Specification Discussion
Any update on this? Or we going to update the spec as it needs to be
re-processed in terms of the exact functionality and api calls.
> >https://issues.apache.org/jira/browse/SHINDIG-668but as Paul Lindner

Paul Lindner

unread,
Nov 28, 2008, 6:44:47 PM11/28/08
to opensocial-an...@googlegroups.com
For 0.9 there is work to align the JS api and the REST api of 0.8.1,
which was changed to accommodate the Portable Contacts specification.

Until then there is not any official sorting/filtering for activities,
and the JS api does not expose the people sorting functionality.
Paul Lindner
plin...@hi5.com



Joseph Smarr

unread,
Nov 28, 2008, 11:18:15 PM11/28/08
to opensocial-an...@googlegroups.com
Just to clarify, as part of the Portable Contacts alignment, the old query field "orderBy" was renamed to "sortBy", and the accompanying field "sortOrder" was added. So sortBy is the field by which you want to sort (e.g. name/birthday/etc) and sortOrder is one of ascending or descending. Perhaps not all of the specs and code have been updated to reflect this yet, so we should find and fix those cases, but sortBy/sortOrder is the way it should be going forward.
 
Thanks, js

Reply all
Reply to author
Forward
0 new messages