Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Google.Shortener class

ricardocb edited this page Oct 9, 2012 · 12 revisions

WARNING: don't use this class because of a related pending issue.

Class: Google.Shortener

location: MSMUtil.js

requires: Ext Js

Access Google service to shorten urls. See also Google Documentation.

Cross browser calls

This component makes cross browser calls because it relies on an external rest service. The current implementation uses the HttpProxy developed by GeoSolutions. Hence, you need to add Google url to proxy config file proxy.properties.

  • Add www.googleapis.com to hostnameWhitelist,
  • Add (.google.) (or another regexp) to reqtypeWhitelist.fdh,
  • Redeploy http_proxy, if necessary.

Usage examples

var shortener = new Google.Shortener({ 
		    appid: /* PUT HERE YOUR GOOGLE API KEY */ 
		}).failure(function(response){
	           /* CALLBACK METHOD IF SOMETHING WENT WRONG */
	        });
		});
                // async method to shorten urls
		shortener.shorten(
		     /* YOUR VERY LONG URL */,
		     function(response){
		         /* response.id  contains your short URL */
		     });

Correction Proposal on issue:

Aparently the problem is on SSLException, http_proxy, in JDK 1.6 and since is not possible to update do JDK 1.7 the proposed correction should be:

  • Check if there is any workaround over the SSL validation and use it mantaining the SSL validation

or

  • Try to override the SSL validation in order to bypass the SSL validation
Clone this wiki locally