You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Chris Chabot (JIRA)" <ji...@apache.org> on 2008/06/24 23:57:44 UTC

[jira] Commented: (SHINDIG-404) Support jsonBatch request

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

Chris Chabot commented on SHINDIG-404:
--------------------------------------

Hey Gonzalo,

I tried it out locally, and there seems to be some errors in the output .. maybe your PHP error reporting level is set lower then mine that you didn't catch this? it's always a good idea to develop with the strictest level possible :)

Forinstance with this request:
{"viewer":{"url":"/people/@viewer/@self?fields=id,name,thumbnailUrl&startIndex=0&count=20&orderBy=topFriends
&filterBy=all","method":"GET"},"viewerActivities":{"url":"/activities/@viewer/@self?app=@app","method"
:"GET"},"activities":{"url":"/activities/@viewer/@friends?app=@app","method":"GET"}}

i get:

<br />
<b>Notice</b>:  Undefined property: stdClass::$postData in <b>/Users/chabotc/shindig/php/src/socialrest
/http/RestRequestItem.php</b> on line <b>52</b><br />
<br />
<b>Notice</b>:  Undefined index:  personId in <b>/Users/chabotc/shindig/php/src/socialrest/PersonHandler
.php</b> on line <b>43</b><br />
<br />
<b>Notice</b>:  Undefined variable: DEFAULT_PERSON_FIELDS in <b>/Users/chabotc/shindig/php/src/socialrest
/PersonHandler.php</b> on line <b>44</b><br />
<br />
<b>Notice</b>:  Undefined property: stdClass::$postData in <b>/Users/chabotc/shindig/php/src/socialrest
/http/RestRequestItem.php</b> on line <b>52</b><br />
<br />
<b>Notice</b>:  Undefined index:  activityId in <b>/Users/chabotc/shindig/php/src/socialrest/ActivityHandler
.php</b> on line <b>51</b><br />
<br />
<b>Notice</b>:  Undefined property: stdClass::$postData in <b>/Users/chabotc/shindig/php/src/socialrest
/http/RestRequestItem.php</b> on line <b>52</b><br />
<br />
<b>Notice</b>:  Undefined index:  activityId in <b>/Users/chabotc/shindig/php/src/socialrest/ActivityHandler
.php</b> on line <b>51</b><br /> 

then followed by a propper response:

{"responses":{"viewer":{"response":{"isOwner":true,"isViewer":true,"name":{"familyName":"Chabot","givenName"
:"Chris","unstructured":"Chris Chabot"},"id":"1",... etc

Could you please take a look at that and see about fixing it?

Ps in RestRequestItem.php:putUrlParamsIntoParameters() you have an un-used variable: $parameters = array();

Another big PS, in ActivityHandler.php you comment:
//TODO: The appId should come from the url. The spec needs to be fixed!

Did you bounce this of the shindig-dev / opensocial-and-gadget-spec lists? It might be good to make sure this indeed the case and if so make sure it is fixed. (I would assume the AppId should come from the token btw, and not from the url .. but i could be wrong)

$fields = $requestItem->getFieldsWithDefaultValue($DEFAULT_PERSON_FIELDS);
should probably be:
$fields = $requestItem->getFieldsWithDefaultValue($this->DEFAULT_PERSON_FIELDS);

I see you also adopted a bad habit that i have:
$requestItem->parseUrlWithTemplate(AppDataHandler::$APP_DATA_PATH);
should really be:
$requestItem->parseUrlWithTemplate(self::$APP_DATA_PATH);
(if indeed it is self, and not an inherited or foreign class).

Patch looks great for the rest!

> Support jsonBatch request
> -------------------------
>
>                 Key: SHINDIG-404
>                 URL: https://issues.apache.org/jira/browse/SHINDIG-404
>             Project: Shindig
>          Issue Type: New Feature
>          Components: RESTful API (PHP)
>            Reporter: Gonzalo Aune
>         Attachments: feature-SHINDIG-404.patch
>
>
> Support jsonBatch request as java does, multiple querys in a single request.

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