diff --git a/.gitignore b/.gitignore index 9c3d08d3c0..379d4a33ff 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ target *.class +*.swp # Mobile Tools for Java (J2ME) .mtj.tmp/ diff --git a/.pom.xml.swp b/.pom.xml.swp deleted file mode 100644 index f89e01a40f..0000000000 Binary files a/.pom.xml.swp and /dev/null differ diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml index 7d3c453bec..04a5e4edb7 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.annotations - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT bundle WSO2 Carbon - API Management Annotations WSO2 Carbon - API Management Custom Annotation Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index 55bb6e6954..c61f0e8057 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -21,12 +21,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml 4.0.0 - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT org.wso2.carbon.apimgt.application.extension.api war WSO2 Carbon - API Application Management API diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index f09394b10a..e1d0b13371 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -22,12 +22,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml 4.0.0 - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT org.wso2.carbon.apimgt.application.extension bundle WSO2 Carbon - API Application Management diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml index c5643a79d2..97b660a796 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml @@ -21,13 +21,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handlers - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT bundle WSO2 Carbon - API Security Handler Component WSO2 Carbon - API Management Security Handler Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index 1583ad9b4e..1933751bb1 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -13,13 +13,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.client - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT bundle WSO2 Carbon - API Management Integration Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml index cac2f018cc..a390494f46 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml @@ -13,13 +13,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.generated.client - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT bundle WSO2 Carbon - API Management Integration Generated Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index 181fff3137..21a98e048b 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT bundle WSO2 Carbon - API Management Webapp Publisher WSO2 Carbon - API Management Webapp Publisher diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index 6e3ff7f438..0c6a367afa 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../../pom.xml 4.0.0 apimgt-extensions - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT pom WSO2 Carbon - API Management Extensions Component http://wso2.org diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index cf31dde95d..86851338c2 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index 7ef343ce0f..eee37613fb 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index bb18348832..fc800504ae 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt certificate-mgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.core - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT bundle WSO2 Carbon - Certificate Management Core WSO2 Carbon - Certificate Management Core diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml index d3918eb005..2fdec18651 100644 --- a/components/certificate-mgt/pom.xml +++ b/components/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT pom WSO2 Carbon - Certificate Management Component http://wso2.org diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml index a56e9917f6..7dbe687b51 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml index 8f4e7ef1d0..2389cd22e6 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml index 2194f196a6..755a6afcc1 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml index ba7ebb696c..8162068848 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index 5d3342cc58..a5db8ce00d 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index d79462bb7a..a646d904d1 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml index c54b7998b1..2b80f5535d 100644 --- a/components/device-mgt-extensions/pom.xml +++ b/components/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml index d5b51f9142..724d5c595c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml @@ -3,7 +3,7 @@ org.wso2.carbon.devicemgt device-mgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index a9bab4fb56..b9d17fb439 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index 0f4c9059c3..d4cf4d45ce 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index d146550499..856b944fe2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -21,7 +21,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index dace22b907..18d7eaac01 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql index 7f391b530b..0b93582f3a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Exit_alert.siddhiql @@ -18,3 +18,6 @@ insert into dataOut; from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=false and id == "$deviceId"] select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information insert into dataOut; +from dataIn[id != "$deviceId"] +select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information +insert into dataOut; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql index 65dad468d5..93c7ca622f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Speed_alert.siddhiql @@ -18,3 +18,6 @@ insert into dataOut; from dataIn[speed < $speedAlertValue and id == "$deviceId"] select id , latitude, longitude,timeStamp, type ,speed, heading ,eventId , "NORMAL" as state, "This device movement is normal" as information insert into dataOut; +from dataIn[id != "$deviceId"] +select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information +insert into dataOut; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql index b58fd59e33..78db10a679 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/resources/alerts/Geo-ExecutionPlan-Within_alert.siddhiql @@ -18,3 +18,6 @@ insert into dataOut; from dataIn[geo:within(longitude,latitude,"$geoFenceGeoJSON")!=true and id == "$deviceId"] select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information insert into dataOut; +from dataIn[id != "$deviceId"] +select id , latitude, longitude,timeStamp, type, speed, heading ,eventId , "NORMAL" as state, "" as information +insert into dataOut; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index aaf1d86582..d787fba418 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml index 467017acbe..7499183ce9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 3.0.63-SNAPSHOT + 3.0.71-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js index cfde7134b6..5f8462a795 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-protected-service-invokers.js @@ -116,6 +116,11 @@ var invokers = function () { log.debug("Request payload if any : " + stringify(requestPayload)); log.debug("Response status : " + xmlHttpRequest.status); log.debug("Response payload if any : " + xmlHttpRequest.responseText); + if (devicemgtProps["isCloud"]) { + log.info("Request : " + httpMethod + " " + endpoint); + log.info("Request payload if any : " + stringify(requestPayload)); + log.info("Response status : " + xmlHttpRequest.status); + } if (xmlHttpRequest.status == 401) { if ((xmlHttpRequest.responseText == TOKEN_EXPIRED || diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/css/main.css b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/css/main.css index 88fbe99a41..60d195c471 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/css/main.css +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/css/main.css @@ -128,7 +128,7 @@ cursor: pointer; position: relative; margin-left: 10px; - ma + margin-bottom: 10px; } .tab-actions .action{ float: right; 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.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs index eb788c4a81..49f4e02bad 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/geo-dashboard.hbs @@ -764,7 +764,7 @@ stationaryAlert.addClass("geo-alert"); var withinAlert = createGeoToolListItem(geoPublicUri + '/assets/html_templates/modal/within_alert.html', - 'Add Geofence Alert', 'glyphicon glyphicon-log-in', geoToolsMenu); + 'Add Geofence Enter Alert', 'glyphicon glyphicon-log-in', geoToolsMenu); withinAlert.addClass("geo-alert"); var exitAlert = createGeoToolListItem(geoPublicUri + '/assets/html_templates/modal/exit_alert.html', 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 f35db76fee..f18b117259 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,30 +17,38 @@ */ function onRequest(context) { + var log = new Log("geo-dashboard.js"); var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var viewModel = {}; - var carbonServer = require("carbon").server; var device = context.unit.params.device; - var constants = require("/app/modules/constants.js"); - var wsEndpoint = devicemgtProps["wssURL"].replace("https", "wss") + "/secured-websocket/t/"; - var spatialWSEndpoint = devicemgtProps["wssURL"].replace("https", "wss"); - var alertsWSEndpoint = devicemgtProps["wssURL"].replace("https", "wss"); - + var wsEndpoint = null; var jwtService = carbonServer.osgiService( 'org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService'); var jwtClient = jwtService.getJWTClient(); var encodedClientKeys = session.get(constants["ENCODED_TENANT_BASED_WEB_SOCKET_CLIENT_CREDENTIALS"]); + var tokenPair = null; var token = ""; if (encodedClientKeys) { var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"]; var resp = tokenUtil.decode(encodedClientKeys).split(":"); - var tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username, "default", {}); - if (tokenPair) { - token = tokenPair.accessToken; + if (context.user.domain == "carbon.super") { + tokenPair = jwtClient.getAccessToken(resp[0], resp[1], context.user.username,"default", {}); + if (tokenPair) { + token = tokenPair.accessToken; + wsEndpoint = devicemgtProps["wssURL"].replace("https", "wss") + "/secured-websocket/"; + } + } else { + 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+"/"; + } + } + } 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/geo_remote.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js index 05f78606c5..4f7aa8bfca 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.geo-dashboard/public/js/geo_remote.js @@ -264,6 +264,7 @@ function setWithinAlert(leafletId) { } else { var ptrn = /(?:)(.*)(?:<\/am\:description>)/g; var errorTxt; + var result = (ptrn.exec(data)); if (result) { errorTxt = result.length > 1 ? result[1] : data; } else { @@ -320,6 +321,7 @@ function setExitAlert(leafletId) { } else { var ptrn = /(?:)(.*)(?:<\/am\:description>)/g; var errorTxt; + var result = (ptrn.exec(data)); if (result) { errorTxt = result.length > 1 ? result[1] : data; } else { @@ -391,6 +393,7 @@ function setStationeryAlert(leafletId) { } else { var ptrn = /(?:)(.*)(?:<\/am\:description>)/g; var errorTxt; + var result = (ptrn.exec(data)); if (result) { errorTxt = result.length > 1 ? result[1] : data; } else { @@ -499,6 +502,7 @@ function setTrafficAlert(leafletId) { } else { var ptrn = /(?:)(.*)(?:<\/am\:description>)/g; var errorTxt; + var result = (ptrn.exec(data)); if (result) { errorTxt = result.length > 1 ? result[1] : data; } else { @@ -603,6 +607,7 @@ function setProximityAlert() { } else { var ptrn = /(?:)(.*)(?:<\/am\:description>)/g; var errorTxt; + var result = (ptrn.exec(data)); if (result) { errorTxt = result.length > 1 ? result[1] : data; } else { 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 ffa49ac0e2..fbecf66217 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 @@ -46,6 +46,65 @@ function processPointMessage(geoJsonFeature) { } } +window.onbeforeunload = function () { + disconnect(); +}; + +function initializeSpatialStreamWebSocket() { + spatialWebsocket = new WebSocket(webSocketURL); + spatialWebsocket.onopen = webSocketSpatialOnOpen; + spatialWebsocket.onmessage = webSocketSpatialOnMessage; + spatialWebsocket.onclose = webSocketSpatialOnClose; + spatialWebsocket.onerror = webSocketSpatialOnError; +} + +function initializeOnAlertWebSocket() { + onAlertWebsocket = new WebSocket(alertWebSocketURL); + onAlertWebsocket.onmessage = webSocketOnAlertMessage; + onAlertWebsocket.onclose = webSocketOnAlertClose; + onAlertWebsocket.onerror = webSocketOnAlertError; + onAlertWebsocket.onopen = webSocketOnAlertOpen; +} + +function initializeGeoLocation(geoFencingEnabled) { + var deviceDetails = $(".device-id"); + deviceId = deviceDetails.data("deviceid"); + deviceType = deviceDetails.data("type"); + if (deviceId && deviceType) { + var geoCharts = $("#geo-charts"); + var wsEndPoint = geoCharts.data("ws-endpoint"); + wsToken = geoCharts.data("ws-token"); + geoPublicUri = geoCharts.data("geo-public-uri"); + geoPublicUri = geoCharts.data("geo-public-uri"); + webSocketURL = wsEndPoint + "iot.per.device.stream.geo.FusedSpatialEvent/1.0.0?" + + "deviceId=" + deviceId + "&deviceType=" + deviceType + "&websocketToken=" + wsToken; + alertWebSocketURL = wsEndPoint + "iot.per.device.stream.geo.AlertsNotifications/1.0.0?" + + "deviceId=" + deviceId + "&deviceType=" + deviceType + "&websocketToken=" + wsToken; + $("#proximity_alert").hide(); + + if (geoFencingEnabled) { + disconnect(); + initializeSpatialStreamWebSocket(); + initializeOnAlertWebSocket(); + } + initialLoad(geoFencingEnabled); + InitSpatialObject(geoFencingEnabled); + + } else { + noty({text: 'Invalid Access! No device information provided to track!', type: 'error'}); + } +} + +function disconnect(){ + if (spatialWebsocket && spatialWebsocket.readyState == spatialWebsocket.OPEN){ + spatialWebsocket.close(); + } + + if (onAlertWebsocket && onAlertWebsocket.readyState == onAlertWebsocket.OPEN){ + onAlertWebsocket.close(); + } +} + function SpatialObject(json) { this.id = json.id; this.type = json.properties.type; @@ -175,7 +234,6 @@ SpatialObject.prototype.removeFromMap = function () { function clearMap() { for (var spacialObject in currentSpatialObjects) { - console.log(spacialObject); currentSpatialObjects[spacialObject].removePath(); currentSpatialObjects[spacialObject].removeFromMap(); } @@ -199,7 +257,6 @@ SpatialObject.prototype.createLineStringFeature = function (state, information, SpatialObject.prototype.setSpeed = function (speed) { this.speed = speed; this.speedHistory.push(speed); -// console.log("DEBUG: this.speedHistory.length = "+this.speedHistory.length+" ApplicationOptions.constance.SPEED_HISTORY_COUNT = "+ApplicationOptions.constance.SPEED_HISTORY_COUNT); if (this.speedHistory.length > ApplicationOptions.constance.SPEED_HISTORY_COUNT) { this.speedHistory.splice(1, 1); } @@ -227,7 +284,6 @@ SpatialObject.prototype.drawPath = function () { var currentSection = new L.polyline(this.pathGeoJsons[lineString].geometry.coordinates, this.getSectionStyles(currentSectionState)); // Create path object when and only drawing the path (save memory) TODO: if need directly draw line from geojson var currentSectionFirstPoint = this.pathGeoJsons[lineString].geometry.coordinates[0]; - console.log("DEBUG: previousSectionLastPoint = " + previousSectionLastPoint + " currentSectionFirstPoint = " + currentSectionFirstPoint); previousSectionLastPoint.push(currentSectionFirstPoint); var sectionJoin = new L.polyline(previousSectionLastPoint, this.getSectionStyles()); sectionJoin.setStyle({className: "sectionJointStyle"});// Make doted line for section join , this class is currently defined in map.jag as a inner css @@ -235,7 +291,6 @@ SpatialObject.prototype.drawPath = function () { previousSectionLastPoint = [this.pathGeoJsons[lineString].geometry.coordinates[this.pathGeoJsons[lineString].geometry.coordinates.length - 1]]; sectionJoin.addTo(map); this.path.push(sectionJoin); - console.log("DEBUG: Alert Information: " + this.pathGeoJsons[lineString].properties.information); currentSection.bindPopup("Alert Information: " + this.pathGeoJsons[lineString].properties.information); currentSection.addTo(map); this.path.push(currentSection); @@ -278,7 +333,6 @@ function processTrafficMessage(json) { if (json.id in currentSpatialObjects) { var existingObject = currentSpatialObjects[json.id]; existingObject.update(json); - console.log("existing area"); } else { var receivedObject = new GeoAreaObject(json); @@ -289,7 +343,6 @@ function processTrafficMessage(json) { function processAlertMessage(json) { if (json.state != "NORMAL" && json.state != "MINIMAL") { - console.log(json); notifyAlert("Object ID: " + json.id + " change state to: " + json.state + " Info : " + json.information); } } @@ -302,9 +355,7 @@ function processAlertMessage(json) { var type = typeof o; return type === 'object' || type === 'function'; } - if (!isObject(obj)) return; - var prop; for (var i=1; i < arguments.length-1; i++) { @@ -312,13 +363,11 @@ function processAlertMessage(json) { if (!isObject(obj[prop])) obj[prop] = {}; if (i < arguments.length-2) obj = obj[prop]; } - obj[prop] = arguments[i]; }*/ function processPredictionMessage(json) { setPropertySafe(currentPredictions, json.day, json.hour, json.longitude, json.latitude, json.traffic - 1); - //console.log(json); } WebSocket.prototype.set_opened = function () { @@ -334,9 +383,7 @@ WebSocket.prototype.get_opened = function () { var _longitudeStart = -0.0925 var _latitudeStart = 51.4985 var _unit = 0.005; - function requestPredictions(longitude, latitude, d) { - var serverUrl = "http://localhost:9763/endpoints/GpsDataOverHttp/predictionInput"; function loop(i) { setTimeout(function() { @@ -362,7 +409,6 @@ WebSocket.prototype.get_opened = function () { } var d= new Date(); //requestPredictions(-0.09,51.5,d); - function getPredictions(longitude, latitude, d) { var longitude = Math.round((longitude - _longitudeStart)/_unit); var latitude = Math.round((latitude - _latitudeStart)/_unit); @@ -379,7 +425,6 @@ WebSocket.prototype.get_opened = function () { traffic[0][i+1] = hour; traffic[1][i+1] = currentPredictions[day][hour][longitude][latitude]; } catch(e) { - console.log(i); } } return traffic; @@ -440,7 +485,6 @@ GeoAreaObject.prototype.update = function (geoJSON) { this.marker.setIconAngle(this.heading); this.marker.setIcon(this.stateIcon()); - console.log("update called"); // TODO: use general popup DOM this.popupTemplate.find('#objectId').html(this.id); this.popupTemplate.find('#information').html(this.information); @@ -509,7 +553,6 @@ function LocalStorageArray(id) { var initLoading = true; var webSocketOnAlertOpen = function () { - onAlertWebsocket.set_opened(); $('#ws-alert-stream').removeClass('text-muted text-danger text-success').addClass('text-success'); }; @@ -518,26 +561,20 @@ var webSocketOnAlertMessage = function processMessage(message) { var json = $.parseJSON(message.data); if (json.messageType == "Alert") { processAlertMessage(json); - } else { + }else { console.log("Message type not supported."); } } }; var webSocketOnAlertClose = function (e) { - if (onAlertWebsocket.get_opened()) { - $('#ws-alert-stream').removeClass('text-muted text-danger text-success').addClass('text-danger'); - } - waitForSocketConnection(onAlertWebsocket, initializeOnAlertWebSocket); }; var webSocketOnAlertError = function (e) { - if (!onAlertWebsocket.get_opened()) return; noty({text: 'Something went wrong when trying to connect to ' + alertWebSocketURL + '', type: 'error'}); }; var webSocketSpatialOnOpen = function () { - spatialWebsocket.set_opened(); if (initLoading) { initLoading = false; } @@ -558,94 +595,13 @@ var webSocketSpatialOnMessage = function (message) { }; var webSocketSpatialOnClose = function (e) { - if (spatialWebsocket.get_opened()) { - $('#ws-spatial-stream').removeClass('text-muted text-danger text-success').addClass('text-danger'); - } - waitForSocketConnection(spatialWebsocket, initializeSpatialStreamWebSocket); }; var webSocketSpatialOnError = function (err) { - if (!spatialWebsocket.get_opened()) return; noty({text: 'Something went wrong when trying to connect to ' + webSocketURL + '', type: 'error'}); }; -var waitTime = 1000; -var waitQueue = {}; -function waitForSocketConnection(socket, callback) { - if(waitQueue[socket.url]) return; - setTimeout( - function () { - if (socket.readyState === 1) { - //connectToSource(); - console.log("Connection is made"); - if (callback != null) { - callback(); - } - return; - } else { - ws = new WebSocket(socket.url); - if(socket)socket.close(); - waitTime += 400; - waitForSocketConnection(ws, callback); - } - }, waitTime); // wait 5 milisecond for the connection... - waitQueue[socket.url] = true; -} - - -function initializeSpatialStreamWebSocket() { - if(spatialWebsocket) spatialWebsocket.close(); - spatialWebsocket = new WebSocket(webSocketURL); - spatialWebsocket.onopen = webSocketSpatialOnOpen; - spatialWebsocket.onmessage = webSocketSpatialOnMessage; - spatialWebsocket.onclose = webSocketSpatialOnClose; - spatialWebsocket.onerror = webSocketSpatialOnError; -} - -function initializeOnAlertWebSocket() { - if(onAlertWebsocket) onAlertWebsocket.close(); - onAlertWebsocket = new WebSocket(alertWebSocketURL); - onAlertWebsocket.onmessage = webSocketOnAlertMessage; - onAlertWebsocket.onclose = webSocketOnAlertClose; - onAlertWebsocket.onerror = webSocketOnAlertError; - onAlertWebsocket.onopen = webSocketOnAlertOpen; -} - -function initializeGeoLocation(geoFencingEnabled) { - var deviceDetails = $(".device-id"); - deviceId = deviceDetails.data("deviceid"); - deviceType = deviceDetails.data("type"); - var loggedInUser = $("#logged-in-user"); - var username = loggedInUser.data("username"); - var userDomain = loggedInUser.data("domain"); - if (deviceId && deviceType) { - var geoCharts = $("#geo-charts"); - var wsEndPoint = geoCharts.data("ws-endpoint"); - wsToken = geoCharts.data("ws-token"); - geoPublicUri = geoCharts.data("geo-public-uri"); - webSocketURL = wsEndPoint + userDomain + "/iot.per.device.stream.geo.FusedSpatialEvent/1.0.0?" - + "deviceId=" + deviceId + "&deviceType=" + deviceType + "&websocketToken=" + wsToken; - alertWebSocketURL = wsEndPoint + userDomain + "/org.wso2.geo.AlertsNotifications/1.0.0?" - + "deviceId=" + deviceId + "&deviceType=" + deviceType + "&websocketToken=" + wsToken; - $("#proximity_alert").hide(); - - initialLoad(geoFencingEnabled); - InitSpatialObject(geoFencingEnabled); - - if (geoFencingEnabled) { - initializeSpatialStreamWebSocket(); - initializeOnAlertWebSocket(); - window.onbeforeunload = function () { - spatialWebsocket.close(); - onAlertWebsocket.close(); - } - } - } else { - noty({text: 'Invalid Access! No device information provided to track!', type: 'error'}); - } -} - SpatialObject.prototype.stateIcon = function () { //TODO : Need to add separate icons for each device type var iconUrl = geoPublicUri + "/img/markers/object-types/default"; @@ -656,19 +612,18 @@ SpatialObject.prototype.stateIcon = function () { } return L.icon({ - iconUrl: iconUrl + ".png", - shadowUrl: false, - iconSize: [24, 24], - iconAnchor: [+12, +12], - popupAnchor: [-2, -5] - }); + iconUrl: iconUrl + ".png", + shadowUrl: false, + iconSize: [24, 24], + iconAnchor: [+12, +12], + popupAnchor: [-2, -5] + }); }; - var normalMovingIcon = L.icon({ - iconUrl: ApplicationOptions.leaflet.iconUrls.normalMovingIcon, - shadowUrl: false, - iconSize: [24, 24], - iconAnchor: [+12, +12], - popupAnchor: [-2, -5] - }); \ No newline at end of file + iconUrl: ApplicationOptions.leaflet.iconUrls.normalMovingIcon, + shadowUrl: false, + iconSize: [24, 24], + iconAnchor: [+12, +12], + popupAnchor: [-2, -5] +}); \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs index 051fb23592..c53f32cce9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.platform.configuration/configuration.hbs @@ -27,26 +27,37 @@ Platform Configurations
- General and Platform Specific Server Settings for the Tenant + {{#if isCloud}} + iOS Mobile Management Specific Server Settings for the Tenant + {{else}} + General and Platform Specific Server Settings for the Tenant + {{/if}} +

- - - - - - - + + {{#unless isCloud}} + + + + + + + + - - General Configurations - + General Configurations + + {{/unless}} {{#each deviceTypes}} - + @@ -62,50 +73,52 @@
-
-
- -
-