Merge branch 'IoTS-1.0.0-M1' of https://github.com/wso2/carbon-device-mgt-plugins into IoTS-1.0.0-M1

Shabirmean 9 years ago
commit dc39656dac

@ -280,22 +280,6 @@ import java.util.List;
}
}
@Path("/device/group/{groupId}/{limit}")
@GET
@Consumes("application/json")
@Produces("application/json")
public Device[] getDevices(@PathParam("groupId") int groupId, @PathParam("limit") int limit){
try{
List<Device> devices = this.getServiceProvider().getDevices(groupId,limit);
return this.getActiveDevices(devices);
} catch (DeviceManagementException e) {
response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
return null;
} finally {
this.endTenantFlow();
}
}
@Path("/device/role/{role}/all")
@GET
@Consumes("application/json")

@ -24,6 +24,7 @@ import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.device.mgt.group.common.DeviceGroup;
import org.wso2.carbon.device.mgt.group.common.GroupManagementException;
import org.wso2.carbon.device.mgt.group.common.GroupUser;
@ -407,14 +408,14 @@ public class GroupManagerService {
return usersArray;
}
@Path("/group/id/{groupId}/device/{limit}")
@Path("/group/id/{groupId}/device/all")
@GET
@Consumes("application/json")
@Produces("application/json")
public Device[] getDevices(@PathParam("groupId") int groupId,@PathParam("limit") int limit) {
public Device[] getDevices(@PathParam("groupId") int groupId) {
Device[] deviceArray = null;
try {
List<Device> devices = this.getServiceProvider().getDevices(groupId,limit);
List<Device> devices = this.getServiceProvider().getDevices(groupId);
deviceArray = new Device[devices.size()];
response.setStatus(Response.Status.OK.getStatusCode());
devices.toArray(deviceArray);
@ -427,6 +428,40 @@ public class GroupManagerService {
return deviceArray;
}
@Path("/group/id/{groupId}/device/count")
@GET
@Consumes("application/json")
@Produces("application/json")
public int getDeviceCount(@PathParam("groupId") int groupId) {
try {
return this.getServiceProvider().getDeviceCount(groupId);
} catch (GroupManagementException e) {
response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
log.error(e.getErrorMessage(), e);
return -1;
} finally {
this.endTenantFlow();
}
}
@Path("/group/id/{groupId}/device")
@GET
@Consumes("application/json")
@Produces("application/json")
public PaginationResult getDevices(@PathParam("groupId") int groupId,
@QueryParam("index") int index,
@QueryParam("limit") int limit) {
try {
return this.getServiceProvider().getDevices(groupId, index, limit);
} catch (GroupManagementException e) {
response.setStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());
log.error(e.getErrorMessage(), e);
return null;
} finally {
this.endTenantFlow();
}
}
@Path("/group/id/{groupId}/device/assign")
@PUT
@Consumes("application/json")

@ -162,8 +162,14 @@ public class ApisAppClient {
JSONObject object = jsonSubscriptions.getJSONObject(n);
String appName = object.getString("name");
String prodConsumerKey = object.getString("prodConsumerKey");
String prodConsumerSecret = object.getString("prodConsumerSecret");
String prodConsumerKey = null;
String prodConsumerSecret = null;
if(!object.get("prodConsumerKey").equals(null)) {
prodConsumerKey = object.getString("prodConsumerKey");
}
if(!object.get("prodConsumerSecret").equals(null)) {
prodConsumerSecret = object.getString("prodConsumerSecret");
}
subscriptionMap.put(appName, new String(Base64.encodeBase64(
(prodConsumerKey + ":" + prodConsumerSecret).getBytes())));
}

@ -1,4 +1,4 @@
<div class="col-lg-12 margin-top-double">
<div class="col-lg-12 margin-top-double" xmlns="http://www.w3.org/1999/html">
<h1 class="grey ">Digital Display</h1>
<hr>
<p class="margin-bottom-double light-grey ">Connect your Digital Display
@ -48,14 +48,9 @@
value="digital_display"/>
<input type="hidden" class="sketchType" name="sketchType"
value="digital_display"/>
<div class="sketchTypes" style=" padding-top: 20px; padding-bottom: 5px; font-size: 18px;">
<input type="radio" name="sketchType" id="digital_display"
value="digital_display"><label for="digital_display">digitaldisplay</label>
</div>
</div>
</div>
<br/>
<div class="buttons">
<a class="btn-operations" onclick="downloadAgent()">Download
Now</a>
@ -202,7 +197,7 @@
<br/>
<ul>
<p class="padding-top-double"><span class="circle">01</span> <b>Click on the <i>'Create DEB'</i> button above to get the download link for the Digital Display setup files</b></p>
<p class="padding-top-double"><span class="circle">02</span> <i>(The following commands can be issued by directly typing into the terminal of the device or by an <b>'ssh'<b> login from a remote PC)</i></p>
<p class="padding-top-double"><span class="circle">02</span> <i>(The following commands can be issued by directly typing into the terminal of the device or by an <b>'ssh'</b> login from a remote PC)</i></p>
<p class="padding-top-double"><span class="circle">03</span> <b>Download the Digital Display setup files using the following command: 'curl -k < url_link_received_from_the_above_step >> Agent.zip'</b><br/><i>This will download a zip file named 'Agent.zip'</i></p>
</ul>
<br>

@ -33,7 +33,7 @@
<div id="map" class="map-wrapper hidden">
</div>
<a class="padding-left" href="{{@app.context}}/analytics?device.deviceIdentifier={{device.deviceIdentifier}}&device.type={{device.type}}&deviceName={{device.name}}">
<a class="padding-left" href="{{@app.context}}/analytics?deviceId={{device.deviceIdentifier}}&deviceType={{device.type}}&deviceName={{device.name}}">
<span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-statistics fw-stack-1x"></i>

@ -1,6 +1,6 @@
function onRequest(context) {
var log = new Log("stats.js");
var operationModule = require("/modules/operation.js").operationModule;
var operationModule = require("/app/modules/operation.js").operationModule;
var device = context.unit.params.device;
log.info(device);
var monitor_operations = JSON.stringify(operationModule.getMonitorOperations(device.type));

@ -46,7 +46,6 @@
<div id="general-config-heading" class="panel-heading" role="tab">
<h2 class="sub-title panel-title">
Policy Monitoring
<hr>
</h2>
</div>
<div id="email-config-body" class="panel-collapse panel-body" role="tabpanel">
@ -66,7 +65,7 @@
</div>
<div class="wr-input-control wr-btn-grp">
<button id="save-general-btn" class="wr-btn">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Save&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Save
</button>
</div>
</div>
@ -210,7 +209,7 @@
<textarea id="android-eula" type="text" class="form-control"></textarea>
</div>
<div class="wr-input-control wr-btn-grp">
<button id="save-android-btn" class="wr-btn">&nbsp;&nbsp;&nbsp;&nbsp;Save&nbsp;&nbsp;&nbsp;&nbsp;</button>
<button id="save-android-btn" class="wr-btn">Save</button>
</div>
</div>
</div>
@ -422,7 +421,7 @@
<textarea id="ios-eula" type="text" class="form-control"></textarea>
</div>
<div class="wr-input-control wr-btn-grp">
<button id="save-ios-btn" class="wr-btn">&nbsp;&nbsp;&nbsp;&nbsp;Save&nbsp;&nbsp;&nbsp;&nbsp;</button>
<button id="save-ios-btn" class="wr-btn">Save</button>
</div>
</div>
</div>
@ -463,7 +462,7 @@
<textarea id="windows-eula" type="text" class="form-control"></textarea>
</div>
<div class="wr-input-control wr-btn-grp">
<button id="save-windows-btn" class="wr-btn">&nbsp;&nbsp;&nbsp;&nbsp;Save&nbsp;&nbsp;&nbsp;&nbsp;</button>
<button id="save-windows-btn" class="wr-btn">Save</button>
</div>
</div>
</div>
@ -482,7 +481,7 @@
<b>"Exit"</b> to complete the process and go back to the dashboard.
<hr />
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/platform-configuration'">Go back to configurations</button>
<button class="wr-btn" onclick="window.location.href='{{@app.context}}'">&nbsp;&nbsp;&nbsp;&nbsp;Exit&nbsp;&nbsp;&nbsp;&nbsp;</button>
<button class="wr-btn" onclick="window.location.href='{{@app.context}}'">Exit</button>
</div>
</div>
<!-- /content -->

@ -1175,7 +1175,7 @@
<carbon.commons.version>4.4.8</carbon.commons.version>
<!-- Carbon API Management -->
<carbon.api.mgt.version>4.3.0</carbon.api.mgt.version>
<carbon.api.mgt.version>4.3.1</carbon.api.mgt.version>
<!-- App manager version-->
<appmgt.feature.version>1.1.1</appmgt.feature.version>

Loading…
Cancel
Save