
com.google.gwt.gadgets.client.io.GadgetsIo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of crux-gadgets Show documentation
Show all versions of crux-gadgets Show documentation
This is the Crux Gadgets project
The newest version!
/*
* Copyright 2010 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.gwt.gadgets.client.io;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.dom.client.ObjectElement;
import com.google.gwt.gadgets.client.io.ResponseReceivedHandler.ResponseReceivedEvent;
/**
* Provides access to the gadgets.io APIs provided by the container.
*
* For {@link GadgetsIo} implementation, use {@link IoProvider#get()}.
*/
public interface GadgetsIo {
/**
* Converts an input object into a URL-encoded data string (key=value&...).
* This method is particularly useful when used with
* {@link RequestOptions#setPostData(String)} for creating POST requests.
*
* @param jso JavaScript object to convert
* @return result of conversion
*/
public String encodeValues(JavaScriptObject jso);
/**
* Returns a proxy URL that can be used to access a given URL.
*/
public String getProxyUrl(String url);
/**
* Returns a proxy URL that can be used to access a given URL with a specified
* refresh interval specified in seconds.
*/
public String getProxyUrl(String url, int refreshIntervalSeconds);
/**
* Makes the HTTP request and invokes the
* {@link ResponseReceivedHandler#onResponseReceived(ResponseReceivedEvent)}
* method with the received response. The fetched content is cached on the
* Gadget Container.
*
* @param url the URL for the request
* @param handler the {@link ResponseReceivedHandler} instance to handle the
* response
*/
public void makeRequest(final String url,
final ResponseReceivedHandler
© 2015 - 2025 Weber Informatics LLC | Privacy Policy