5 Replies Latest reply on Mar 7, 2012 12:32 AM by cliffm

    Does GateIn support Google Gadgets?

    cliffm

      From what I have been able to find GateIn includes Apache Shindig for handling gadgets, and Shindig appears to only support OpenSocial gadgets. I am wondering if Google Gadgets are supported at all.

       

      Specifically I am trying to use gadgets.io.makeRequest and it doesn't seem to be working. I am trying to figure out if it is something I am doing wrong or if the container just doesn't support it.

        • 1. Re: Does GateIn support Google Gadgets?
          kien_nguyen

          From what I have been able to find GateIn includes Apache Shindig for handling gadgets, and Shindig appears to only support OpenSocial gadgets. I am wondering if Google Gadgets are supported at all.

          Yes, if you are using specific features of Google like "google-domain", "finance", etc and it doesn't work with GateIn.

           

           

          Specifically I am trying to use gadgets.io.makeRequest and it doesn't seem to be working. I am trying to figure out if it is something I am doing wrong or if the container just doesn't support it.

          The method gadgets.io.makeRequest, it's a core feature of OpenSocial gadget and it's working well in GateIn. Please give me your code to find something wrong

          • 2. Re: Does GateIn support Google Gadgets?
            cliffm

            When I try to use the built-in method for fetching remote content, gadgets.io.makeRequest, it doesn't work. I am trying to fetch json content from a java servelet (or even a flat file with the same content). The XML tab in firebug reports an XML error:

             

            XML Parsing Error: no element found Location: moz-nullprincipal:{7e9eab45-2f73-476d-9bdb-2370d1534f29} Line Number 1, Column 1:

            ^

             

            If I instead use jquery, substituting $.get for gadgets.io.makeRequest, it works beautifully.

             

            I basically do the same prescribed in the example here:

             

            http://code.google.com/apis/gadgets/docs/remote-content.html#Fetch_JSON

             

            After searching forums, I found some suggestions to also set gadgets.io.RequestParameters.REFRESH_INTERVAL, but I tried that too and it does nothing.

             

            basically, I have three things:

             

            function makeJSONRequest() {   

                  var params = {};

                  params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.JSON;

                  var url = "some java servlet that returns json";

                  gadgets.io.makeRequest(url, response, params);

            };

             

            function response(obj) {

                alert("Called response!");

                alert(obj.data);

            }

             

            gadgets.util.registerOnLoadHandler(makeJSONRequest);

             

            response is called, but obj.data is not present or populated. Also, it seems that the call to makeRequest is not actually calling the servlet, because the servlet usually takes 2-3 seconds if I call it directly, but in this example the response alert fires immediately.

            • 3. Re: Does GateIn support Google Gadgets?
              kien_nguyen

              As I see, please check your java servlet, is it response in JSON content type?

              • 4. Re: Does GateIn support Google Gadgets?
                cliffm

                Yes, it is. I specifically set it.

                 

                I have tried fetching other things and playing with the content type, like css files as TEXT and so on.

                • 5. Re: Does GateIn support Google Gadgets?
                  cliffm

                  The problem turned out to be HTTPS mode. There is a js file that uses http for all ajax requests, which doesn't work due to XSS security concerns. I edited the file to hardcode https, which works for our case. I think I read a Jira bug about this, and I think it supposed to be fixed in 3.2.