Hi Kogan. Your back-end just returns data, so it doesn't "look" any
different from any other back-end code you've written. All makeRequest
does is fetch the data from the resource you specify. So if you're
intending to output results from a database query as XML, just open a
database connection, issue your query, build your Document object, and
print the serialized XML. If you've done this correctly, you should be
able to "hit" the resource in your browser and see the XML. This is
the same XML that makeRequest will see. (Note that you're not limited
to XML -- you can also return plain text and serialized JSON).

If you're still unclear, think of a web page -- we'll use http://www.google.com
as an example. What is returned to the browser when you visit
http://www.google.com? An HTML document, naturally. Now try using
makeRequest but use http://www.google.com as your endpoint and TEXT as
your content type. You should see the raw HTML returned, exactly as
you would expect.

Long story short -- you don't need anything fancy on your back-end.
Just return the XML or text that you want to process in your gadget
and makeRequest will fetch it.

- Jason

On Sep 13, 7:52 am, Kogan <[EMAIL PROTECTED]> wrote:
> Hey, thanks for the replies - I understand more or less, but I'll try
> to focus my question a bit -
>
> 1. the most important thing that I don't understand is the looks of my
> back-end server:
> HOW DOES IT WORK - "responding to requests of a Makerequest made by a
> gadget"?
>                                          "replying to it by sending
> information" ?
> is there an example of a java server that does it, lets say? that I
> can take a look at? I think that's what I need...
>
> Because we want to do, let's say - a java server (that will be our
> beck-end) that helps to manipulate and store all data
> retrieved from the user using our gadget. How is it exactly all done
> at this server?
> I took a look here-http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
>
> but it wasn't clear enough :(
>
> Thanks,
> Kogan.
>
> On Sep 13, 1:32 am, Jason <[EMAIL PROTECTED]> wrote:
>
> > You're quite right -- makeRequest is a vital function for most
> > OpenSocial applications, and a number of usage examples are available.
> > In addition to Raman's link, check out the following pages for
> > snippets demonstrating makeRequest:
>
> >http://code.google.com/p/opensocial-resources/wiki/GadgetsMakeRequest...
>
> > On your back-end, all you need is a script that accesses data from
> > your database and returns the data as XML, JSON, or plain text. Then
> > you point makeRequest at this script, specify the content type, and it
> > will retrieve the data and invoke its callback when the data is
> > available. Let me know if you have any more questions on this.
>
> > - Jason
>
> > On Sep 11, 11:09 pm, Ramanpreet Singh <[EMAIL PROTECTED]> wrote:
>
> > > HiKogan
>
> > > I am sure this will get you 
> > > started.http://code.google.com/apis/opensocial/docs/0.7/devguide.html#Remote_...
>
> > > Raman
>
> > >Koganwrote:
> > > > Hi again,
>
> > > > I have a question regarding "makeRequest" now -
> > > > I read the article about it, but I didn't quite understand it all the
> > > > way:
>
> > > > because it seems to me that this is the most important and most used
> > > > method I'll ever use (because most of the
> > > > time I'll address my DataBase, for example)  -  and I didn't find a
> > > > SIMPLE example on how to retrieve something from my DataBase do it.
> > > > I guess I need to understand better how are these asynchronous calls
> > > > handled on my back end server ?(is there a reading material about
> > > > that?) and then maybe the picture will be clearer...
>
> > > > As you can see, I need some clarifications
> > > > (maybe some of the questions above are quite trivial, sorry about that
> > > > too)
>
> > > >  :)
>
> > > > Thanks,
> > > >Kogan.
>
> > > > On Jul 29, 2:07 am, Jason <[EMAIL PROTECTED]> wrote:
>
> > > >> My reply in the thread below might help explain things a bit:
>
> > > >>http://groups.google.com/group/opensocial-orkut/browse_thread/thread/...
>
> > > >> In general, yes, you can build an OpenSocial application entirely with
> > > >> JavaScript inside a gadget (XML) wrapper. But a lot of apps have back-
> > > >> end components as well for tasks such as storing data in a database
> > > >> (although you can store data using OpenSocial's persistence API in
> > > >> JavaScript, the data size limit is small so a database is often
> > > >> necessary). These back-ends can be in any language you please
> > > >> including JSP,Java, PHP, Python, and so forth. The gadgets library
> > > >> includes a useful method, gadgets.io.makeRequest, that makes sending
> > > >> asynchronous, cross-domain requests securely to your back-end and
> > > >> retrieving XML, JSON, or plain text responses very easy.
>
> > > >>http://code.google.com/apis/opensocial/docs/0.7/reference/gadgets.io....
>
> > > >> In summary, a back-end component is completely optional but highly
> > > >> useful, and the gadgets library makes it easy to communicate with your
> > > >> back-end from your client-side code. Please let me know if you have
> > > >> any questions on this.
>
> > > >> - Jason
>
> > > >> On Jul 26, 7:24 am,Kogan<[EMAIL PROTECTED]> wrote:
>
> > > >>> Basically, I'm a bit new to Web-Programming in general.
>
> > > >>> I did read a lot of material about open-social, and Google gadgets,
> > > >>> intending to write an application for Orkut.
> > > >>> But, one thing I don't understand - which Technologies can I use for
> > > >>> this purpose?
>
> > > >>> According to what I've read, a gadget is a simple xml file, usingjava
> > > >>> script and Open Social API. and That's it. (?)
>
> > > >>> But, an application might consist of a Data Base to manage, the
> > > >>> communication with the user of the application, etc...
> > > >>> Canjavascript support all these needs?
> > > >>> I don't need things such as ASP.net (for the database), JSP,Java, PHP
> > > >>> etc... (things that one mentioned to me when I told him about the
> > > >>> idea)
>
> > > >>> Really appreciate if someone could clarify the subject for me and/or
> > > >>> direct me to a reading material?
>
> > > >>> Thanks you :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@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-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to