com.google.gwt.gadgets.client.io
Interface GadgetsIo


public interface GadgetsIo

Provides access to the gadgets.io APIs provided by the container. For GadgetsIo implementation, use IoProvider.get().


Method Summary
 java.lang.String encodeValues(com.google.gwt.core.client.JavaScriptObject jso)
          Converts an input object into a URL-encoded data string (key=value&...).
 java.lang.String getProxyUrl(java.lang.String url)
          Returns a proxy URL that can be used to access a given URL.
 java.lang.String getProxyUrl(java.lang.String url, int refreshIntervalSeconds)
          Returns a proxy URL that can be used to access a given URL with a specified refresh interval specified in seconds.
 void makeRequest(java.lang.String url, ResponseReceivedHandler<java.lang.Object> handler)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 void makeRequest(java.lang.String url, ResponseReceivedHandler<java.lang.Object> handler, RequestOptions options)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 void makeRequestAsDom(java.lang.String url, ResponseReceivedHandler<com.google.gwt.dom.client.ObjectElement> handler)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 void makeRequestAsDom(java.lang.String url, ResponseReceivedHandler<com.google.gwt.dom.client.ObjectElement> handler, RequestOptions options)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 void makeRequestAsJso(java.lang.String url, ResponseReceivedHandler<? extends com.google.gwt.core.client.JavaScriptObject> handler)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 void makeRequestAsJso(java.lang.String url, ResponseReceivedHandler<? extends com.google.gwt.core.client.JavaScriptObject> handler, RequestOptions options)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 void makeRequestAsText(java.lang.String url, ResponseReceivedHandler<java.lang.String> handler)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 void makeRequestAsText(java.lang.String url, ResponseReceivedHandler<java.lang.String> handler, RequestOptions options)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 

Method Detail

encodeValues

java.lang.String encodeValues(com.google.gwt.core.client.JavaScriptObject jso)
Converts an input object into a URL-encoded data string (key=value&...). This method is particularly useful when used with RequestOptions.setPostData(String) for creating POST requests.

Parameters:
jso - JavaScript object to convert
Returns:
result of conversion

getProxyUrl

java.lang.String getProxyUrl(java.lang.String url)
Returns a proxy URL that can be used to access a given URL.


getProxyUrl

java.lang.String getProxyUrl(java.lang.String url,
                             int refreshIntervalSeconds)
Returns a proxy URL that can be used to access a given URL with a specified refresh interval specified in seconds.


makeRequest

void makeRequest(java.lang.String url,
                 ResponseReceivedHandler<java.lang.Object> handler)
Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response. The fetched content is cached on the Gadget Container.

Parameters:
url - the URL for the request
handler - the ResponseReceivedHandler instance to handle the response

makeRequest

void makeRequest(java.lang.String url,
                 ResponseReceivedHandler<java.lang.Object> handler,
                 RequestOptions options)
Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response. The fetched content is cached on the Gadget Container.

Parameters:
url - the URL for the request
handler - the ResponseReceivedHandler instance to handle the response
options - options for this request

makeRequestAsDom

void makeRequestAsDom(java.lang.String url,
                      ResponseReceivedHandler<com.google.gwt.dom.client.ObjectElement> handler)
Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response. This method can be used for fetching XML data, which is parsed into a DOM document. The fetched content is cached on the Gadget Container.

Parameters:
url - the URL for the request
handler - the ResponseReceivedHandler instance to handle the response

makeRequestAsDom

void makeRequestAsDom(java.lang.String url,
                      ResponseReceivedHandler<com.google.gwt.dom.client.ObjectElement> handler,
                      RequestOptions options)
Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response. This method can be used for fetching XML data, which is parsed into a DOM document. The fetched content is cached on the Gadget Container.

Parameters:
url - the URL for the request
handler - the ResponseReceivedHandler instance to handle the response
options - options for this request

makeRequestAsJso

void makeRequestAsJso(java.lang.String url,
                      ResponseReceivedHandler<? extends com.google.gwt.core.client.JavaScriptObject> handler)
Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response. This method can be used for fetching JSON data, which is parsed into a JavaScriptObject instance or it's subclass. The fetched content is cached on the Gadget Container.

Parameters:
url - the URL for the request
handler - the ResponseReceivedHandler instance to handle the response

makeRequestAsJso

void makeRequestAsJso(java.lang.String url,
                      ResponseReceivedHandler<? extends com.google.gwt.core.client.JavaScriptObject> handler,
                      RequestOptions options)
Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response. This method can be used for fetching JSON data, which is parsed into a JavaScriptObject instance or it's subclass. The fetched content is cached on the Gadget Container.

Parameters:
url - the URL for the request
handler - the ResponseReceivedHandler instance to handle the response
options - options for this request

makeRequestAsText

void makeRequestAsText(java.lang.String url,
                       ResponseReceivedHandler<java.lang.String> handler)
Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response. This method can be used for fetching any text data. The fetched content is cached on the Gadget Container.

Parameters:
url - the URL for the request
handler - the ResponseReceivedHandler instance to handle the response

makeRequestAsText

void makeRequestAsText(java.lang.String url,
                       ResponseReceivedHandler<java.lang.String> handler,
                       RequestOptions options)
Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response. This method can be used for fetching any text data. The fetched content is cached on the Gadget Container.

Parameters:
url - the URL for the request
handler - the ResponseReceivedHandler instance to handle the response
options - options for this request