Hi Bhagat,

i am sorry but i have no experience with the container development.
You have to ask google team for that.

sorry.

marc.

2008/4/1, bhagat <[EMAIL PROTECTED]>:
>
>
> Hi Marc
>
> Thanks for amazing reply.Now I understand what to do.
>
> But I am stuck on the PHP side of container. Well I want to create my
> container page in PHP and it should do as follows:
> When I login to my website it should go to Home page and my Home page
> is a container. And I will include some gadgets in the home page.
>
> But my dilemma is I dont understand how do I run php container? I
> tried the instruction given in  README file of php/gadgets folder. And
> it ask:
>
> ----------------------------------------------------------------------------------------------------------------------------------
>    "Copy the files to your web root, and edit the config.php
> web_prefix and debug settings
>    to your liking. Make sure that the features and javascript
> directories are also copied
>    or edit your config.php to reflect their location. "
>
> ---------------------------------------------------------------------------------------------------------------------------------
>
> As per instruction I have copied gadgets folder to my htdocs(root
> where my php files run) directory. And also copied folders of
> javascripts, features, and config folders to htdocs folder. And also
> change path in config.php to :
>
>
> --------------------------------------------------------------------------------------------------------------------------------
>         'features_path' =>  realpath(dirname(__FILE__)).'/features/',
>         'syndicator_path' =>  realpath(dirname(__FILE__)).'/config/',
>         'javascript_path' =>  realpath(dirname(__FILE__)).'/javascript/',
>
> --------------------------------------------------------------------------------------------------------------------------------
> but when I run the index.php file in localhost as:
>
> http://localhost/gadgets
>
> it is not running my index.php file and gives 404 error and its not
> running any thing and even in the README file as it mentioned :
>
>
> --------------------------------------------------------------------------------------------------------------------------------
> "3) Hit server at http://<yourhost>/gadgets/ifr?url=<gadget-url>
>    Example: http://<yourhost>/gadgets/ifr?url=
> http://www.labpixies.com/campaigns/todo/todo.xml
>    Or hit the sample container at
> http://<yourhost>/gadgets/files/samplecontainer/samplecontainer.html"
>
> ---------------------------------------------------------------------------------------------------------------------------------
> but my index.php file doesnt do any thing.It even not showing 404
> error in header1 format.
>
> So I think my problem is to set the correct path for web_prefix. So
> can you tell me what is my problem? Why my php container not running
> as Java shindig container does.
>
> Thanks
> Naimish
>
>
> Marc Wessely wrote:
> > >
> > > 1. where do we need to write makeRequest()?
> >
> >
> > lets say you want to write in your gadget some data from your database
> so
> > you need to call onload of the gadget
> > a function which calls makeRequest in itself.
> > you can use gadgets.util.registerOnLoadHandler for registering that
> > function.
> >
> >
> >
> > 2. Is this makeRequest() callback function part of Opensocial API or
> > > we need to write them by our own?
> >
> >
> > every opensocial function is based on callback functions, thats a
> workaround
> > to the "same origin policy" of webbrowsers.
> > so when you specify makeRequest you also have to specify a callback
> function
> > as a parameter of it.
> >
> > In that function you can retrieve the data, put it in html and paste
> that
> > html in a div-container of your gadget.
> >
> >
> >
> > 2.a And if we need to write them our own the what is the use of
> > > Opensocial APIs?
> >
> >
> > The use of opensocial api's is the ability to get social data from the
> > network you build your gadget on.
> > That network is referred as the container in terms of opensocial.
> > You can get this container as an environment-variable and check for
> existing
> > prifile fields,supported api functions and so on.
> >
> > makeRequest is no longer an opensocial function as it belongs to the
> > gadgets* namespace.
> >
> > you can have a look at api functions here:
> >
> > http://code.google.com/apis/opensocial/docs/0.7/reference/
> >
> >
> >
> > thanks
> > > Naimish
> > >
> > >
> > >
> > > Marc Wessely wrote:
> > > > Ok lets start at the gadget xml, in that you have a content section
> in
> > > which
> > > > you place html and javascript right?
> > > >
> > > > So if you want to load content in there based on contents from a
> mysql
> > > > database, you need to call makeRequest
> > > > with url of a php-file on your server in which you access certain
> mysql
> > > > tables.
> > > >
> > > > The output will be json, just put results from queries in an array ,
> and
> > > use
> > > > json_encode - then use echo and the php script will
> > > > output a json string back to the gadget.
> > > >
> > > > in the callback function of the makeRequest function which you have
> to
> > > call
> > > > you get this json by following code
> > > >
> > > > var params = {};
> > > > params[gadgets.io.RequestParameters.CONTENT_TYPE]=
> > > > gadgets.io.ContentType.JSON;
> > > > params[gadgets.io.RequestParameters.AUTHORIZATION] =
> > > > gadgets.io.AuthorizationType.SIGNED;
> > > >
> > > > gadgets.io.makeRequest("your url to php script", function (response)
> {
> > > >
> > > > var obj = response.data;
> > > > html += "<b>" + obj.myuserid + "</b>";
> > > > $('mydiv').innerHTML = html;
> > > >
> > > >  },params);
> > > >
> > > > So you get the raw data by json object and build html around,
> > > > or you user gadgets.io.ContentType.TEXT and let the php script
> output
> > > html
> > > > directly.
> > > >
> > > > Json is a very slim data transfer format, prefferable i would use
> that.
> > > >
> > > >
> > > > i hope i could clear up things for you
> > > >
> > > > regards marc.
> > > >
> > > >
> > > >
> > > > 2008/3/25, bhagat <[EMAIL PROTECTED]>:
> > > > >
> > > > >
> > > > > Hi Marc
> > > > >
> > > > > I am studying in University of Melbourne and I just want to
> rephrase
> > > > > what u say is:
> > > > > I create a function in php file which is having function
> makeRequest
> > > > > and it connect with mysql database and postit to my container
> which
> > > > > may be php or html and it is having javascript which calls that
> > > > > makeRequest function and render it to gadget, Is it correct?
> > > > >
> > > > > I am novice to javascripts and json thats why I am confused by
> your
> > > > > terminology.
> > > > >
> > > > > Thanks
> > > > > Naimish
> > > > >
> > > > > On Mar 25, 4:49 am, "Marc Wessely" <[EMAIL PROTECTED]>
> > > > > wrote:
> > > > > > Hi bhagat,
> > > > > >
> > > > > > I am working on a university project as well (university of
> rostock,
> > > > > > germany).
> > > > > > I am also using php/mysql and integrated the data i need by
> using
> > > > > > makeRequest function.
> > > > > > Means i call a php script using that function and post userid's
> then
> > > > > this
> > > > > > script will output data in json
> > > > > > which i can interpret and render in the call back function of
> > > > > > gadgets.io.makeRequest!
> > > > > >
> > > > > > i hope that gave you a clue how to solve your problem.
> > > > > >
> > > > > > marc.
> > > > > >
> > > > > > 2008/3/24, bhagat <[EMAIL PROTECTED]>:
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > > Dear Friends
> > > > > >
> > > > > > > I am working on my university project And I need to build a
> > > Academic
> > > > > > > website which can build opensocial application.
> > > > > >
> > > > > > > I have tried shindig server and try some sample examples from
> its
> > > > > > > container. I have created my website in php-mysql. And its
> > > creating
> > > > > > > user and showing friends and photos stuff like that.
> > > > > >
> > > > > > > But my dilemma is how do I integrate mySQL data to container?
> My
> > > Task
> > > > > > > is to search keywords from database and whoever(users) is
> having
> > > same
> > > > > > > keyword shold be listed on the user page.
> > > > > >
> > > > > > > I am reading thru opensocial but I havent got any clue
> where(which
> > > > > > > file) do I need to include my database connectivity so that my
> > > gadget
> > > > > > > will show users list.
> > > > > >
> > > > > > > So if any of you guys have any idea please post help or any
> > > related
> > > > > > > material please help me...
> > > > > >
> > > > > > > Thanks
> > > > > > > Naimish([EMAIL PROTECTED])- Hide quoted text -
> > > > > >
> > > > > > - Show quoted text -
> > > > > >
> > > > >
> > > >
> > >
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" group.
To post to this group, send email to opensocial-api@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to