You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Ram Sharma <ra...@gmail.com> on 2008/08/18 13:50:23 UTC

Re: dshindig php query

Anand,

I would suggest you to put this thread on the Shindig dev mailing list.So
that you can get more support and responses to sort out your problem.

On Mon, Aug 18, 2008 at 4:20 PM, anand sharma
<an...@gmail.com>wrote:

> Hi Ram ,
>
>    thx for ur response .
>    I already worked  on  previous PHP shindig and with that shindig , my
> ListFRiends.xml
>    was working fine . Even with new  PHP shindig 0.8 , when i am running
> default samplecontainer.html and running my gadget , its giving correct
> output .
>
>
>   i think i am missing something in shindig itself .Because if my response
> is coming fine thn it should go to some file and i think i m not getting
> after response with file will be called .
> Hope i am right from my side .
>
> Thx
> Cheers
> Anand
>
>
>
> On Mon, Aug 18, 2008 at 12:27 PM, Ram Sharma <ra...@gmail.com>wrote:
>
>> Hi Anand,
>>
>> I would prefer that if you tr some standard gadgets first and if they work
>> fine then only try your gadget. If the standard ones are not working
>> properly then it might be Shindig issue other wise it will be an issue of
>> your gadget code. As far as i can see I think (must not be correct) the
>> problem is in your gadget code.
>>
>>
>>
>>
>> On Sun, Aug 17, 2008 at 8:09 PM, anand sharma <
>> anandkumarsharma11@gmail.com> wrote:
>>
>>> Hi to All
>>> i checked out latest Shindig code of Revision no : 686151
>>> I have created my own PHP shindig Basic{People,Activities,Data}.php
>>> and few gadgets like "helloworld.xml" , "GeoLocation.xml" are working
>>> absoultely fine,
>>> As far i know  shindig PHP is working fine.
>>> But whenever i am running any gadget which is using
>>> Basic{people,activities,data}.php , it has some probs.
>>> suppose whenever i am running ListFriends.xml file in Shindig PHP , its
>>> giving response in firebug as :
>>> 1.
>>> POST
>>> http://localhost/shindig/php/social/rest/jsonBatch?st=6%3A6%3A6396%3Ashindig%3Ahttp%253A%2F%2Flocalhost%2FGOSDemoAppPHP%2Fgadgets%2FListFriends.xml%3A0(1062ms)
>>>
>>>
>>> POST:
>>>
>>>
>>> {"viewer":{"url":"/people/@viewer/@self?fields=id,name,thumbnailUrl&startIndex=0&count=20&orderBy=topFriends
>>>
>>>
>>> &filterBy=all&networkDistance=","method":"GET"},"viewerFriends":{"url":"/people/@viewer/@friends?fields
>>>
>>>
>>> =id,name,thumbnailUrl&startIndex=0&count=20&orderBy=topFriends&filterBy=all&networkDistance=","method"
>>>
>>> :"GET"}}
>>>
>>>
>>> RESPONSE:
>>>
>>> {"responses":{"viewer":{"response":{"6":{"aboutMe":"Its all abt the fact
>>> :-)","dateOfBirth":"1985-11-22"
>>>
>>>
>>> ,"id":"6","name":{"unstructured":"ak47"},"isOwner":false,"isViewer":false}}},"viewerFriends":{"response"
>>>
>>> :{"1":{"aboutMe":"\tWhen I am working on a problem I never think about
>>> beauty. I only think about how
>>>
>>>  to solve the problem. But when I have finished, if the solution is not
>>> beautiful, I know it is wrong
>>>
>>> .\r\n","dateOfBirth":"1991-01-01","id":"1","name":{"unstructured":"Venkata
>>> Suresh"},"isOwner":false,"isViewer"
>>>
>>> :false},"2":{"aboutMe":"\tI am a man of fixed and unbending principles,
>>> the first of which is to be flexible
>>>
>>>  at all
>>> times.","dateOfBirth":"1992-02-01","id":"2","name":{"unstructured":"Ganesh
>>> Kumar"},"isOwner"
>>>
>>> :false,"isViewer":false},"3":{"aboutMe":"\tI always try to believe the
>>> best of everybody -- it saves
>>>
>>>  so much
>>> trouble.\r\n","dateOfBirth":"1993-03-01","id":"3","name":{"unstructured":"Ashok
>>> kumar"},"isOwner"
>>>
>>>
>>> :false,"isViewer":false},"4":{"aboutMe":"Kool!!!","dateOfBirth":"1985-01-01","id":"4","name":{"unstructured"
>>>
>>> :"Sanjeev
>>> Srinidhi"},"isOwner":false,"isViewer":false},"5":{"aboutMe":"nagraju mast
>>> maja maadi !!!!!
>>>
>>>
>>> !!!!","dateOfBirth":"1985-12-11","id":"5","name":{"unstructured":"nagraju"},"isOwner":false,"isViewer"
>>>
>>> :false},"7":{"aboutMe":"Devil also scare to enter in my
>>> domain","dateOfBirth":"1985-11-22","id":"7","name"
>>>
>>>
>>> :{"unstructured":"machi"},"isOwner":false,"isViewer":false}}}},"error":false}
>>>
>>>
>>>
>>> As far i know that i am getting right response but i cannot able to see
>>> these response as my result of gadget(ListFriends.xml) output.
>>>
>>> i think according to my own BasicPeople.php , i have to change any other
>>> files.
>>>
>>> if is it so then please let me own the way .
>>>
>>> may be i going in wrong way .
>>>
>>>
>>> Cheers
>>>
>>> Anand
>>>
>>>
>>
>>
>> --
>> Ram Sharma
>> Software Engineer
>> Impetus Infotech (India) Pvt Ltd
>> Indore
>>
>
>


-- 
Ram Sharma
Software Engineer
Impetus Infotech (India) Pvt Ltd
Indore

Re: dshindig php query

Posted by Ram Sharma <ra...@gmail.com>.
Hi Anand,

I think you are having some confusion in PersonFetchdataRequest syntax. The
syntax should be like this :

req.add(req.newFetchPersonRequest('VIEWER'), 'viewer');
req.add(req.newFetchPeopleRequest('VIEWER_FRIENDS'), 'viewerFriends');

not like :
req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER),
'viewer');
req.add(req.newFetchPeopleRequest(opensocial.DataRequest.PersonId.VIEWER_FRIENDS),
'viewerFriends');

I ran your gadget with the correct syntax and it worked fine. Please see
also OpenSocial JavaScript specification for more syntax.

http://code.google.com/apis/opensocial/docs/0.8/reference/

For posting any question to Shindig mailing list you can just mail to

shindig-dev@incubator.apache.org

I cc'd my previous response also to Shindig dev list. Now again I am doing
cc to Shindig dev mailing list so that others can also help you.

On Tue, Aug 19, 2008 at 10:59 AM, anand sharma <anandkumarsharma11@gmail.com
> wrote:

> Hi Ram
>     thx for ur suggestion.
>     hey i know there are few mailing list like :
>     shindig-dev.markmail.org
>     mail-archives.apache.org
>     but i can able to view all post  but cannot able to write or put commet
> on any post .
>     so what i do for that .. :-(
> But this gadget was working fine with my previous PHP shindig.
> will you please give  ur some precious time on my gadget code and tell me
> if i am going wrong somewhere.
> ListFriends.xml
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <Module>
>  <ModulePrefs title="List Friends Example">
>    <Require feature="opensocial-0.7"/>
>  </ModulePrefs>
>  <Content type="html">
>
>  <![CDATA[
>
>  <script type="text/javascript">
>
>
>   function getData() {
>     var req = opensocial.newDataRequest();
>
> req.add(req.newFetchPersonRequest(opensocial.DataRequest.PersonId.VIEWER),
> 'viewer');
>
> req.add(req.newFetchPeopleRequest(opensocial.DataRequest.PersonId.VIEWER_FRIENDS),
> 'viewerFriends');
>     req.send(onLoadFriends);
>   };
>
>
>   function onLoadFriends(dataResponse) {
>     var viewer = dataResponse.get('viewer').getData();
>     var html = 'Friends of ' + viewer.getDisplayName();
>     html += ':<br><ul>';
>     var viewerFriends = dataResponse.get('viewerFriends').getData();
>     viewerFriends.each(function(person) {
>     html += '<li>' + person.getDisplayName() + '</li>';
>     });
>     html += '</ul>';
>     document.getElementById('message').innerHTML = html;
>   };
>
>   gadgets.util.registerOnLoadHandler(getData);
>
>   </script>
>   <div id="message"> </div>
>   ]]>
>   </Content>
> </Module>
>
>
> Thx
>
> cheers
> Anand
>
>
> On Mon, Aug 18, 2008 at 5:20 PM, Ram Sharma <ra...@gmail.com>wrote:
>
>> Anand,
>>
>> I would suggest you to put this thread on the Shindig dev mailing list.So
>> that you can get more support and responses to sort out your problem.
>>
>>
>> On Mon, Aug 18, 2008 at 4:20 PM, anand sharma <
>> anandkumarsharma11@gmail.com> wrote:
>>
>>> Hi Ram ,
>>>
>>>    thx for ur response .
>>>    I already worked  on  previous PHP shindig and with that shindig , my
>>> ListFRiends.xml
>>>    was working fine . Even with new  PHP shindig 0.8 , when i am running
>>> default samplecontainer.html and running my gadget , its giving correct
>>> output .
>>>
>>>
>>>   i think i am missing something in shindig itself .Because if my
>>> response is coming fine thn it should go to some file and i think i m not
>>> getting after response with file will be called .
>>> Hope i am right from my side .
>>>
>>> Thx
>>> Cheers
>>> Anand
>>>
>>>
>>>
>>> On Mon, Aug 18, 2008 at 12:27 PM, Ram Sharma <ra...@gmail.com>wrote:
>>>
>>>> Hi Anand,
>>>>
>>>> I would prefer that if you tr some standard gadgets first and if they
>>>> work fine then only try your gadget. If the standard ones are not working
>>>> properly then it might be Shindig issue other wise it will be an issue of
>>>> your gadget code. As far as i can see I think (must not be correct) the
>>>> problem is in your gadget code.
>>>>
>>>>
>>>>
>>>>
>>>> On Sun, Aug 17, 2008 at 8:09 PM, anand sharma <
>>>> anandkumarsharma11@gmail.com> wrote:
>>>>
>>>>> Hi to All
>>>>> i checked out latest Shindig code of Revision no : 686151
>>>>> I have created my own PHP shindig Basic{People,Activities,Data}.php
>>>>> and few gadgets like "helloworld.xml" , "GeoLocation.xml" are working
>>>>> absoultely fine,
>>>>> As far i know  shindig PHP is working fine.
>>>>> But whenever i am running any gadget which is using
>>>>> Basic{people,activities,data}.php , it has some probs.
>>>>> suppose whenever i am running ListFriends.xml file in Shindig PHP , its
>>>>> giving response in firebug as :
>>>>> 1.
>>>>> POST
>>>>> http://localhost/shindig/php/social/rest/jsonBatch?st=6%3A6%3A6396%3Ashindig%3Ahttp%253A%2F%2Flocalhost%2FGOSDemoAppPHP%2Fgadgets%2FListFriends.xml%3A0(1062ms)
>>>>>
>>>>>
>>>>> POST:
>>>>>
>>>>>
>>>>> {"viewer":{"url":"/people/@viewer/@self?fields=id,name,thumbnailUrl&startIndex=0&count=20&orderBy=topFriends
>>>>>
>>>>>
>>>>> &filterBy=all&networkDistance=","method":"GET"},"viewerFriends":{"url":"/people/@viewer/@friends?fields
>>>>>
>>>>>
>>>>> =id,name,thumbnailUrl&startIndex=0&count=20&orderBy=topFriends&filterBy=all&networkDistance=","method"
>>>>>
>>>>> :"GET"}}
>>>>>
>>>>>
>>>>> RESPONSE:
>>>>>
>>>>> {"responses":{"viewer":{"response":{"6":{"aboutMe":"Its all abt the
>>>>> fact :-)","dateOfBirth":"1985-11-22"
>>>>>
>>>>>
>>>>> ,"id":"6","name":{"unstructured":"ak47"},"isOwner":false,"isViewer":false}}},"viewerFriends":{"response"
>>>>>
>>>>> :{"1":{"aboutMe":"\tWhen I am working on a problem I never think about
>>>>> beauty. I only think about how
>>>>>
>>>>>  to solve the problem. But when I have finished, if the solution is not
>>>>> beautiful, I know it is wrong
>>>>>
>>>>> .\r\n","dateOfBirth":"1991-01-01","id":"1","name":{"unstructured":"Venkata
>>>>> Suresh"},"isOwner":false,"isViewer"
>>>>>
>>>>> :false},"2":{"aboutMe":"\tI am a man of fixed and unbending principles,
>>>>> the first of which is to be flexible
>>>>>
>>>>>  at all
>>>>> times.","dateOfBirth":"1992-02-01","id":"2","name":{"unstructured":"Ganesh
>>>>> Kumar"},"isOwner"
>>>>>
>>>>> :false,"isViewer":false},"3":{"aboutMe":"\tI always try to believe the
>>>>> best of everybody -- it saves
>>>>>
>>>>>  so much
>>>>> trouble.\r\n","dateOfBirth":"1993-03-01","id":"3","name":{"unstructured":"Ashok
>>>>> kumar"},"isOwner"
>>>>>
>>>>>
>>>>> :false,"isViewer":false},"4":{"aboutMe":"Kool!!!","dateOfBirth":"1985-01-01","id":"4","name":{"unstructured"
>>>>>
>>>>> :"Sanjeev
>>>>> Srinidhi"},"isOwner":false,"isViewer":false},"5":{"aboutMe":"nagraju mast
>>>>> maja maadi !!!!!
>>>>>
>>>>>
>>>>> !!!!","dateOfBirth":"1985-12-11","id":"5","name":{"unstructured":"nagraju"},"isOwner":false,"isViewer"
>>>>>
>>>>> :false},"7":{"aboutMe":"Devil also scare to enter in my
>>>>> domain","dateOfBirth":"1985-11-22","id":"7","name"
>>>>>
>>>>>
>>>>> :{"unstructured":"machi"},"isOwner":false,"isViewer":false}}}},"error":false}
>>>>>
>>>>>
>>>>>
>>>>> As far i know that i am getting right response but i cannot able to see
>>>>> these response as my result of gadget(ListFriends.xml) output.
>>>>>
>>>>> i think according to my own BasicPeople.php , i have to change any
>>>>> other files.
>>>>>
>>>>> if is it so then please let me own the way .
>>>>>
>>>>> may be i going in wrong way .
>>>>>
>>>>>
>>>>> Cheers
>>>>>
>>>>> Anand
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Ram Sharma
>>>> Software Engineer
>>>> Impetus Infotech (India) Pvt Ltd
>>>> Indore
>>>>
>>>
>>>
>>
>>
>> --
>> Ram Sharma
>> Software Engineer
>> Impetus Infotech (India) Pvt Ltd
>> Indore
>>
>
>


-- 
Ram Sharma
Software Engineer
Impetus Infotech (India) Pvt Ltd
Indore