Google.Shortener class - geosolutions-it/MapStore GitHub Wiki
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.
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.
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