From c86c976fe6ca2d0e8b534b7efc441713c7e529b7 Mon Sep 17 00:00:00 2001 From: lasantha Date: Sun, 4 Mar 2018 23:53:47 +0530 Subject: [PATCH 1/5] Format the source of geofence --- .../app/units/cdmf.unit.geo-dashboard/geo-dashboard.js | 9 ++++----- .../units/cdmf.unit.geo-dashboard/public/js/websocket.js | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js index 1fcfd20d1cf..de15fc40e46 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.js @@ -17,7 +17,6 @@ */ function onRequest(context) { - var log = new Log("geo-dashboard.js"); var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var viewModel = {}; @@ -41,14 +40,14 @@ function onRequest(context) { wsEndpoint = devicemgtProps["wssURL"].replace("https", "wss") + "/secured-websocket/"; } } else { - tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + context.user.domain,"default", {}); + tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username + "@" + + context.user.domain, "default", {}); if (tokenPair) { token = tokenPair.accessToken; - wsEndpoint = devicemgtProps["wssURL"].replace("https", "wss") + "/secured-websocket/t/"+context.user.domain+"/"; + wsEndpoint = devicemgtProps["wssURL"].replace("https", "wss") + "/secured-websocket/t/" + + context.user.domain + "/"; } - } - } viewModel.device = device; viewModel.wsToken = token; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js index 027de4459f2..dcc0b7d5cbd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/websocket.js @@ -561,7 +561,7 @@ var webSocketOnAlertMessage = function processMessage(message) { var json = $.parseJSON(message.data); if (json.messageType == "Alert") { processAlertMessage(json); - }else { + } else { console.log("Message type not supported."); } } From 1d53023fdc66731eb25b7596726a500207339e86 Mon Sep 17 00:00:00 2001 From: lasantha Date: Mon, 5 Mar 2018 00:15:38 +0530 Subject: [PATCH 2/5] Fix the issue in certificate-mgt-v0.9 copyright text --- .../pom.xml | 2 +- .../mgt/jaxrs/api/CertificateMgtService.java | 2 +- .../mgt/jaxrs/api/common/ErrorHandler.java | 2 +- .../mgt/jaxrs/api/common/ErrorMessage.java | 2 +- .../api/common/GsonMessageBodyHandler.java | 2 +- .../mgt/jaxrs/api/common/MDMAPIException.java | 2 +- .../api/impl/CertificateMgtServiceImpl.java | 18 ++++++++++++++++++ .../mgt/jaxrs/api/util/ResponsePayload.java | 2 +- .../mgt/jaxrs/beans/ErrorListItem.java | 2 +- .../mgt/jaxrs/beans/ErrorResponse.java | 2 +- .../jaxrs/exception/BadRequestException.java | 2 +- .../mgt/jaxrs/exception/Message.java | 2 +- .../UnexpectedServerErrorException.java | 2 +- .../src/main/webapp/META-INF/permissions.xml | 2 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 2 +- .../src/main/webapp/WEB-INF/web.xml | 2 +- 17 files changed, 34 insertions(+), 16 deletions(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml index 1edd8e981e6..ba01ff23bac 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/pom.xml @@ -1,7 +1,7 @@ + Admin-Webapp diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java index efd573b11f6..05bd490a854 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java @@ -15,6 +15,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.wso2.carbon.device.mgt.jaxrs.service.impl; import org.apache.axis2.AxisFault; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java index 9629afb07ab..09680a9d9e2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceTypeManagementServiceTest.java @@ -15,6 +15,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.wso2.carbon.device.mgt.jaxrs.service.impl; import org.apache.commons.logging.Log; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java index be7209a8e96..bbeeea1dd6f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java @@ -1,3 +1,22 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ + package org.wso2.carbon.device.mgt.jaxrs.service.impl; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/DeviceMgtAPITestHelper.java b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/DeviceMgtAPITestHelper.java index f1f0d1628df..884f67923f1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/DeviceMgtAPITestHelper.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/util/DeviceMgtAPITestHelper.java @@ -15,6 +15,7 @@ * specific language governing permissions and limitations * under the License. */ + package org.wso2.carbon.device.mgt.jaxrs.service.impl.util; import org.wso2.carbon.device.mgt.common.Device; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/resources/log4j.properties b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/resources/log4j.properties index e415fd607d3..90c5d0edce0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/resources/log4j.properties +++ b/components/device-mgt/org.wso2.carbon.device.mgt.v09.api/src/test/resources/log4j.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +# Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. # # WSO2 Inc. licenses this file to you under the Apache License, # Version 2.0 (the "License"); you may not use this file except From e30ce5bcbda6caa6001e8af139d845116f18e141 Mon Sep 17 00:00:00 2001 From: lasantha Date: Mon, 5 Mar 2018 10:59:29 +0530 Subject: [PATCH 4/5] Format certificate-mgt-v0.9 source --- .../certificate/mgt/cert/jaxrs/api/beans/CertificateList.java | 4 ++-- .../carbon/certificate/mgt/jaxrs/beans/ErrorListItem.java | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/beans/CertificateList.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/beans/CertificateList.java index 2c61a4b23a0..feef40b873a 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/beans/CertificateList.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/beans/CertificateList.java @@ -16,6 +16,7 @@ * under the License. * */ + package org.wso2.carbon.certificate.mgt.cert.jaxrs.api.beans; import com.fasterxml.jackson.annotation.JsonProperty; @@ -43,7 +44,6 @@ public class CertificateList extends BasePaginatedResult { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{\n"); - sb.append(" count: ").append(getCount()).append(",\n"); sb.append(" next: ").append(getNext()).append(",\n"); sb.append(" previous: ").append(getPrevious()).append(",\n"); @@ -51,5 +51,5 @@ public class CertificateList extends BasePaginatedResult { sb.append("]}\n"); return sb.toString(); } - } + diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/src/main/java/org/wso2/carbon/certificate/mgt/jaxrs/beans/ErrorListItem.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/src/main/java/org/wso2/carbon/certificate/mgt/jaxrs/beans/ErrorListItem.java index 735f3e837d9..4b713af92bd 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/src/main/java/org/wso2/carbon/certificate/mgt/jaxrs/beans/ErrorListItem.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.v09.api/src/main/java/org/wso2/carbon/certificate/mgt/jaxrs/beans/ErrorListItem.java @@ -16,6 +16,7 @@ * under the License. * */ + package org.wso2.carbon.certificate.mgt.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; @@ -69,11 +70,9 @@ public class ErrorListItem { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("errorItem {\n"); - sb.append(" code: ").append(code).append("\n"); sb.append(" message: ").append(message).append("\n"); sb.append("}\n"); return sb.toString(); } - } From 0aef14bdbe19e89e871835d75430f3692595bcb5 Mon Sep 17 00:00:00 2001 From: lasantha Date: Mon, 5 Mar 2018 11:07:03 +0530 Subject: [PATCH 5/5] Fix the issue in certificate-mgt-admin-v0.9 copyright text --- .../org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml | 2 +- .../mgt/cert/jaxrs/api/CertificateManagementAdminService.java | 2 +- .../mgt/cert/jaxrs/api/InputValidationException.java | 2 +- .../mgt/cert/jaxrs/api/UnexpectedServerErrorException.java | 2 +- .../mgt/cert/jaxrs/api/beans/BasePaginatedResult.java | 3 ++- .../certificate/mgt/cert/jaxrs/api/beans/CertificateList.java | 2 +- .../mgt/cert/jaxrs/api/beans/EnrollmentCertificate.java | 2 +- .../certificate/mgt/cert/jaxrs/api/beans/ErrorListItem.java | 3 ++- .../certificate/mgt/cert/jaxrs/api/beans/ErrorResponse.java | 3 ++- .../mgt/cert/jaxrs/api/beans/ValidationResponse.java | 1 - .../certificate/mgt/cert/jaxrs/api/common/ErrorHandler.java | 2 +- .../certificate/mgt/cert/jaxrs/api/common/ErrorMessage.java | 2 +- .../mgt/cert/jaxrs/api/common/GsonMessageBodyHandler.java | 2 +- .../certificate/mgt/cert/jaxrs/api/common/MDMAPIException.java | 2 +- .../mgt/cert/jaxrs/api/exception/BadRequestException.java | 2 +- .../certificate/mgt/cert/jaxrs/api/exception/Message.java | 2 +- .../api/swagger/extension/SecurityDefinitionConfigurator.java | 3 ++- .../certificate/mgt/cert/jaxrs/api/util/ApiOriginFilter.java | 3 ++- .../mgt/cert/jaxrs/api/util/CertificateMgtAPIUtils.java | 2 +- .../mgt/cert/jaxrs/api/util/RequestValidationUtil.java | 3 ++- .../certificate/mgt/cert/jaxrs/api/util/ResponsePayload.java | 2 +- .../src/main/webapp/META-INF/permissions.xml | 2 +- .../src/main/webapp/META-INF/webapp-classloading.xml | 2 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 2 +- .../src/main/webapp/WEB-INF/web.xml | 2 +- 25 files changed, 30 insertions(+), 25 deletions(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml index b2f9855d23d..d8f7f20a35c 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.v09.api/pom.xml @@ -1,7 +1,7 @@