From 7b2c04152f8cc9237a661bf3275cc3f75539abe2 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Tue, 14 Jun 2016 15:49:34 +0530 Subject: [PATCH] changed the UI calls from tomcat to apimgt gateway --- .../java/org/wso2/carbon/device/mgt/jaxrs/api/Device.java | 1 - .../main/resources/jaggeryapps/devicemgt/app/conf/config.json | 2 +- .../devicemgt/app/modules/backend-service-invoker.js | 4 ++-- .../resources/jaggeryapps/devicemgt/app/modules/constants.js | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/Device.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/Device.java index f5a1560447..0404e34757 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/Device.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/api/Device.java @@ -45,7 +45,6 @@ public interface Device { * @return Device List */ @GET - @Path("devices") @ApiOperation( consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json index db7c7f896d..af5f0e2518 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json @@ -2,7 +2,7 @@ "appContext" : "/devicemgt/", "webAgentContext" : "/devicemgt-web-agent/", "apiContext" : "api", - "httpsURL" : "https://localhost:9443", + "httpsURL" : "https://localhost:8243", "httpURL" : "%http.ip%", "httpsWebURL" : "%https.ip%", "wssURL" : "%https.ip%", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/backend-service-invoker.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/backend-service-invoker.js index 2410d54aab..02cd2ed18f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/backend-service-invoker.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/backend-service-invoker.js @@ -176,8 +176,8 @@ var backendServiceInvoker = function () { client.executeMethod(httpMethodObject); var status = httpMethodObject.getStatusCode(); if (status == 200) { - var responseContentTypeHeader = httpMethodObject.getResponseHeader(constants.CONTENT_TYPE_IDENTIFIER); - if (responseContentTypeHeader && responseContentTypeHeader.getValue() == constants.APPLICATION_ZIP) { + var responseContentDispositionHeader = httpMethodObject.getResponseHeader(constants.CONTENT_DISPOSITION_IDENTIFIER); + if (responseContentDispositionHeader) { return successCallback(httpMethodObject.getResponseBodyAsStream(), httpMethodObject.getResponseHeaders()); } else { return successCallback(httpMethodObject.getResponseBody()); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js index a8ab77a8d1..2ede7f9c2d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js @@ -61,6 +61,7 @@ var WEB_SERVICE_ADDRESSING_VERSION = 1.0; var ACCESS_TOKEN_PAIR_IDENTIFIER = "accessTokenPair"; var ENCODED_CLIENT_KEYS_IDENTIFIER = "encodedClientKey"; var CONTENT_TYPE_IDENTIFIER = "Content-Type"; +var CONTENT_DISPOSITION_IDENTIFIER = "Content-Disposition"; var APPLICATION_JSON = "application/json"; var APPLICATION_ZIP = "application/zip"; var ACCEPT_IDENTIFIER = "Accept";