[ 
https://issues.apache.org/jira/browse/SHINDIG-306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622490#action_12622490
 ] 

Chris Chabot commented on SHINDIG-306:
--------------------------------------

Hey Ruchi,

I don't suppose you could rework the patch to our new JsonDB based solution? 
We're following the Java folks and adopted the canonical json db over the 
(somewhat crufty) xml based solution. See shindig HEAD and the 
php/src/social-api/canonical/JsonDbOpensocialService.php file.

Oh and ps this seems to be a bug:

+               if($filter == "topFriends" || $sortOrder != "name")
+               {
+                       ksort($ids);
+                       if($max)
+                       {
+                               $ids = array_slice($ids, $first , $max, true);  
+                               $max = null;
+                       }
+               }       
<snip>
-               $totalSize = count($people);
-               $last = $first + $max;
-               $last = min($last, $totalSize);
-               if ($first !== false && $first != null && $last) {
-                       $people = array_slice($people, $first, $last);
-               }
<snip>
                $collection = new RestfulCollection($people, $first, 
$totalSize);

The $max var should always be honored, and not only work when $filter == 
topFriends, also this leaves $totalSize undefined, which get's propagated to 
the actual result output ... and breaks the clients depending on it being 
present.

Could you fix that up if your doing a new patch please? Thanks!


> 0.8 -- Add topFriends filter
> ----------------------------
>
>                 Key: SHINDIG-306
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-306
>             Project: Shindig
>          Issue Type: New Feature
>          Components: OpenSocial  feature (Javascript), RESTful API (Java), 
> RESTful API (PHP)
>            Reporter: Paul Lindner
>            Assignee: Paul Lindner
>         Attachments: BasicPeopleService.php.patch, getTopFriends.xml, 
> state-basicfriendlist.xml.patch, XmlStateFileFetcher.php.patch
>
>
> ref: FILTER_TYPE-001
> Top friends should be a filter as well as a sort...
> opensocial.DataRequest.FilterType = {
> /**
> * Retrieves only the user's top friends.
> *
> * @member opensocial.DataRequest.FilterType
> */
> TOP_FRIENDS : 'topFriends',
> ...
> }     Top friends should be a filter as well as a sort        
> http://groups.google.com/group/opensocial-and-gadgets-spec/browse_thread/thread/ae406a39198ecd31
>                                                                               
>                                   

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to