forked from community/device-mgt-core
Merge pull request #1 from dulichan/master
Improvements to the UI and various merges - By Dulitharevert-70aa11f8
commit
25ab5f1fdc
Binary file not shown.
@ -0,0 +1,38 @@
|
|||||||
|
<%
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.
|
||||||
|
*/
|
||||||
|
var utility = require("/modules/utility.js");
|
||||||
|
var deviceManagementService = utility.getDeviceManagementService();
|
||||||
|
var devices = deviceManagementService.getAllDevices("android");
|
||||||
|
var logger = new Log();
|
||||||
|
var deviceList = [];
|
||||||
|
for (i = 0; i < devices.size(); i++) {
|
||||||
|
var device = devices.get(i);
|
||||||
|
deviceList.push({
|
||||||
|
"identifier": device.getDeviceIdentifier(),
|
||||||
|
"name": device.getName(),
|
||||||
|
"ownership": device.getOwnership(),
|
||||||
|
"owner": device.getOwner(),
|
||||||
|
"deviceType": device.getType(),
|
||||||
|
"vendor": device.getProperties().get("vendor"),
|
||||||
|
"model": device.getProperties().get("model"),
|
||||||
|
"osVersion": device.getProperties().get("osVersion")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
print(deviceList);
|
||||||
|
%>
|
@ -1 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.
|
||||||
|
*/
|
||||||
//Init js to execute
|
//Init js to execute
|
||||||
|
var logger = new Log();
|
||||||
|
logger.debug("running debug");
|
||||||
|
var app_TENANT_CONFIGS = 'tenant.configs';
|
||||||
|
var app_carbon = require('carbon');
|
||||||
|
var app_configs = {
|
||||||
|
"HTTPS_URL": "https://localhost:9443"
|
||||||
|
};
|
||||||
|
|
||||||
|
var app_server = new app_carbon.server.Server({
|
||||||
|
tenanted: app_configs.tenanted,
|
||||||
|
url: app_configs.HTTPS_URL + '/admin'
|
||||||
|
});
|
||||||
|
application.put("SERVER", app_server);
|
||||||
|
application.put(app_TENANT_CONFIGS, {});
|
||||||
|
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015, 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
//temporary
|
||||||
|
|
||||||
|
var PrivilegedCarbonContext = Packages.org.wso2.carbon.context.PrivilegedCarbonContext,
|
||||||
|
Class = java.lang.Class;
|
||||||
|
|
||||||
|
osgiService = function (clazz) {
|
||||||
|
return PrivilegedCarbonContext.getThreadLocalCarbonContext().getOSGiService(Class.forName(clazz));
|
||||||
|
};
|
||||||
|
var getDeviceManagementService= function(){
|
||||||
|
//server.authenticate("admin", "admin");
|
||||||
|
var realmService = osgiService('org.wso2.carbon.device.mgt.core.service.DeviceManagementService');
|
||||||
|
//var realmService = null;
|
||||||
|
return realmService;
|
||||||
|
}
|
Loading…
Reference in new issue