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
 String encodeValues(com.google.gwt.core.client.JavaScriptObject jso)
          Converts an input object into a URL-encoded data string (key=value&...).
 String getProxyUrl(String url)
          Returns a proxy URL that can be used to access a given URL.
 String getProxyUrl(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(String url, ResponseReceivedHandler<Object> handler)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 void makeRequest(String url, ResponseReceivedHandler<Object> handler, RequestOptions options)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 void makeRequestAsDom(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(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(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(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(String url, ResponseReceivedHandler<String> handler)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 void makeRequestAsText(String url, ResponseReceivedHandler<String> handler, RequestOptions options)
          Makes the HTTP request and invokes the ResponseReceivedHandler.onResponseReceived(ResponseReceivedEvent) method with the received response.
 

Method Detail

encodeValues

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

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


getProxyUrl

String getProxyUrl(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(String url,
                 ResponseReceivedHandler<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(String url,
                 ResponseReceivedHandler<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(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(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(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(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(String url,
                       ResponseReceivedHandler<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(String url,
                       ResponseReceivedHandler<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


Copyright © 2014. All rights reserved.