patched the shortening phase

This commit is contained in:
Francesco Mangiacrapa 2020-12-02 12:36:05 +01:00
parent 8295b605c3
commit 066ee6a344
1 changed files with 12 additions and 2 deletions

View File

@ -53,7 +53,12 @@ public class GeoportalCommon {
GeoportalCommonConstants.GET_GEONA_ITEM_ID, item.getItemId(),
GeoportalCommonConstants.GET_GEONA_ITEM_TYPE, item.getItemType());
String shortUrl = getShortUrl(link);
String shortUrl = link;
try {
shortUrl = getShortUrl(link);
}catch (Exception e) {
LOG.warn("Error on shortening the URL: ",e);
}
item.setRestrictedLink(new PublicLink(link, shortUrl));
// Open Link
@ -61,7 +66,12 @@ public class GeoportalCommon {
GeoportalCommonConstants.GET_GEONA_ITEM_ID, item.getItemId(),
GeoportalCommonConstants.GET_GEONA_ITEM_TYPE, item.getItemType());
shortUrl = getShortUrl(link);
shortUrl = link;
try {
shortUrl = getShortUrl(link);
}catch (Exception e) {
LOG.warn("Error on shortening the URL: ",e);
}
item.setOpenLink(new PublicLink(link, shortUrl));
LOG.info("returning: " + item);