From 570a8ba0baa8fba4974623f0058ce39078531ff6 Mon Sep 17 00:00:00 2001 From: charithag Date: Thu, 20 Aug 2015 12:20:25 +0530 Subject: [PATCH] Change paths to comply with JAX-RS update --- .../jaggeryapps/iotserver/api/device-api.jag | 4 +- .../jaggeryapps/iotserver/api/group-api.jag | 4 +- .../public/js/device-listing.js | 62 ------------------- .../group-listing/public/js/group-listing.js | 1 - 4 files changed, 4 insertions(+), 67 deletions(-) diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/api/device-api.jag b/modules/distribution/src/repository/jaggeryapps/iotserver/api/device-api.jag index 3ddcd0d3..5920c4f5 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/api/device-api.jag +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/api/device-api.jag @@ -125,7 +125,7 @@ if (uriMatcher.match("/{context}/api/device/sketch/download/{downloadId}")) { var allDevices = []; deviceCloudService = carbonHttpsServletTransport + "/common/group_manager"; - var endPoint = deviceCloudService + "/group/all"; + var endPoint = deviceCloudService + "/group/user/" + user.username + "/all"; var data = {"username": user.username}; var groups = get(endPoint, data, "json").data; @@ -168,7 +168,7 @@ if (uriMatcher.match("/{context}/api/device/sketch/download/{downloadId}")) { var allDevices = []; deviceCloudService = carbonHttpsServletTransport + "/common/group_manager"; - var endPoint = deviceCloudService + "/group/all"; + var endPoint = deviceCloudService + "/group/user/" + user.username + "/all"; var data = {"username": user.username}; var groups = get(endPoint, data, "json").data; diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/api/group-api.jag b/modules/distribution/src/repository/jaggeryapps/iotserver/api/group-api.jag index 2795e9e0..7028b71a 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/api/group-api.jag +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/api/group-api.jag @@ -89,14 +89,14 @@ if (uriMatcher.match("/{context}/api/group/add")) { } else if (uriMatcher.match("/{context}/api/group/all")) { //URL: GET https://localhost:9443/devicecloud/group_manager/group/all - endPoint = deviceCloudService + "/group/all"; + endPoint = deviceCloudService + "/group/user/" + user.username + "/all"; data = {"username": user.username}; result = get(endPoint, data, "json"); } else if (uriMatcher.match("/{context}/api/group/all/count")) { //URL: GET https://localhost:9443/devicecloud/group_manager/group/all/count - endPoint = deviceCloudService + "/group/all/count"; + endPoint = deviceCloudService + "/group/user/" + user.username + "/all/count"; data = {"username": user.username}; result = get(endPoint, data, "json"); diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/js/device-listing.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/js/device-listing.js index 91fda3dd..b3049268 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/js/device-listing.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/device-listing/public/js/device-listing.js @@ -60,7 +60,6 @@ var groupId, username; * Setting-up global variables. */ var deviceCheckbox = "#ast-container-parent .ctrl-wr-asset .itm-select input[type='checkbox']"; -var assetContainerParent = "#ast-container-parent"; /* * DOM ready functions. @@ -88,7 +87,6 @@ $(document).ready(function () { groupId = $("#request-group-id").data("groupid"); loadDevices(); - attachGroupAdding(); }); /* @@ -475,66 +473,6 @@ var errorHandler = function () { }); }; -function attachGroupAdding() { - /** - * Following click function would execute - * when a user clicks on "Remove" link - * on Group Management page in WSO2 IoT Server Console. - */ - $("a.add-group-link").click(function () { - var addGroupApi = "/iotserver/api/group/add"; - $(modalPopupContent).html($('#add-group-modal-content').html()); - showPopup(); - - $("a#add-group-yes-link").click(function () { - var newGroupName = $('#add-group-name').val(); - var newGroupDescription = $('#add-group-description').val(); - var group = {"name": newGroupName, "description": newGroupDescription}; - invokerUtil.post( - addGroupApi, - group, - function (data, txtStatus, jqxhr) { - var status = jqxhr.status; - if (status == 200) { - if (data != "false") { - $(modalPopupContent).html($('#add-group-200-content').html()); - loadDevices(); - setTimeout(function () { - hidePopup(); - }, 2000); - } else { - $(modalPopupContent).html($('#group-400-content').html()); - $("a#group-400-link").click(function () { - hidePopup(); - }); - } - } else if (status == 400) { - $(modalPopupContent).html($('#group-400-content').html()); - $("a#group-400-link").click(function () { - hidePopup(); - }); - } else if (status == 403) { - $(modalPopupContent).html($('#agroup-403-content').html()); - $("a#group-403-link").click(function () { - hidePopup(); - }); - } else if (status == 409) { - $(modalPopupContent).html($('#group-409-content').html()); - $("a#group-409-link").click(function () { - hidePopup(); - }); - } - }, errorHandler - ); - }); - - $("a#add-group-cancel-link").click(function () { - hidePopup(); - }); - - }); -} - /** * Following functions should be triggered after AJAX request is made. */ diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/js/group-listing.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/js/group-listing.js index af23137c..39fc5650 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/js/group-listing.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/group-listing/public/js/group-listing.js @@ -163,7 +163,6 @@ function loadGroups(searchType, searchParam) { attachEvents(); formatDates(); } - attachGroupAdding(); }; invokerUtil.get(serviceURL, successCallback, function (message) {