Merge pull request #950 from dilee/master

Minor refactorings and fixing formatting issues
revert-70aa11f8
Ruwan 7 years ago committed by GitHub
commit ee0195f740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -26,8 +26,16 @@ import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil; import org.wso2.carbon.device.mgt.core.dao.util.DeviceManagementDAOUtil;
import java.io.*;
import java.sql.*; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
@ -84,14 +92,14 @@ public class ApplicationDAOImpl implements ApplicationDAO {
try { try {
bao.close(); bao.close();
} catch (IOException e) { } catch (IOException e) {
log.warn("Error occurred while closing ByteArrayOutputStream", e); log.error("Error occurred while closing ByteArrayOutputStream", e);
} }
} }
if (oos != null) { if (oos != null) {
try { try {
oos.close(); oos.close();
} catch (IOException e) { } catch (IOException e) {
log.warn("Error occurred while closing ObjectOutputStream", e); log.error("Error occurred while closing ObjectOutputStream", e);
} }
} }
DeviceManagementDAOUtil.cleanupResources(stmt, rs); DeviceManagementDAOUtil.cleanupResources(stmt, rs);
@ -150,14 +158,14 @@ public class ApplicationDAOImpl implements ApplicationDAO {
try { try {
bao.close(); bao.close();
} catch (IOException e) { } catch (IOException e) {
log.warn("Error occurred while closing ByteArrayOutputStream", e); log.error("Error occurred while closing ByteArrayOutputStream", e);
} }
} }
if (oos != null) { if (oos != null) {
try { try {
oos.close(); oos.close();
} catch (IOException e) { } catch (IOException e) {
log.warn("Error occurred while closing ObjectOutputStream", e); log.error("Error occurred while closing ObjectOutputStream", e);
} }
} }
DeviceManagementDAOUtil.cleanupResources(stmt, null); DeviceManagementDAOUtil.cleanupResources(stmt, null);
@ -193,7 +201,7 @@ public class ApplicationDAOImpl implements ApplicationDAO {
conn.rollback(); conn.rollback();
} }
} catch (SQLException e1) { } catch (SQLException e1) {
log.warn("Error occurred while roll-backing the transaction", e); log.error("Error occurred while roll-backing the transaction", e);
} }
throw new DeviceManagementDAOException("Error occurred while removing bulk application list", e); throw new DeviceManagementDAOException("Error occurred while removing bulk application list", e);
} finally { } finally {

@ -59,7 +59,7 @@ function getLogStatusIcon(entry) {
case 'ERROR': case 'ERROR':
return 'fw-error'; return 'fw-error';
default: default:
return 'fw-info' return 'fw-info';
} }
} }
@ -203,7 +203,7 @@ function loadOperationsLog(update) {
case 'ERROR': case 'ERROR':
return 'fw-error'; return 'fw-error';
default: default:
return 'fw-info' return 'fw-info';
} }
} }
} }
@ -306,7 +306,6 @@ function loadApplicationsList() {
data[i]["name"] = decodeURIComponent(data[i]["name"]); data[i]["name"] = decodeURIComponent(data[i]["name"]);
data[i]["platform"] = deviceType; data[i]["platform"] = deviceType;
} }
var viewModel = {}; var viewModel = {};
viewModel["applications"] = data; viewModel["applications"] = data;
viewModel["deviceType"] = deviceType; viewModel["deviceType"] = deviceType;

@ -66,7 +66,6 @@ function openTools(id) {
console.log("removed drawnItems"); console.log("removed drawnItems");
} }
closeAll(); closeAll();
noty({text: "Please draw the required area on the map", type: "information"}); noty({text: "Please draw the required area on the map", type: "information"});
@ -107,7 +106,6 @@ function openTools(id) {
removeAllControl = new L.Control.RemoveAll(); removeAllControl = new L.Control.RemoveAll();
map.addControl(removeAllControl); map.addControl(removeAllControl);
// Initialise the FeatureGroup to store editable layers // Initialise the FeatureGroup to store editable layers
drawnItems = new L.FeatureGroup(); drawnItems = new L.FeatureGroup();
map.addLayer(drawnItems); map.addLayer(drawnItems);
@ -168,7 +166,6 @@ function openTools(id) {
}); });
} else if(id=="Stationery"){ } else if(id=="Stationery"){
// Initialise the draw control and pass it the FeatureGroup of editable layers // Initialise the draw control and pass it the FeatureGroup of editable layers
drawControl = new L.Control.Draw({ drawControl = new L.Control.Draw({
draw: { draw: {
polygon: { polygon: {
@ -252,11 +249,7 @@ function openTools(id) {
}); });
console.log("prediction tool opened"); console.log("prediction tool opened");
} }
map.addControl(drawControl); map.addControl(drawControl);
} }
function createPopup(layer,id) { function createPopup(layer,id) {
@ -427,7 +420,6 @@ function viewFence(geoFenceElement,id) {
// transparent the layer .leaflet-popup-content-wrapper // transparent the layer .leaflet-popup-content-wrapper
$(geometryShape._popup._container.childNodes[0]).css("background", "rgba(255,255,255,0.8)"); $(geometryShape._popup._container.childNodes[0]).css("background", "rgba(255,255,255,0.8)");
}); });
} else if(id=="Traffic"){
} }
closeAll(); closeAll();
} }
@ -499,7 +491,6 @@ function viewFenceByData(geoJson, queryName, areaName, stationeryTime, id) {
// transparent the layer .leaflet-popup-content-wrapper // transparent the layer .leaflet-popup-content-wrapper
$(geometryShape._popup._container.childNodes[0]).css("background", "rgba(255,255,255,0.8)"); $(geometryShape._popup._container.childNodes[0]).css("background", "rgba(255,255,255,0.8)");
}); });
} else if(id=="Traffic"){
} }
closeAll(); closeAll();
} }

Loading…
Cancel
Save