Thanks for your help.
Anyway i figured out what was the previous problem. It was a mismatch
of the shared secret. actually when you include config.php in your
container to generate token that time it was unable to load my
local.php config file. but it works in the shindig environment. so i
changed in the config.php in container server. as i was a problem with
realive path. so i changed it to ->
if (file_exists(realpath(dirname(__FILE__)).'/config/
local.php'))         --------- instead of -> if (file_exists('config/
local.php'))  ........ after that it works fine.

anyway i found another problem yesterday when i updated the shindig.
and i thought i should let you know. You are the best guy who can tell
me the problem is i my side or in the shindig itself.

i have an application which work fine in orkut and i test my container/
shindig using that application.

So when i updated yesterday from the svn. my app started to fail. it
was unable to get the displayName and gender ( dont know what else,
because in my app i dont use all the field) . Anyway id and
thumnailUrl was getting properly. So i did some reverse engineering in
the shindig javascript side and changed my container shindig php side
a bit (specifically MyDataFetcher) and then i started to get gender
properly.

So what i did here is, i changed the way i was setting gender
previously.

previously it was --->   [$person->setGender('FEMALE');]
and now i changed it to -->  [$person->setGender(new
EnumGender('Female')); ]
and after that my app started to recieve gender field properly. and
this problem is happening in my other apps also.

anyway my app is still unable to get the displayname... there is no
wrong in my application that i can tell you surely.

to be more specific these calls in javascript is returning "undefiend"
when it should not.
usr.getDisplayName()
own_pro.getField(opensocial.Person.Field.GENDER).key

but these are working fine -> own_pro.getId() or
own_pro.getField(opensocial.Person.Field.THUMBNAIL_URL)

so i have a feeling as these fields like id, thumbnailurl are simple
field and its working fine, but gender, name comes under complex field
according to shindig model, and these are failing.

and i am setting the name this way
                        $fullname = $row['firstName'] . ' ' . $row['lastName']
                        $name = new Name($fullname);
                        $name->setGivenName($row['firstName']);
                        $name->setFamilyName($row['lastName']);
                        $person = new Person($row['uid'], $name);
                        $person->setDisplayName($fullname);

but unable to receive the name in my app.

can you shade some light on this. I also wanted to know should i use
the EnumGender class to set the gender from now on?

thanks in advance. :)


On Aug 19, 3:23 pm, Chris Chabot <[EMAIL PROTECTED]> wrote:
> Hey Tuhin, glad to hear your making some progress!
>
> I think the encoding of the token was changed a bit some 5 weeks ago,  
> when we were working on the RESTful API support. Previously the token  
> was always posted, but with the REST service it's often parsed as a  
> $_GET, so the encoding had to be updated.
>
> The simplest way to make sure 'it just works', is probably to copy the  
> token code from partuza's gadget creating 
> logic:http://code.google.com/p/partuza/source/browse/trunk/Application/View...
>
> A quick look there will show that it now does a:
>         "st=".urlencode(base64_encode($securityToken->toSerialForm()))
>
> to append the token to the URL.
>
> Ps, the best place for shindig development & usage questions is the  
> shindig mailing list: [EMAIL PROTECTED] there's a lot  
> more people there with knowledge of how php shindig works then on the  
> generic 'container' list. Seehttp://incubator.apache.org/shindig/#tab-support
>   for how to sign up there.
>
> Good luck!
>
>         -- Chris
>
> On Aug 18, 2008, at 4:15 PM, tuhin.barua wrote:
>
>
>
> > Hey chris thanks for your help, i really appreciate it.
>
> > I just wanted to confirm something.
>
> > i updated my shindig from the svn after long time and now its not
> > working.
> > at first i was getting problem with file include paths and class
> > duplication, anyway i corrected that
>
> > currently i am using this way
> > ////
>
> > $OSPATH = '/home/www/shindig/trunk/php/';
> > require_once($OSPATH.'config.php');
> > require_once($OSPATH.'src/common/SecurityToken.php');
> > require_once($OSPATH.'src/common/BlobCrypter.php');
> > require_once($OSPATH.'src/common/samplecontainer/
> > BasicBlobCrypter.php');
> > require_once($OSPATH.'src/common/samplecontainer/
> > BasicSecurityToken.php');
>
> > and i am generating token like this
>
> >    function getGadgetUrl($view = 'canvas'){
> >            $parent = 'http://mydevel.com/';
>
> >            $owner = 'john.doe';
> >            $viewer = 'john.doe';
> >            $app = 'bitsapp';
> >            $domain = $parent;
> >            $appUrl = 'http://opensocial.bolbakar.com/media/t.xml';
> >            $moduleId = 'bitsmodule';
> >            $token = BasicSecurityToken::createFromValues($owner, $viewer, 
> > $app,
> > $domain, $appUrl, $moduleId);
> >            $st = urlencode(base64_encode($token->toSerialForm()));
> >            //$st = urlencode($token->toSerialForm());
>
> >            $hosturl = 'http://dev.imodules.com/gadgets/ifr?';
>
> >            $gadgetUrl = $hosturl . '&bpc=1&url='.urlencode($appUrl).'&st='.
> > $st.'&view='.$view.'&parent='.$parent;
>
> >            return $gadgetUrl;
> >    }
>
> > if i do $st = urlencode(base64_encode($token->toSerialForm()));
> > i am getting this in gadgets/ifr page inside javascript
> > -----------------
> > <b>Notice</b>: Undefined offset: 1 in <b>/home/imodules/shindig/trunk/
> > php/src/common/samplecontainer/BasicBlobCrypter.php</b> on line
> > <b>123</b><br />
> > 257<br />
> > 258<b>Notice</b>: Undefined index: t in <b>/home/imodules/shindig/
> > trunk/php/src/common/samplecontainer/BasicBlobCrypter.php</b> on line
> > <b>131</b><br />
> > 259<br />
> > 260<b>Notice</b>: Undefined index: t in <b>/home/imodules/shindig/
> > trunk/php/src/common/samplecontainer/BasicBlobCrypter.php</b> on line
> > <b>132</b><br />
>
> > and if i do $st = urlencode($token->toSerialForm());
> > i am getting invalid gadget token error in jsonrequest
>
> > but in plain text token all is working fine...... if i pass
> > st=owner:viewer:a:b:c:d
>
> > also please note, before recent update sometimes it used to give
> > problem while authentication token, but sometimes it used to work
> > fine, without any changes
>
> > also when i include shindig/trunk/php/src/common/samplecontainer/
> > BasicBlobCrypter.php to generate token, i got require file error for
> > crypto.php, path was not working, so i changed path to src/common/
> > samplecontainer/Crypto.php to Crypto.php
>
> > can you put some light on this?
>
> > thanks
> > Tuhin
>
> > On Jul 9, 3:54 pm, Chris Chabot <[EMAIL PROTECTED]> wrote:
> >> AppId is whatever ID the container / site gives a gadget, module id  
> >> is
> >> which instance of the gadget it is on that page, domain is your
> >> socialnetwork.com... So all your assumptions are indeed correct :)
>
> >> Shindig in it's self does use some of those values, for instance when
> >> a gadget wants to save some application data or create an activity,
> >> the app id in the security token is used to record which app this  
> >> data
> >> belongs too .. a crucial bit of information in that case :) Also the
> >> owner and viewer id's that are encoded in the token are heavily used
> >> as you can imagine.
>
> >> Other fields can either be used by the container in it's data  
> >> services
> >> (that you plug into shindig to couple it to your data layer), or will
> >> be used in the future (the proxy service should know which
> >> configuration to use, and for that it needs the domain key), so it's
> >> in your best interest to make sure you fill them in correctly so you
> >> don't get unexpected surprises down the road :)
>
> >>        -- Chris
>
> >> On Jul 9, 2008, at 12:14 PM, tuhin.barua wrote:
>
> >>> Thanks... it works :)
>
> >>> I have another question for you, not so very important i guess
>
> >>> $token = new BasicSecurityToken(null, null, $owner, $viewer, $app,
> >>> $domain, $appUrl, $moduleId);
> >>> i do this to generate ST token....
>
> >>> Can you tell me here whats the use of $app, $domain, $appUrl,
> >>> $moduleid ?  it also dont restrict anything. i tried with some junk
> >>> values...and still all works fine.
> >>> I dont see much use of these parameters. can you give me an example?
> >>> anyway the way i understand, i guess it should be something like  
> >>> ----
> >>> eg: lets say its orkut opensocial
> >>> $app = orkut application id ??
> >>> $domain =www.orkut.com
> >>> $appUrl =http://somedomain/myapp.xml
> >>> $moduleid = whats this now?
>
> >>> here appUrl supposed to be unique? and it shd point to one  
> >>> particular
> >>> appid right?
> >>> so whats the use of moduleid? is it something like if someone add  
> >>> same
> >>> app twice so in tht case appid will be same in both instance but
> >>> moduleid will be different?
> >>> i am not sure... i am just guessing
>
> >>> On Jun 27, 2:40 pm, Chris Chabot <[EMAIL PROTECTED]> wrote:
> >>>> Yep works for me, keep in mind that this is a container feature,  
> >>>> and
> >>>> not a 'shindig' feature.
>
> >>>> What you need to do is create some javascript for your container
> >>>> site,
> >>>> that registers 'i can handle the requestNagivateTo rpc, with this
> >>>> function', seehttp://partuza.us.chabotc.com/js/container.jsfor
> >>>> example.
>
> >>>> Also when your setting up your server, and you support more then  
> >>>> the
> >>>> 'profile' and 'canvas' view, don't forget to edit your shindig/
> >>>> config/
> >>>> container.js, and add your other view(s) to the "views" section  
> >>>> (for
> >>>> instance partuza supports the home view so i added:
> >>>>    "home" : {
> >>>>      "isOnlyVisible" : false,
> >>>>      "aliases": []
> >>>>    },
>
> >>>> to views.
>
> >>>> ps i did double check by whiping up a quick navigate 
> >>>> gadget:http://chabotc.com/navigate.xml
> >>>> when i add that to my site, and click the navigate links, it's
> >>>> working fine and dandy for me
>
> >>>>       -- Chris
>
> >>>> On Jun 27, 2008, at 10:21 AM, tuhin.barua wrote:
>
> >>>>> hey chris
>
> >>>>> is this working currently in php server?
>
> >>>>> this is my app javascript which works in orkut
>
> >>>>> function nav(view,data){
> >>>>>  var supported_views = gadgets.views.getSupportedViews();
> >>>>>  d={
> >>>>>          q: data
> >>>>>  }
> >>>>>  gadgets.views.requestNavigateTo(supported_views[view],d);
> >>>>> }
>
> >>>>> here view = 'canvas' and data is appdata
> >>>>> ir orkut i call this function from profile view... and then it  
> >>>>> gets
> >>>>> redirected to application canvas view with app params.... which
> >>>>> works
> >>>>> fine
> >>>>> but in my php server its not working.... i can see rpc_relay.html
> >>>>> getting called asynchronously in the firebug when i call this
> >>>>> function
> >>>>> same like orkut....
>
> >>>>> - Tuhin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Implementing OpenSocial Containers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-container?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to