From a0b9152f19c4f8dbd925635129d75af9785a1d4a Mon Sep 17 00:00:00 2001 From: "Christopher Lott (cl778h)" Date: Mon, 31 Jul 2017 18:20:49 -0400 Subject: Repair widget micro service, onboarding of widgets Issue: PORTAL-30, PORTAL-40, PORTAL-45, PORTAL-46, PORTAL-47 Change-Id: I97de4cc038f7167d5e368249f9ea5e47e8fc1b09 Signed-off-by: Christopher Lott (cl778h) --- .../portal/service/ApplicationsRestClientServiceImpl.java | 7 ++++++- .../org/openecomp/portalapp/portal/transport/OnboardingApp.java | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'ecomp-portal-BE-os/src/main/java') diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java index 4626b17b..f3fda34e 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/service/ApplicationsRestClientServiceImpl.java @@ -48,6 +48,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.EnableAspectJAutoProxy; import org.springframework.stereotype.Service; +import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonDeserializationContext; @@ -71,6 +72,8 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient private AppsCacheService appsCacheService; Gson gson = null; + private final ObjectMapper mapper = new ObjectMapper(); + @PostConstruct private void init(){ logger.debug(EELFLoggerDelegate.debugLogger, "initializing"); @@ -185,7 +188,9 @@ public class ApplicationsRestClientServiceImpl implements ApplicationsRestClient verifyResponse(response); String str = response.readEntity(String.class); EcompPortalUtils.logAndSerializeObject(restPath, "GET result =", str); - try { t = gson.fromJson(str, clazz); } catch(Exception e) { + try { + t = mapper.readValue(str, clazz); + } catch(Exception e) { logger.error(EELFLoggerDelegate.errorLogger, EcompPortalUtils.getStackTrace(e)); EPLogUtil.logEcompError(EPAppMessagesEnum.BeInvalidJsonInput); } diff --git a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java index 4c97a52d..f953634a 100644 --- a/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java +++ b/ecomp-portal-BE-os/src/main/java/org/openecomp/portalapp/portal/transport/OnboardingApp.java @@ -26,6 +26,8 @@ public class OnboardingApp { public String name; public String imageUrl; + + public String imageLink; public String description; -- cgit 1.2.3-korg