forked from community/device-mgt-plugins
Merge branch 'master' of https://github.com/wso2/carbon-device-mgt-plugins into apim
commit
3db3e52657
@ -0,0 +1,55 @@
|
|||||||
|
<%
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2016, 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 uri = request.getRequestURI();
|
||||||
|
var uriMatcher = new URIMatcher(String(uri));
|
||||||
|
|
||||||
|
var log = new Log("api/policy-api.jag");
|
||||||
|
|
||||||
|
var constants = require("/app/modules/constants.js");
|
||||||
|
var policyModule = require("/app/modules/policy.js").policyModule;
|
||||||
|
|
||||||
|
var deviceType, deviceId;
|
||||||
|
|
||||||
|
var user = session.get(constants.USER_SESSION_KEY);
|
||||||
|
|
||||||
|
var responseProcessor = require('utils').response;
|
||||||
|
response.contentType = 'application/json';
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
|
response = responseProcessor.buildErrorResponse(response, 401, "Unauthorized");
|
||||||
|
} else {
|
||||||
|
if (uriMatcher.match("/{context}/api/policies/add")) {
|
||||||
|
var content = request.getContent();
|
||||||
|
var policyName = content.policyName;
|
||||||
|
var policyDefinition = content.profile.policyDefinition;
|
||||||
|
var policyDescription = content.profile.policyDescription;
|
||||||
|
deviceType = content.profile.deviceType.name;
|
||||||
|
deviceId = content.deviceId;
|
||||||
|
try {
|
||||||
|
response.content = policyModule.addPolicy(policyName, deviceType, policyDefinition,
|
||||||
|
policyDescription, deviceId);
|
||||||
|
} catch (e) {
|
||||||
|
log.error("Exception occurred while trying to add new policy under name:" + policyName, e);
|
||||||
|
// http status code 500 refers to - Internal Server Error.
|
||||||
|
responseProcessor.buildErrorResponse(response, 500, "Internal server error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
%>
|
@ -1,492 +0,0 @@
|
|||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<!-- content -->
|
|
||||||
<div id="config-save-form" class="container col-centered wr-content">
|
|
||||||
<br>
|
|
||||||
<h1 class="page-sub-title">
|
|
||||||
Platform Configurations
|
|
||||||
</h1>
|
|
||||||
<br>
|
|
||||||
General and Platform Specific Server Settings for the Tenant
|
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<div class="wr-advance-operations">
|
|
||||||
<div class="row no-gutter">
|
|
||||||
<div class="wr-hidden-operations-nav col-lg-4">
|
|
||||||
<a href="javascript:void(0)" onclick="showAdvanceOperation('general', this)" class="selected">
|
|
||||||
<span class="wr-hidden-operations-icon fw-stack">
|
|
||||||
<i class="fw fw-settings fw-stack-2x"></i>
|
|
||||||
</span>
|
|
||||||
General Configurations
|
|
||||||
</a>
|
|
||||||
<a href="javascript:void(0)" onclick="showAdvanceOperation('android', this)">
|
|
||||||
<span class="wr-hidden-operations-icon fw-stack">
|
|
||||||
<i class="fw fw-android fw-stack-2x"></i>
|
|
||||||
</span>
|
|
||||||
Android Configurations
|
|
||||||
</a>
|
|
||||||
<a href="javascript:void(0)" onclick="showAdvanceOperation('ios', this)">
|
|
||||||
<span class="wr-hidden-operations-icon fw-stack">
|
|
||||||
<i class="fw fw-apple fw-stack-2x"></i>
|
|
||||||
</span>
|
|
||||||
iOS Configurations
|
|
||||||
</a>
|
|
||||||
<a href="javascript:void(0)" onclick="showAdvanceOperation('windows', this)">
|
|
||||||
<span class="wr-hidden-operations-icon fw-stack">
|
|
||||||
<i class="fw fw-windows fw-stack-2x"></i>
|
|
||||||
</span>
|
|
||||||
Windows Configurations
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-hidden-operations-content col-lg-8">
|
|
||||||
<!-- general -->
|
|
||||||
<div class="wr-hidden-operation" data-operation="general" style="display: block">
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div id="general-config-heading" class="panel-heading" role="tab">
|
|
||||||
<h2 class="sub-title panel-title">
|
|
||||||
Policy Monitoring
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
<div id="email-config-body" class="panel-collapse panel-body" role="tabpanel">
|
|
||||||
<div id="email-config-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="email-config-host">
|
|
||||||
Monitoring Frequency
|
|
||||||
<span class="helper" title="SMTP Server Host">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
<br>
|
|
||||||
( Should be in milliseconds )
|
|
||||||
</label>
|
|
||||||
<input id="monitoring-config-frequency" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
<div class="wr-input-control wr-btn-grp">
|
|
||||||
<button id="save-general-btn" class="wr-btn">
|
|
||||||
Save
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--<div id="general-config-heading" class="panel-heading" role="tab">
|
|
||||||
<h2 class="sub-title panel-title">
|
|
||||||
Email Configurations
|
|
||||||
<hr>
|
|
||||||
</h2>
|
|
||||||
</div>-->
|
|
||||||
<!--<div id="email-config-body" class="panel-collapse panel-body" role="tabpanel">
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="email-config-host">
|
|
||||||
Host
|
|
||||||
<span class="helper" title="SMTP Server Host">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="email-config-host" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="email-config-port">
|
|
||||||
Port
|
|
||||||
<span class="helper" title="SMTP Server Port">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="email-config-port" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="email-config-username">
|
|
||||||
Username
|
|
||||||
<span class="helper" title="Email Username">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="email-config-username" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="email-config-password">
|
|
||||||
Password
|
|
||||||
<span class="helper" title="Email Password">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="email-config-password" type="password" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="email-config-sender-email">
|
|
||||||
Sender Email Address
|
|
||||||
<span class="helper" title="Sender Email Address to be appeared on the email">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="email-config-sender-email" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="email-config-template">
|
|
||||||
Email Template
|
|
||||||
<span class="helper" title="Email Template to be used in invitation email">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<textarea id="email-config-template" type="textarea" class="form-control"></textarea>
|
|
||||||
</div>
|
|
||||||
</div>-->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- general-->
|
|
||||||
|
|
||||||
<!-- android -->
|
|
||||||
<div class="wr-hidden-operation" data-operation="android">
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div id="android-config-body" class="panel-collapse panel-body" role="tabpanel">
|
|
||||||
<div id="android-config-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="android-config-notifier">
|
|
||||||
Notifier Type
|
|
||||||
<span class="helper" title="Notifier type for the agent to contact EMM server">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<select id="android-config-notifier" class="form-control" data-default="0">
|
|
||||||
<option value="1">LOCAL</option>
|
|
||||||
<option value="2">GCM</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="local-inputs">
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="android-config-notifier-frequency">
|
|
||||||
Notifier Frequency
|
|
||||||
<span class="helper" title="Notifier frequency for the agent to contact EMM server">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
<br>
|
|
||||||
( Should be in milliseconds )
|
|
||||||
</label>
|
|
||||||
<input id="android-config-notifier-frequency" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="gcm-inputs">
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="android-config-gcm-api-key">
|
|
||||||
API Key
|
|
||||||
<span class="helper" title="GCM API Key">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="android-config-gcm-api-key" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="android-config-gcm-sender-id">
|
|
||||||
Sender ID
|
|
||||||
<span class="helper" title="GCM Sender ID">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="android-config-gcm-sender-id" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="wifi-heading" class="panel-heading" role="tab">
|
|
||||||
<h2 class="sub-title panel-title">
|
|
||||||
End User License Agreement (EULA)
|
|
||||||
<hr>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="wifi-body" class="panel-collapse panel-body" role="tabpanel" aria-labelledby="wifi-body">
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<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">Save</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /android -->
|
|
||||||
|
|
||||||
<!-- ios -->
|
|
||||||
<div class="wr-hidden-operation" data-operation="ios">
|
|
||||||
<div class="panel panel-default operation-data" data-operation="wifi" data-operation-code="WIFI">
|
|
||||||
<div id="ios-heading" class="panel-heading" role="tab">
|
|
||||||
<h2 class="sub-title panel-title">
|
|
||||||
iOS SCEP Certificate Configurations
|
|
||||||
<hr>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
<div id="ios-config-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
<div id="wifi-body" class="panel-collapse panel-body" role="tabpanel" aria-labelledby="ios-body">
|
|
||||||
<div id="ios-scep-config-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-country">
|
|
||||||
Country (C)
|
|
||||||
<span class="helper" title="Country">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="ios-config-country" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-state">
|
|
||||||
State (ST)
|
|
||||||
<span class="helper" title="State">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="ios-config-state" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-locality">
|
|
||||||
Locality (L)
|
|
||||||
<span class="helper" title="Locality">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="ios-config-locality" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-organization">
|
|
||||||
Organization (O)
|
|
||||||
<span class="helper" title="Organization">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="ios-config-organization" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-organization-unit">
|
|
||||||
Organization Unit (OU)
|
|
||||||
<span class="helper" title="Organization Unit">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="ios-config-organization-unit" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="wifi-heading" class="panel-heading" role="tab">
|
|
||||||
<h2 class="sub-title panel-title">
|
|
||||||
iOS Profile Configurations
|
|
||||||
<hr>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="wifi-body" class="panel-collapse panel-body" role="tabpanel" aria-labelledby="wifi-body">
|
|
||||||
<div id="ios-profile-conf-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-org-display-name">
|
|
||||||
Organization Display Name
|
|
||||||
<span class="helper" title="Organization">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="ios-org-display-name" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="wifi-heading" class="panel-heading" role="tab">
|
|
||||||
<h2 class="sub-title panel-title">
|
|
||||||
iOS MDM Configurations
|
|
||||||
<hr>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="wifi-body" class="panel-collapse panel-body" role="tabpanel" aria-labelledby="wifi-body">
|
|
||||||
<div id="ios-mdm-config-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-mdm-certificate">
|
|
||||||
MDM Certificate
|
|
||||||
<span class="helper" title="Upload MDM Certificate">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label><br>
|
|
||||||
<label class="wr-input-label" id="mdm-cert-file-name">
|
|
||||||
</label>
|
|
||||||
<input id="ios-config-mdm-certificate" type="file" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-mdm-certificate-password">
|
|
||||||
MDM Certificate Password
|
|
||||||
<span class="helper" title="MDM Certificate Password">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="ios-config-mdm-certificate-password" type="password" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-mdm-certificate-topic-id">
|
|
||||||
MDM Certificate Topic ID
|
|
||||||
<span class="helper" title="MDM Certificate Topic ID">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="ios-config-mdm-certificate-topic-id" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-mdm-mode">
|
|
||||||
Mode
|
|
||||||
<span class="helper" title="Release mode">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<select id="ios-config-mdm-mode" class="form-control" data-default="0">
|
|
||||||
<option value="1">Production</option>
|
|
||||||
<option value="2">Developer</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="wifi-heading" class="panel-heading" role="tab">
|
|
||||||
<h2 class="sub-title panel-title">
|
|
||||||
iOS APNS Configurations
|
|
||||||
<hr>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="wifi-body" class="panel-collapse panel-body" role="tabpanel" aria-labelledby="wifi-body">
|
|
||||||
<div id="ios-apns-config-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-apns-certificate">
|
|
||||||
APNS Certificate
|
|
||||||
<span class="helper" title="Upload APNS Certificate">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label><br>
|
|
||||||
<label class="wr-input-label" id="apns-cert-file-name">
|
|
||||||
</label>
|
|
||||||
<input id="ios-config-apns-certificate" type="file" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-apns-certificate-password">
|
|
||||||
APNS Certificate Password
|
|
||||||
<span class="helper" title="MDM Certificate Password">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<input id="ios-config-apns-certificate-password" type="password" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="ios-config-apns-mode">
|
|
||||||
Mode
|
|
||||||
<span class="helper" title="Release mode">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
</label>
|
|
||||||
<select id="ios-config-apns-mode" class="form-control" data-default="0">
|
|
||||||
<option value="1">Production</option>
|
|
||||||
<option value="2">Developer</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="wifi-heading" class="panel-heading" role="tab">
|
|
||||||
<h2 class="sub-title panel-title">
|
|
||||||
End User License Agreement (EULA)
|
|
||||||
<hr>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="wifi-body" class="panel-collapse panel-body" role="tabpanel" aria-labelledby="wifi-body">
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<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">Save</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /ios -->
|
|
||||||
|
|
||||||
<!-- windows -->
|
|
||||||
<div class="wr-hidden-operation" data-operation="windows">
|
|
||||||
<div class="panel panel-default">
|
|
||||||
<div id="windows-config-body" class="panel-collapse panel-body" role="tabpanel">
|
|
||||||
<div id="windows-config-error-msg" class="alert alert-danger hidden" role="alert">
|
|
||||||
<i class="icon fw fw-error"></i><span></span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="local-inputs">
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<label class="wr-input-label" for="windows-config-notifier-frequency">
|
|
||||||
Notifier Frequency
|
|
||||||
<span class="helper" title="Notifier frequency for the agent to contact EMM server">
|
|
||||||
<span class="wr-help-tip glyphicon glyphicon-question-sign"></span>
|
|
||||||
</span>
|
|
||||||
<br>
|
|
||||||
( Should be in minutes )
|
|
||||||
</label>
|
|
||||||
<input id="windows-config-notifier-frequency" type="text" class="form-control" placeholder="[ Required Field ]">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="wifi-heading" class="panel-heading" role="tab">
|
|
||||||
<h2 class="sub-title panel-title">
|
|
||||||
End User License Agreement (EULA)
|
|
||||||
<hr>
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
<div id="wifi-body" class="panel-collapse panel-body" role="tabpanel" aria-labelledby="wifi-body">
|
|
||||||
<div class="wr-input-control">
|
|
||||||
<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">Save</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /windows -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="record-created-msg" class="container col-centered wr-content hidden">
|
|
||||||
<div class="wr-form">
|
|
||||||
<p class="page-sub-title">Configuration was saved successfully.</p>
|
|
||||||
<br>
|
|
||||||
<br>Please click <b>"Go back to configurations"</b>, if you wish to save another configuration or click
|
|
||||||
<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}}'">Exit</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /content -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{#zone "bottomJs"}}
|
|
||||||
{{js "js/platform-configuration.js"}}
|
|
||||||
{{/zone}}
|
|
@ -1,4 +0,0 @@
|
|||||||
{
|
|
||||||
"version" : "1.0.0",
|
|
||||||
"extends": "cdmf.unit.platform.configuration"
|
|
||||||
}
|
|
@ -1,856 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if provided input is valid against RegEx input.
|
|
||||||
*
|
|
||||||
* @param regExp Regular expression
|
|
||||||
* @param inputString Input string to check
|
|
||||||
* @returns {boolean} Returns true if input matches RegEx
|
|
||||||
*/
|
|
||||||
function inputIsValid(regExp, inputString) {
|
|
||||||
return regExp.test(inputString);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if an email address has the valid format or not.
|
|
||||||
*
|
|
||||||
* @param email Email address
|
|
||||||
* @returns {boolean} true if email has the valid format, otherwise false.
|
|
||||||
*/
|
|
||||||
function emailIsValid(email) {
|
|
||||||
var regExp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
|
|
||||||
return regExp.test(email);
|
|
||||||
}
|
|
||||||
|
|
||||||
var notifierTypeConstants = {
|
|
||||||
"LOCAL": "1",
|
|
||||||
"GCM": "2"
|
|
||||||
};
|
|
||||||
// Constants to define platform types available
|
|
||||||
var platformTypeConstants = {
|
|
||||||
"ANDROID": "android",
|
|
||||||
"IOS": "ios",
|
|
||||||
"WINDOWS": "windows"
|
|
||||||
};
|
|
||||||
|
|
||||||
var responseCodes = {
|
|
||||||
"CREATED": "Created",
|
|
||||||
"SUCCESS": "201",
|
|
||||||
"INTERNAL_SERVER_ERROR": "Internal Server Error"
|
|
||||||
};
|
|
||||||
|
|
||||||
var configParams = {
|
|
||||||
"NOTIFIER_TYPE": "notifierType",
|
|
||||||
"NOTIFIER_FREQUENCY": "notifierFrequency",
|
|
||||||
"GCM_API_KEY": "gcmAPIKey",
|
|
||||||
"GCM_SENDER_ID": "gcmSenderId",
|
|
||||||
"ANDROID_EULA": "androidEula",
|
|
||||||
"IOS_EULA": "iosEula",
|
|
||||||
"CONFIG_COUNTRY": "configCountry",
|
|
||||||
"CONFIG_STATE": "configState",
|
|
||||||
"CONFIG_LOCALITY": "configLocality",
|
|
||||||
"CONFIG_ORGANIZATION": "configOrganization",
|
|
||||||
"CONFIG_ORGANIZATION_UNIT": "configOrganizationUnit",
|
|
||||||
"MDM_CERT_PASSWORD": "MDMCertPassword",
|
|
||||||
"MDM_CERT_TOPIC_ID": "MDMCertTopicID",
|
|
||||||
"APNS_CERT_PASSWORD": "APNSCertPassword",
|
|
||||||
"MDM_CERT": "MDMCert",
|
|
||||||
"MDM_CERT_NAME": "MDMCertName",
|
|
||||||
"APNS_CERT": "APNSCert",
|
|
||||||
"APNS_CERT_NAME": "APNSCertName",
|
|
||||||
"ORG_DISPLAY_NAME": "organizationDisplayName",
|
|
||||||
"GENERAL_EMAIL_HOST": "emailHost",
|
|
||||||
"GENERAL_EMAIL_PORT": "emailPort",
|
|
||||||
"GENERAL_EMAIL_USERNAME": "emailUsername",
|
|
||||||
"GENERAL_EMAIL_PASSWORD": "emailPassword",
|
|
||||||
"GENERAL_EMAIL_SENDER_ADDRESS": "emailSender",
|
|
||||||
"GENERAL_EMAIL_TEMPLATE": "emailTemplate",
|
|
||||||
"COMMON_NAME": "commonName",
|
|
||||||
"KEYSTORE_PASSWORD": "keystorePassword",
|
|
||||||
"PRIVATE_KEY_PASSWORD": "privateKeyPassword",
|
|
||||||
"BEFORE_EXPIRE": "beforeExpire",
|
|
||||||
"AFTER_EXPIRE": "afterExpire",
|
|
||||||
"WINDOWS_EULA": "windowsLicense"
|
|
||||||
};
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
$("#gcm-inputs").hide();
|
|
||||||
tinymce.init({
|
|
||||||
selector: "textarea",
|
|
||||||
theme: "modern",
|
|
||||||
plugins: [
|
|
||||||
"advlist autolink lists link image charmap print preview anchor",
|
|
||||||
"searchreplace visualblocks code fullscreen",
|
|
||||||
"insertdatetime image table contextmenu paste"
|
|
||||||
],
|
|
||||||
toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
|
|
||||||
});
|
|
||||||
|
|
||||||
var getAndroidConfigAPI = "/mdm-android-agent/configuration";
|
|
||||||
var getGeneralConfigAPI = "/devicemgt_admin/configuration";
|
|
||||||
var getIosConfigAPI = "/ios/configuration";
|
|
||||||
var getWindowsConfigAPI = "/mdm-windows-agent/services/configuration";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Following requests would execute
|
|
||||||
* on page load event of platform configuration page in WSO2 EMM Console.
|
|
||||||
* Upon receiving the response, the parameters will be set to the fields,
|
|
||||||
* in case those configurations are already set.
|
|
||||||
*/
|
|
||||||
invokerUtil.get(
|
|
||||||
getAndroidConfigAPI,
|
|
||||||
|
|
||||||
function (data) {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if (data != null && data.configuration != null) {
|
|
||||||
for (var i = 0; i < data.configuration.length; i++) {
|
|
||||||
var config = data.configuration[i];
|
|
||||||
if(config.name == configParams["NOTIFIER_TYPE"]){
|
|
||||||
$("#android-config-notifier").val(config.value);
|
|
||||||
if(config.value != notifierTypeConstants["GCM"] ) {
|
|
||||||
$("#gcm-inputs").hide();
|
|
||||||
}else{
|
|
||||||
$("#gcm-inputs").show();
|
|
||||||
}
|
|
||||||
} else if(config.name == configParams["NOTIFIER_FREQUENCY"]){
|
|
||||||
$("input#android-config-notifier-frequency").val(config.value);
|
|
||||||
} else if(config.name == configParams["GCM_API_KEY"]){
|
|
||||||
$("input#android-config-gcm-api-key").val(config.value);
|
|
||||||
} else if(config.name == configParams["GCM_SENDER_ID"]){
|
|
||||||
$("input#android-config-gcm-sender-id").val(config.value);
|
|
||||||
} else if(config.name == configParams["ANDROID_EULA"]){
|
|
||||||
$("#android-eula").val(config.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, function () {
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
invokerUtil.get(
|
|
||||||
getGeneralConfigAPI,
|
|
||||||
|
|
||||||
function (data) {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if (data != null && data.configuration != null) {
|
|
||||||
for (var i = 0; i < data.configuration.length; i++) {
|
|
||||||
var config = data.configuration[i];
|
|
||||||
if(config.name == configParams["NOTIFIER_FREQUENCY"]){
|
|
||||||
$("input#monitoring-config-frequency").val(config.value);
|
|
||||||
}
|
|
||||||
/*if(config.name == configParams["GENERAL_EMAIL_HOST"]){
|
|
||||||
$("input#email-config-host").val(config.value);
|
|
||||||
} else if(config.name == configParams["GENERAL_EMAIL_PORT"]){
|
|
||||||
$("input#email-config-port").val(config.value);
|
|
||||||
} else if(config.name == configParams["GENERAL_EMAIL_USERNAME"]){
|
|
||||||
$("input#email-config-username").val(config.value);
|
|
||||||
} else if(config.name == configParams["GENERAL_EMAIL_PASSWORD"]){
|
|
||||||
$("input#email-config-password").val(config.value);
|
|
||||||
} else if(config.name == configParams["GENERAL_EMAIL_SENDER_ADDRESS"]){
|
|
||||||
$("input#email-config-sender-email").val(config.value);
|
|
||||||
} else if(config.name == configParams["GENERAL_EMAIL_TEMPLATE"]){
|
|
||||||
$("input#email-config-template").val(config.value);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, function () {
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
invokerUtil.get(
|
|
||||||
getIosConfigAPI,
|
|
||||||
|
|
||||||
function (data) {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if (data != null && data.configuration != null) {
|
|
||||||
for (var i = 0; i < data.configuration.length; i++) {
|
|
||||||
var config = data.configuration[i];
|
|
||||||
if(config.name == configParams["CONFIG_COUNTRY"]){
|
|
||||||
$("input#ios-config-country").val(config.value);
|
|
||||||
} else if(config.name == configParams["CONFIG_STATE"]){
|
|
||||||
$("input#ios-config-state").val(config.value);
|
|
||||||
} else if(config.name == configParams["CONFIG_LOCALITY"]){
|
|
||||||
$("input#ios-config-locality").val(config.value);
|
|
||||||
} else if(config.name == configParams["CONFIG_ORGANIZATION"]){
|
|
||||||
$("input#ios-config-organization").val(config.value);
|
|
||||||
} else if(config.name == configParams["CONFIG_ORGANIZATION_UNIT"]){
|
|
||||||
$("input#ios-config-organization-unit").val(config.value);
|
|
||||||
} else if(config.name == configParams["MDM_CERT_PASSWORD"]){
|
|
||||||
$("input#ios-config-mdm-certificate-password").val(config.value);
|
|
||||||
} else if(config.name == configParams["MDM_CERT_TOPIC_ID"]){
|
|
||||||
$("input#ios-config-mdm-certificate-topic-id").val(config.value);
|
|
||||||
} else if(config.name == configParams["APNS_CERT_PASSWORD"]){
|
|
||||||
$("input#ios-config-apns-certificate-password").val(config.value);
|
|
||||||
} else if(config.name == configParams["MDM_CERT_NAME"]){
|
|
||||||
$("#mdm-cert-file-name").html(config.value);
|
|
||||||
} else if(config.name == configParams["APNS_CERT_NAME"]){
|
|
||||||
$("#apns-cert-file-name").html(config.value);
|
|
||||||
} else if(config.name == configParams["ORG_DISPLAY_NAME"]){
|
|
||||||
$("input#ios-org-display-name").val(config.value);
|
|
||||||
} else if(config.name == configParams["IOS_EULA"]){
|
|
||||||
$("#ios-eula").val(config.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, function () {
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
invokerUtil.get(
|
|
||||||
getWindowsConfigAPI,
|
|
||||||
|
|
||||||
function (data) {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if (data != null && data.configuration != null) {
|
|
||||||
for (var i = 0; i < data.configuration.length; i++) {
|
|
||||||
var config = data.configuration[i];
|
|
||||||
if(config.name == configParams["NOTIFIER_FREQUENCY"]) {
|
|
||||||
$("input#windows-config-notifier-frequency").val(config.value);
|
|
||||||
} else if(config.name == configParams["WINDOWS_EULA"]) {
|
|
||||||
$("#windows-eula").val(config.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, function () {
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
$("select.select2[multiple=multiple]").select2({
|
|
||||||
tags : true
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#android-config-notifier").change(function() {
|
|
||||||
var notifierType = $("#android-config-notifier").find("option:selected").attr("value");
|
|
||||||
if(notifierType != notifierTypeConstants["GCM"] ) {
|
|
||||||
$("#gcm-inputs").hide();
|
|
||||||
$("#local-inputs").show();
|
|
||||||
}else{
|
|
||||||
$("#local-inputs").hide();
|
|
||||||
$("#gcm-inputs").show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* Following click function would execute
|
|
||||||
* when a user clicks on "Save" button
|
|
||||||
* on Android platform configuration page in WSO2 EMM Console.
|
|
||||||
*/
|
|
||||||
$("button#save-android-btn").click(function() {
|
|
||||||
var notifierType = $("#android-config-notifier").find("option:selected").attr("value");
|
|
||||||
var notifierFrequency = $("input#android-config-notifier-frequency").val();
|
|
||||||
var gcmAPIKey = $("input#android-config-gcm-api-key").val();
|
|
||||||
var gcmSenderId = $("input#android-config-gcm-sender-id").val();
|
|
||||||
var androidLicense = tinymce.get('android-eula').getContent();
|
|
||||||
|
|
||||||
var errorMsgWrapper = "#android-config-error-msg";
|
|
||||||
var errorMsg = "#android-config-error-msg span";
|
|
||||||
if (!notifierFrequency) {
|
|
||||||
$(errorMsg).text("Notifier frequency is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!$.isNumeric(notifierFrequency)) {
|
|
||||||
$(errorMsg).text("Provided notifier frequency is invalid. Please check.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (notifierType == notifierTypeConstants["GCM"] && !gcmAPIKey) {
|
|
||||||
$(errorMsg).text("GCM API Key is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (notifierType == notifierTypeConstants["GCM"] && !gcmSenderId) {
|
|
||||||
$(errorMsg).text("GCM Sender ID is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else {
|
|
||||||
|
|
||||||
var addConfigFormData = {};
|
|
||||||
var configList = new Array();
|
|
||||||
|
|
||||||
var type = {
|
|
||||||
"name": configParams["NOTIFIER_TYPE"],
|
|
||||||
"value": notifierType,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var frequency = {
|
|
||||||
"name": configParams["NOTIFIER_FREQUENCY"],
|
|
||||||
"value": notifierFrequency,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var gcmKey = {
|
|
||||||
"name": configParams["GCM_API_KEY"],
|
|
||||||
"value": gcmAPIKey,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var gcmId = {
|
|
||||||
"name": configParams["GCM_SENDER_ID"],
|
|
||||||
"value": gcmSenderId,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var androidEula = {
|
|
||||||
"name": configParams["ANDROID_EULA"],
|
|
||||||
"value": androidLicense,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
configList.push(type);
|
|
||||||
configList.push(frequency);
|
|
||||||
configList.push(androidEula);
|
|
||||||
if (notifierType == notifierTypeConstants["GCM"]) {
|
|
||||||
configList.push(gcmKey);
|
|
||||||
configList.push(gcmId);
|
|
||||||
}
|
|
||||||
|
|
||||||
addConfigFormData.type = platformTypeConstants["ANDROID"];
|
|
||||||
addConfigFormData.configuration = configList;
|
|
||||||
|
|
||||||
var addConfigAPI = "/mdm-android-agent/configuration";
|
|
||||||
|
|
||||||
invokerUtil.post(
|
|
||||||
addConfigAPI,
|
|
||||||
addConfigFormData,
|
|
||||||
function (data) {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if (data.responseCode == responseCodes["CREATED"]) {
|
|
||||||
$("#config-save-form").addClass("hidden");
|
|
||||||
$("#record-created-msg").removeClass("hidden");
|
|
||||||
} else if (data == 500) {
|
|
||||||
$(errorMsg).text("Exception occurred at backend.");
|
|
||||||
} else if (data == 403) {
|
|
||||||
$(errorMsg).text("Action was not permitted.");
|
|
||||||
} else {
|
|
||||||
$(errorMsg).text("An unexpected error occurred.");
|
|
||||||
}
|
|
||||||
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}, function () {
|
|
||||||
$(errorMsg).text("An unexpected error occurred.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Following click function would execute
|
|
||||||
* when a user clicks on "Save" button
|
|
||||||
* on General platform configuration page in WSO2 EMM Console.
|
|
||||||
*/
|
|
||||||
$("button#save-general-btn").click(function() {
|
|
||||||
var notifierFrequency = $("input#monitoring-config-frequency").val();
|
|
||||||
/*var emailHost = $("input#email-config-host").val();
|
|
||||||
var emailPort = $("input#email-config-port").val();
|
|
||||||
var emailUsername = $("input#email-config-username").val();
|
|
||||||
var emailPassword = $("input#email-config-password").val();
|
|
||||||
var emailSenderAddress = $("input#email-config-sender-email").val();
|
|
||||||
var emailTemplate = $("input#email-config-template").val();*/
|
|
||||||
|
|
||||||
var errorMsgWrapper = "#email-config-error-msg";
|
|
||||||
var errorMsg = "#email-config-error-msg span";
|
|
||||||
|
|
||||||
if (!notifierFrequency) {
|
|
||||||
$(errorMsg).text("Monitoring frequency is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!$.isNumeric(notifierFrequency)) {
|
|
||||||
$(errorMsg).text("Provided monitoring frequency is invalid. It must be a number.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else {
|
|
||||||
|
|
||||||
var addConfigFormData = {};
|
|
||||||
var configList = new Array();
|
|
||||||
|
|
||||||
var monitorFrequency = {
|
|
||||||
"name": configParams["NOTIFIER_FREQUENCY"],
|
|
||||||
"value": notifierFrequency,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
/*if (!emailHost) {
|
|
||||||
$(errorMsg).text("Email Host is a required field. It cannot be empty.");
|
|
||||||
//$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!notifierFrequency) {
|
|
||||||
$(errorMsg).text("Monitoring frequency is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!$.isNumeric(notifierFrequency)) {
|
|
||||||
$(errorMsg).text("Provided monitoring frequency is invalid. It must be a number.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}else if (!emailPort) {
|
|
||||||
$(errorMsg).text("Email Port is a required field. It cannot be empty.");
|
|
||||||
//$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!emailUsername) {
|
|
||||||
$(errorMsg).text("Username is a required field. It cannot be empty.");
|
|
||||||
//$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!emailPassword) {
|
|
||||||
$(errorMsg).text("Password is a required field. It cannot be empty.");
|
|
||||||
//$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!emailSenderAddress) {
|
|
||||||
$(errorMsg).text("Sender Email Address is a required field. It cannot be empty.");
|
|
||||||
//$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!emailIsValid(emailSenderAddress)) {
|
|
||||||
$(errorMsg).text("Provided sender email is invalid. Please check.");
|
|
||||||
//$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} */
|
|
||||||
|
|
||||||
/*var host = {
|
|
||||||
"name": configParams["GENERAL_EMAIL_HOST"],
|
|
||||||
"value": emailHost,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var port = {
|
|
||||||
"name": configParams["GENERAL_EMAIL_PORT"],
|
|
||||||
"value": emailPort,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var username = {
|
|
||||||
"name": configParams["GENERAL_EMAIL_USERNAME"],
|
|
||||||
"value": emailUsername,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var password = {
|
|
||||||
"name": configParams["GENERAL_EMAIL_PASSWORD"],
|
|
||||||
"value": emailPassword,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var sender = {
|
|
||||||
"name": configParams["GENERAL_EMAIL_SENDER_ADDRESS"],
|
|
||||||
"value": emailSenderAddress,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var template = {
|
|
||||||
"name": configParams["GENERAL_EMAIL_TEMPLATE"],
|
|
||||||
"value": emailTemplate,
|
|
||||||
"contentType": "text"
|
|
||||||
};*/
|
|
||||||
|
|
||||||
configList.push(monitorFrequency);
|
|
||||||
/*configList.push(host);
|
|
||||||
configList.push(port);
|
|
||||||
configList.push(username);
|
|
||||||
configList.push(password);
|
|
||||||
configList.push(sender);
|
|
||||||
configList.push(template);*/
|
|
||||||
|
|
||||||
addConfigFormData.configuration = configList;
|
|
||||||
|
|
||||||
var addConfigAPI = "/devicemgt_admin/configuration";
|
|
||||||
|
|
||||||
invokerUtil.post(
|
|
||||||
addConfigAPI,
|
|
||||||
addConfigFormData,
|
|
||||||
function (data) {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if (data.statusCode == responseCodes["SUCCESS"]) {
|
|
||||||
$("#config-save-form").addClass("hidden");
|
|
||||||
$("#record-created-msg").removeClass("hidden");
|
|
||||||
} else if (data == 500) {
|
|
||||||
$(errorMsg).text("Exception occurred at backend.");
|
|
||||||
} else if (data == 403) {
|
|
||||||
$(errorMsg).text("Action was not permitted.");
|
|
||||||
} else {
|
|
||||||
$(errorMsg).text("An unexpected error occurred.");
|
|
||||||
}
|
|
||||||
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}, function () {
|
|
||||||
$(errorMsg).text("An unexpected error occurred.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var errorMsgWrapper = "#ios-config-error-msg";
|
|
||||||
var errorMsg = "#ios-config-error-msg span";
|
|
||||||
var fileTypes = ['pfx'];
|
|
||||||
var notSupportedError = false;
|
|
||||||
|
|
||||||
var base64MDMCert = "";
|
|
||||||
var fileInputMDMCert = $('#ios-config-mdm-certificate');
|
|
||||||
var fileNameMDMCert = "";
|
|
||||||
var invalidFormatMDMCert = false;
|
|
||||||
|
|
||||||
var base64APNSCert = "";
|
|
||||||
var fileInputAPNSCert = $('#ios-config-apns-certificate');
|
|
||||||
var fileNameAPNSCert = "";
|
|
||||||
var invalidFormatAPNSCert = false;
|
|
||||||
|
|
||||||
$(fileInputMDMCert).change(function() {
|
|
||||||
|
|
||||||
if (!window.File || !window.FileReader || !window.FileList || !window.Blob) {
|
|
||||||
$(errorMsg).text("The File APIs are not fully supported in this browser.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
notSupportedError = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var file = fileInputMDMCert[0].files[0];
|
|
||||||
fileNameMDMCert = file.name;
|
|
||||||
var extension = file.name.split('.').pop().toLowerCase(),
|
|
||||||
isSuccess = fileTypes.indexOf(extension) > -1;
|
|
||||||
|
|
||||||
if (isSuccess) {
|
|
||||||
var fileReader = new FileReader();
|
|
||||||
fileReader.onload = function(event) {
|
|
||||||
base64MDMCert = event.target.result;
|
|
||||||
};
|
|
||||||
fileReader.readAsDataURL(file);
|
|
||||||
invalidFormatMDMCert = false;
|
|
||||||
} else {
|
|
||||||
base64MDMCert = "";
|
|
||||||
invalidFormatMDMCert = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(fileInputAPNSCert).change(function() {
|
|
||||||
|
|
||||||
if (!window.File || !window.FileReader || !window.FileList || !window.Blob) {
|
|
||||||
$(errorMsg).text("The File APIs are not fully supported in this browser.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
notSupportedError = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var file = fileInputAPNSCert[0].files[0];
|
|
||||||
fileNameAPNSCert = file.name;
|
|
||||||
var extension = file.name.split('.').pop().toLowerCase(),
|
|
||||||
isSuccess = fileTypes.indexOf(extension) > -1;
|
|
||||||
|
|
||||||
if (isSuccess) {
|
|
||||||
var fileReader = new FileReader();
|
|
||||||
fileReader.onload = function(event) {
|
|
||||||
base64APNSCert = event.target.result;
|
|
||||||
};
|
|
||||||
fileReader.readAsDataURL(file);
|
|
||||||
invalidFormatAPNSCert = false;
|
|
||||||
} else {
|
|
||||||
base64MDMCert = "";
|
|
||||||
invalidFormatAPNSCert = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("button#save-ios-btn").click(function() {
|
|
||||||
|
|
||||||
var configCountry = $("#ios-config-country").val();
|
|
||||||
var configState = $("#ios-config-state").val();
|
|
||||||
var configLocality = $("#ios-config-locality").val();
|
|
||||||
var configOrganization = $("#ios-config-organization").val();
|
|
||||||
var configOrganizationUnit = $("#ios-config-organization-unit").val();
|
|
||||||
var MDMCertPassword = $("#ios-config-mdm-certificate-password").val();
|
|
||||||
var MDMCertTopicID = $("#ios-config-mdm-certificate-topic-id").val();
|
|
||||||
var APNSCertPassword = $("#ios-config-apns-certificate-password").val();
|
|
||||||
var configOrgDisplayName = $("#ios-org-display-name").val();
|
|
||||||
var iosLicense = tinymce.get('ios-eula').getContent();
|
|
||||||
|
|
||||||
if (!configCountry) {
|
|
||||||
$(errorMsg).text("SCEP country is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!configState) {
|
|
||||||
$(errorMsg).text("SCEP state is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!configLocality) {
|
|
||||||
$(errorMsg).text("SCEP locality is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!configOrganization) {
|
|
||||||
$(errorMsg).text("SCEP organization is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!configOrganizationUnit) {
|
|
||||||
$(errorMsg).text("SCEP organization unit is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!MDMCertPassword) {
|
|
||||||
$(errorMsg).text("MDM certificate password is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!MDMCertTopicID) {
|
|
||||||
$(errorMsg).text("MDM certificate topic ID is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!APNSCertPassword) {
|
|
||||||
$(errorMsg).text("APNS certificate password is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if(notSupportedError) {
|
|
||||||
$(errorMsg).text("The File APIs are not fully supported in this browser.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (invalidFormatMDMCert) {
|
|
||||||
$(errorMsg).text("MDM certificate needs to be in pfx format.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (base64MDMCert == '') {
|
|
||||||
$(errorMsg).text("MDM certificate is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (invalidFormatAPNSCert) {
|
|
||||||
$(errorMsg).text("APNS certificate needs to be in pfx format.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (base64APNSCert == '') {
|
|
||||||
$(errorMsg).text("APNS certificate is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!configOrgDisplayName) {
|
|
||||||
$(errorMsg).text("Organization display name is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}
|
|
||||||
|
|
||||||
var addConfigFormData = {};
|
|
||||||
var configList = new Array();
|
|
||||||
|
|
||||||
var configCountry = {
|
|
||||||
"name": configParams["CONFIG_COUNTRY"],
|
|
||||||
"value": configCountry,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var configState = {
|
|
||||||
"name": configParams["CONFIG_STATE"],
|
|
||||||
"value": configState,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var configLocality = {
|
|
||||||
"name": configParams["CONFIG_LOCALITY"],
|
|
||||||
"value": configLocality,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var configOrganization = {
|
|
||||||
"name": configParams["CONFIG_ORGANIZATION"],
|
|
||||||
"value": configOrganization,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var configOrganizationUnit = {
|
|
||||||
"name": configParams["CONFIG_ORGANIZATION_UNIT"],
|
|
||||||
"value": configOrganizationUnit,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var MDMCertPassword = {
|
|
||||||
"name": configParams["MDM_CERT_PASSWORD"],
|
|
||||||
"value": MDMCertPassword,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var MDMCertTopicID = {
|
|
||||||
"name": configParams["MDM_CERT_TOPIC_ID"],
|
|
||||||
"value": MDMCertTopicID,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var APNSCertPassword = {
|
|
||||||
"name": configParams["APNS_CERT_PASSWORD"],
|
|
||||||
"value": APNSCertPassword,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var paramBase64MDMCert = {
|
|
||||||
"name": configParams["MDM_CERT"],
|
|
||||||
"value": base64MDMCert,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var MDMCertName = {
|
|
||||||
"name": configParams["MDM_CERT_NAME"],
|
|
||||||
"value": fileNameMDMCert,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var paramBase64APNSCert = {
|
|
||||||
"name": configParams["APNS_CERT"],
|
|
||||||
"value": base64APNSCert,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var APNSCertName = {
|
|
||||||
"name": configParams["APNS_CERT_NAME"],
|
|
||||||
"value": fileNameAPNSCert,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var paramOrganizationDisplayName = {
|
|
||||||
"name": configParams["ORG_DISPLAY_NAME"],
|
|
||||||
"value": configOrgDisplayName,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var iosEula = {
|
|
||||||
"name": configParams["IOS_EULA"],
|
|
||||||
"value": iosLicense,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
configList.push(configCountry);
|
|
||||||
configList.push(configState);
|
|
||||||
configList.push(configLocality);
|
|
||||||
configList.push(configOrganization);
|
|
||||||
configList.push(configOrganizationUnit);
|
|
||||||
configList.push(MDMCertPassword);
|
|
||||||
configList.push(MDMCertTopicID);
|
|
||||||
configList.push(APNSCertPassword);
|
|
||||||
configList.push(paramBase64MDMCert);
|
|
||||||
configList.push(MDMCertName);
|
|
||||||
configList.push(paramBase64APNSCert);
|
|
||||||
configList.push(APNSCertName);
|
|
||||||
configList.push(paramOrganizationDisplayName);
|
|
||||||
configList.push(iosEula);
|
|
||||||
|
|
||||||
addConfigFormData.type = platformTypeConstants["IOS"];
|
|
||||||
addConfigFormData.configuration = configList;
|
|
||||||
|
|
||||||
var addConfigAPI = "/ios/configuration";
|
|
||||||
|
|
||||||
invokerUtil.post(
|
|
||||||
addConfigAPI,
|
|
||||||
addConfigFormData,
|
|
||||||
function (data) {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if (data.responseCode == responseCodes["CREATED"]) {
|
|
||||||
$("#config-save-form").addClass("hidden");
|
|
||||||
$("#record-created-msg").removeClass("hidden");
|
|
||||||
} else if (data == 500) {
|
|
||||||
$(errorMsg).text("Exception occurred at backend.");
|
|
||||||
} else if (data == 400) {
|
|
||||||
$(errorMsg).text("Configurations cannot be empty.");
|
|
||||||
} else {
|
|
||||||
$(errorMsg).text("An unexpected error occurred.");
|
|
||||||
}
|
|
||||||
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}, function () {
|
|
||||||
$(errorMsg).text("An unexpected error occurred.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
var errorMsgWrapper = "#windows-config-error-msg";
|
|
||||||
var errorMsg = "#windows-config-error-msg span";
|
|
||||||
var fileTypes = ['jks'];
|
|
||||||
var notSupportedError = false;
|
|
||||||
|
|
||||||
var base64WindowsMDMCert = "";
|
|
||||||
var fileInputWindowsMDMCert = $('#windows-config-mdm-certificate');
|
|
||||||
var fileNameWindowsMDMCert = "";
|
|
||||||
var invalidFormatWindowsMDMCert = false;
|
|
||||||
|
|
||||||
$(fileInputWindowsMDMCert).change(function() {
|
|
||||||
|
|
||||||
if (!window.File || !window.FileReader || !window.FileList || !window.Blob) {
|
|
||||||
$(errorMsg).text("The File APIs are not fully supported in this browser.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
notSupportedError = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var file = fileInputWindowsMDMCert[0].files[0];
|
|
||||||
fileNameWindowsMDMCert = file.name;
|
|
||||||
var extension = file.name.split('.').pop().toLowerCase(),
|
|
||||||
isSuccess = fileTypes.indexOf(extension) > -1;
|
|
||||||
|
|
||||||
if (isSuccess) {
|
|
||||||
var fileReader = new FileReader();
|
|
||||||
fileReader.onload = function(event) {
|
|
||||||
base64WindowsMDMCert = event.target.result;
|
|
||||||
};
|
|
||||||
fileReader.readAsDataURL(file);
|
|
||||||
invalidFormatWindowsMDMCert = false;
|
|
||||||
} else {
|
|
||||||
base64MDMCert = "";
|
|
||||||
invalidFormatWindowsMDMCert = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$("button#save-windows-btn").click(function() {
|
|
||||||
|
|
||||||
var notifierFrequency = $("#windows-config-notifier-frequency").val();
|
|
||||||
var windowsLicense = tinymce.get('windows-eula').getContent();
|
|
||||||
|
|
||||||
if (!notifierFrequency) {
|
|
||||||
$(errorMsg).text("Notifier Frequency is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if (!windowsLicense) {
|
|
||||||
$(errorMsg).text("License is a required field. It cannot be empty.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
} else if(!$.isNumeric(notifierFrequency)){
|
|
||||||
$(errorMsg).text("Provided Notifier frequency is invalid. It must be a number.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}
|
|
||||||
|
|
||||||
var addConfigFormData = {};
|
|
||||||
var configList = new Array();
|
|
||||||
|
|
||||||
var paramNotifierFrequency = {
|
|
||||||
"name": configParams["NOTIFIER_FREQUENCY"],
|
|
||||||
"value": notifierFrequency,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
var windowsEula = {
|
|
||||||
"name": configParams["WINDOWS_EULA"],
|
|
||||||
"value": windowsLicense,
|
|
||||||
"contentType": "text"
|
|
||||||
};
|
|
||||||
|
|
||||||
configList.push(paramNotifierFrequency);
|
|
||||||
configList.push(windowsEula);
|
|
||||||
|
|
||||||
addConfigFormData.type = platformTypeConstants["WINDOWS"];
|
|
||||||
addConfigFormData.configuration = configList;
|
|
||||||
|
|
||||||
var addConfigAPI = "/mdm-windows-agent/services/configuration";
|
|
||||||
|
|
||||||
invokerUtil.post(
|
|
||||||
addConfigAPI,
|
|
||||||
addConfigFormData,
|
|
||||||
function (data) {
|
|
||||||
data = JSON.parse(data);
|
|
||||||
if (data.responseCode == responseCodes["CREATED"]) {
|
|
||||||
$("#config-save-form").addClass("hidden");
|
|
||||||
$("#record-created-msg").removeClass("hidden");
|
|
||||||
} else if (data == 500) {
|
|
||||||
$(errorMsg).text("Exception occurred at backend.");
|
|
||||||
} else if (data == 400) {
|
|
||||||
$(errorMsg).text("Configurations cannot be empty.");
|
|
||||||
} else {
|
|
||||||
$(errorMsg).text("An unexpected error occurred.");
|
|
||||||
}
|
|
||||||
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}, function () {
|
|
||||||
$(errorMsg).text("An unexpected error occurred.");
|
|
||||||
$(errorMsgWrapper).removeClass("hidden");
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Start of HTML embedded invoke methods
|
|
||||||
var showAdvanceOperation = function (operation, button) {
|
|
||||||
$(button).addClass('selected');
|
|
||||||
$(button).siblings().removeClass('selected');
|
|
||||||
var hiddenOperation = ".wr-hidden-operations-content > div";
|
|
||||||
$(hiddenOperation + '[data-operation="' + operation + '"]').show();
|
|
||||||
$(hiddenOperation + '[data-operation="' + operation + '"]').siblings().hide();
|
|
||||||
};
|
|
@ -1,5 +0,0 @@
|
|||||||
{{unit "cdmf.unit.ui.title" pageTitle="Platform Configuration"}}
|
|
||||||
|
|
||||||
{{#zone "content"}}
|
|
||||||
{{unit "cdmf.unit.platform.configuration"}}
|
|
||||||
{{/zone}}
|
|
@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "1.0.0",
|
|
||||||
"uri": "/platform-configuration",
|
|
||||||
"layout": "cdmf.layout.default"
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class for dis-enrollment operation
|
|
||||||
*/
|
|
||||||
public class Disenrollment implements Serializable {
|
|
||||||
|
|
||||||
private boolean enabled;
|
|
||||||
|
|
||||||
public boolean isEnabled() {
|
|
||||||
return enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnabled(boolean enabled) {
|
|
||||||
this.enabled = enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isEnable() {
|
|
||||||
return enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans;
|
|
||||||
|
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.services.syncml.beans.BasicOperation;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class for set basic operations.
|
|
||||||
*/
|
|
||||||
public class OperationRequest {
|
|
||||||
|
|
||||||
private List<Device> deviceList;
|
|
||||||
private BasicOperation basicOperation;
|
|
||||||
|
|
||||||
public BasicOperation getBasicOperation() {
|
|
||||||
return basicOperation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBasicOperation(BasicOperation basicOperation) {
|
|
||||||
this.basicOperation = basicOperation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Device> getDeviceList() {
|
|
||||||
return deviceList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeviceList(List<Device> deviceList) {
|
|
||||||
this.deviceList = deviceList;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This bean class is for credentials coming from wab page at federated authentication step.
|
|
||||||
*/
|
|
||||||
public class OperationResponse {
|
|
||||||
|
|
||||||
private String errorCode;
|
|
||||||
private String statusCode;
|
|
||||||
|
|
||||||
public OperationResponse() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getErrorCode() {
|
|
||||||
return errorCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatusCode() {
|
|
||||||
return statusCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setErrorCode(String errorCode) {
|
|
||||||
this.errorCode = errorCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatusCode(String statusCode) {
|
|
||||||
this.statusCode = statusCode;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class represents the information of encrypt operation.
|
|
||||||
*/
|
|
||||||
public class StorageEncryption implements Serializable {
|
|
||||||
private boolean encrypted;
|
|
||||||
|
|
||||||
public boolean isEncrypted() {
|
|
||||||
return encrypted;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEncrypted(boolean encrypted) {
|
|
||||||
this.encrypted = encrypted;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans.wrapper;
|
|
||||||
|
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans.Disenrollment;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class is used to wrap dis-enrollment bean with the device
|
|
||||||
*/
|
|
||||||
public class DisenrollmentBeanWrapper {
|
|
||||||
|
|
||||||
private Disenrollment operation;
|
|
||||||
|
|
||||||
private List<String> deviceId;
|
|
||||||
|
|
||||||
public Disenrollment getOperation() {
|
|
||||||
return operation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOperation(Disenrollment operation) {
|
|
||||||
this.operation = operation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getDeviceId() {
|
|
||||||
return deviceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeviceId(List<String> deviceId) {
|
|
||||||
this.deviceId = deviceId;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans.wrapper;
|
|
||||||
|
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans.StorageEncryption;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class is used to wrap the Encrypt bean with devices.
|
|
||||||
*/
|
|
||||||
public class EncryptBeanWrapper {
|
|
||||||
|
|
||||||
private StorageEncryption operation;
|
|
||||||
private List<String> deviceIDs;
|
|
||||||
|
|
||||||
public StorageEncryption getOperation() {
|
|
||||||
return operation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOperation(StorageEncryption operation) {
|
|
||||||
this.operation = operation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getDeviceIDs() {
|
|
||||||
return deviceIDs;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeviceIDs(List<String> deviceIDs) {
|
|
||||||
this.deviceIDs = deviceIDs;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,112 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.util;
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
|
||||||
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
|
||||||
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
|
||||||
import org.wso2.carbon.device.mgt.core.operation.mgt.ConfigOperation;
|
|
||||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.SyncmlCommandType;
|
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsDeviceEnrolmentException;
|
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans.Device;
|
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.services.adminoperations.beans.OperationRequest;
|
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.services.syncml.beans.Wifi;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class OperationStore {
|
|
||||||
|
|
||||||
private static Log log = LogFactory.getLog(OperationStore.class);
|
|
||||||
|
|
||||||
public static boolean storeOperation(OperationRequest operationRequest, Operation.Type type,
|
|
||||||
String commandType) throws
|
|
||||||
WindowsDeviceEnrolmentException {
|
|
||||||
|
|
||||||
List<Device> devices = operationRequest.getDeviceList();
|
|
||||||
List<DeviceIdentifier> deviceIdentifiers = new ArrayList<DeviceIdentifier>();
|
|
||||||
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
|
|
||||||
|
|
||||||
Operation operation = transformBasicOperation(operationRequest, type, commandType);
|
|
||||||
|
|
||||||
for (int i = 0; i < devices.size(); i++) {
|
|
||||||
try {
|
|
||||||
deviceIdentifier.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
|
||||||
deviceIdentifier.setId(devices.get(i).getID());
|
|
||||||
deviceIdentifiers.add(deviceIdentifier);
|
|
||||||
getDeviceManagementServiceProvider().getDevice(deviceIdentifier);
|
|
||||||
|
|
||||||
} catch (DeviceManagementException e) {
|
|
||||||
log.error("Cannot validate device ID: " + devices.get(i).getID());
|
|
||||||
deviceIdentifiers.remove(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
getDeviceManagementServiceProvider().addOperation(operation, deviceIdentifiers);
|
|
||||||
} catch (OperationManagementException e) {
|
|
||||||
String msg = "Failure occurred while storing command operation.";
|
|
||||||
log.error(msg);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static DeviceManagementProviderService getDeviceManagementServiceProvider() {
|
|
||||||
DeviceManagementProviderService deviceManager;
|
|
||||||
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
|
||||||
deviceManager =
|
|
||||||
(DeviceManagementProviderService) ctx.getOSGiService(DeviceManagementProviderService.class, null);
|
|
||||||
|
|
||||||
if (deviceManager == null) {
|
|
||||||
String msg = "Device management service is not initialized.";
|
|
||||||
log.error(msg);
|
|
||||||
}
|
|
||||||
return deviceManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Operation transformBasicOperation(OperationRequest operationRequest, Operation.Type type,
|
|
||||||
String commandType) throws WindowsDeviceEnrolmentException {
|
|
||||||
|
|
||||||
Operation operation = new Operation();
|
|
||||||
operation.setCode(commandType);
|
|
||||||
operation.setType(type);
|
|
||||||
Gson gson = new Gson();
|
|
||||||
|
|
||||||
if (commandType == SyncmlCommandType.WIFI.getValue()) {
|
|
||||||
|
|
||||||
operation = new ConfigOperation();
|
|
||||||
operation.setCode(commandType);
|
|
||||||
operation.setType(type);
|
|
||||||
|
|
||||||
Wifi wifiObject = (Wifi) operationRequest.getBasicOperation();
|
|
||||||
operation.setPayLoad(gson.toJson(wifiObject));
|
|
||||||
} else {
|
|
||||||
// no operation.....
|
|
||||||
}
|
|
||||||
|
|
||||||
return operation;
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,181 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.wso2.carbon.mdm.mobileservices.windows.services.configurationmgtservice.impl;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
||||||
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
||||||
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.TenantConfiguration;
|
||||||
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.common.PluginConstants;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.common.util.WindowsAPIUtils;
|
||||||
|
|
||||||
|
import javax.jws.WebService;
|
||||||
|
import javax.ws.rs.*;
|
||||||
|
import javax.ws.rs.core.Response;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Windows Platform Configuration REST-API implementation.
|
||||||
|
* All end points supports JSON, XMl with content negotiation.
|
||||||
|
*/
|
||||||
|
@WebService
|
||||||
|
@Produces({"application/json", "application/xml"})
|
||||||
|
@Consumes({"application/json", "application/xml"})
|
||||||
|
public class ConfigurationMgtServiceImpl {
|
||||||
|
|
||||||
|
private static Log log = LogFactory.getLog(ConfigurationMgtServiceImpl.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save Tenant configurations.
|
||||||
|
*
|
||||||
|
* @param configuration Tenant Configurations to be saved.
|
||||||
|
* @return Message type object for the provide save status.
|
||||||
|
* @throws WindowsConfigurationException
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
public Message ConfigureSettings(TenantConfiguration configuration) throws WindowsConfigurationException {
|
||||||
|
Message responseMsg = new Message();
|
||||||
|
ConfigurationEntry licenseEntry = null;
|
||||||
|
String message;
|
||||||
|
|
||||||
|
try {
|
||||||
|
configuration.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
|
if (!configuration.getConfiguration().isEmpty()) {
|
||||||
|
List<ConfigurationEntry> configs = configuration.getConfiguration();
|
||||||
|
for (ConfigurationEntry entry : configs) {
|
||||||
|
if (PluginConstants.TenantConfigProperties.LICENSE_KEY.equals(entry.getName())) {
|
||||||
|
License license = new License();
|
||||||
|
license.setName(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
|
license.setLanguage(PluginConstants.TenantConfigProperties.LANGUAGE_US);
|
||||||
|
license.setVersion("1.0.0");
|
||||||
|
license.setText(entry.getValue().toString());
|
||||||
|
WindowsAPIUtils.getDeviceManagementService().addLicense(DeviceManagementConstants.
|
||||||
|
MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS, license);
|
||||||
|
licenseEntry = entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (licenseEntry != null) {
|
||||||
|
configs.remove(licenseEntry);
|
||||||
|
}
|
||||||
|
configuration.setConfiguration(configs);
|
||||||
|
WindowsAPIUtils.getDeviceManagementService().saveConfiguration(configuration);
|
||||||
|
Response.status(Response.Status.CREATED);
|
||||||
|
responseMsg.setResponseMessage("Windows platform configuration saved successfully.");
|
||||||
|
responseMsg.setResponseCode(Response.Status.CREATED.toString());
|
||||||
|
return responseMsg;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Response.status(Response.Status.BAD_REQUEST);
|
||||||
|
responseMsg.setResponseMessage("Windows platform configuration can not be saved.");
|
||||||
|
responseMsg.setResponseCode(Response.Status.CREATED.toString());
|
||||||
|
}
|
||||||
|
} catch (DeviceManagementException e) {
|
||||||
|
message = "Error Occurred in while configuring Windows Platform.";
|
||||||
|
log.error(message, e);
|
||||||
|
throw new WindowsConfigurationException(message, e);
|
||||||
|
}
|
||||||
|
return responseMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve Tenant configurations according to the device type.
|
||||||
|
*
|
||||||
|
* @return Tenant configuration object contains specific tenant configurations.
|
||||||
|
* @throws WindowsConfigurationException
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
public TenantConfiguration getConfiguration() throws WindowsConfigurationException {
|
||||||
|
String msg;
|
||||||
|
TenantConfiguration tenantConfiguration = null;
|
||||||
|
try {
|
||||||
|
if (WindowsAPIUtils.getDeviceManagementService().
|
||||||
|
getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS) != null) {
|
||||||
|
tenantConfiguration = WindowsAPIUtils.getDeviceManagementService().
|
||||||
|
getConfiguration(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
|
List<ConfigurationEntry> configs = tenantConfiguration.getConfiguration();
|
||||||
|
ConfigurationEntry entry = new ConfigurationEntry();
|
||||||
|
License license = WindowsAPIUtils.getDeviceManagementService().getLicense(
|
||||||
|
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS, PluginConstants.
|
||||||
|
TenantConfigProperties.LANGUAGE_US);
|
||||||
|
if(license != null) {
|
||||||
|
entry.setContentType(PluginConstants.TenantConfigProperties.CONTENT_TYPE_TEXT);
|
||||||
|
entry.setName(PluginConstants.TenantConfigProperties.LICENSE_KEY);
|
||||||
|
entry.setValue(license.getText());
|
||||||
|
configs.add(entry);
|
||||||
|
tenantConfiguration.setConfiguration(configs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (DeviceManagementException e) {
|
||||||
|
msg = "Error occurred while retrieving the Windows tenant configuration";
|
||||||
|
log.error(msg, e);
|
||||||
|
throw new WindowsConfigurationException(msg, e);
|
||||||
|
}
|
||||||
|
return tenantConfiguration;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update Tenant Configurations for the specific Device type.
|
||||||
|
*
|
||||||
|
* @param configuration Tenant configurations to be updated.
|
||||||
|
* @return Response message.
|
||||||
|
* @throws WindowsConfigurationException
|
||||||
|
*/
|
||||||
|
@PUT
|
||||||
|
public Message updateConfiguration(TenantConfiguration configuration) throws WindowsConfigurationException {
|
||||||
|
String message;
|
||||||
|
Message responseMsg = new Message();
|
||||||
|
ConfigurationEntry licenseEntry = null;
|
||||||
|
try {
|
||||||
|
configuration.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
|
List<ConfigurationEntry> configs = configuration.getConfiguration();
|
||||||
|
for (ConfigurationEntry entry : configs) {
|
||||||
|
if (PluginConstants.TenantConfigProperties.LICENSE_KEY.equals(entry.getName())) {
|
||||||
|
License license = new License();
|
||||||
|
license.setName(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
|
license.setLanguage(PluginConstants.TenantConfigProperties.LANGUAGE_US);
|
||||||
|
license.setVersion("1.0.0");
|
||||||
|
license.setText(entry.getValue().toString());
|
||||||
|
WindowsAPIUtils.getDeviceManagementService().addLicense(DeviceManagementConstants.
|
||||||
|
MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS, license);
|
||||||
|
licenseEntry = entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (licenseEntry != null) {
|
||||||
|
configs.remove(licenseEntry);
|
||||||
|
}
|
||||||
|
configuration.setConfiguration(configs);
|
||||||
|
WindowsAPIUtils.getDeviceManagementService().saveConfiguration(configuration);
|
||||||
|
Response.status(Response.Status.CREATED);
|
||||||
|
responseMsg.setResponseMessage("Windows platform configuration succeeded.");
|
||||||
|
responseMsg.setResponseCode(Response.Status.CREATED.toString());
|
||||||
|
} catch (DeviceManagementException e) {
|
||||||
|
message = "Error occurred while modifying configuration settings of Windows platform.";
|
||||||
|
log.error(message, e);
|
||||||
|
throw new WindowsConfigurationException(message, e);
|
||||||
|
}
|
||||||
|
return responseMsg;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,158 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.wso2.carbon.mdm.mobileservices.windows.services.devicemgtservice.impl;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
|
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
||||||
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.license.mgt.License;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.common.util.WindowsAPIUtils;
|
||||||
|
|
||||||
|
import javax.jws.WebService;
|
||||||
|
import javax.ws.rs.*;
|
||||||
|
import javax.ws.rs.core.Response;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Windows Device Management REST-API implementation.
|
||||||
|
* All end points supports JSON, XMl with content negotiation.
|
||||||
|
*/
|
||||||
|
@WebService
|
||||||
|
@Produces({"application/json", "application/xml"})
|
||||||
|
@Consumes({"application/json", "application/xml"})
|
||||||
|
public class DeviceManagementServiceImpl {
|
||||||
|
|
||||||
|
private static Log log = LogFactory.getLog(DeviceManagementServiceImpl.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all devices.Returns list of Windows devices registered in MDM.
|
||||||
|
*
|
||||||
|
* @return Device List
|
||||||
|
* @throws WindowsConfigurationException
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
public List<Device> getAllDevices()
|
||||||
|
throws WindowsConfigurationException {
|
||||||
|
String msg;
|
||||||
|
List<Device> devices;
|
||||||
|
|
||||||
|
try {
|
||||||
|
devices = WindowsAPIUtils.getDeviceManagementService().
|
||||||
|
getAllDevices(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
|
} catch (DeviceManagementException e) {
|
||||||
|
msg = "Error occurred while fetching the device list.";
|
||||||
|
log.error(msg, e);
|
||||||
|
throw new WindowsConfigurationException(msg, e);
|
||||||
|
}
|
||||||
|
return devices;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch Windows device details of a given device Id.
|
||||||
|
*
|
||||||
|
* @param id Device Id
|
||||||
|
* @return Device
|
||||||
|
* @throws WindowsConfigurationException
|
||||||
|
*/
|
||||||
|
@GET
|
||||||
|
@Path("{id}")
|
||||||
|
public Device getDevice(@PathParam("id") String id)
|
||||||
|
throws WindowsConfigurationException {
|
||||||
|
|
||||||
|
String msg;
|
||||||
|
Device device;
|
||||||
|
|
||||||
|
try {
|
||||||
|
DeviceIdentifier deviceIdentifier = WindowsAPIUtils.convertToDeviceIdentifierObject(id);
|
||||||
|
device = WindowsAPIUtils.getDeviceManagementService().getDevice(deviceIdentifier);
|
||||||
|
if (device == null) {
|
||||||
|
Response.status(Response.Status.NOT_FOUND);
|
||||||
|
}
|
||||||
|
} catch (DeviceManagementException deviceMgtEx) {
|
||||||
|
msg = "Error occurred while fetching the device information.";
|
||||||
|
log.error(msg, deviceMgtEx);
|
||||||
|
throw new WindowsConfigurationException(msg, deviceMgtEx);
|
||||||
|
}
|
||||||
|
return device;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update Windows device details of given device id.
|
||||||
|
*
|
||||||
|
* @param id Device Id
|
||||||
|
* @param device Device Details
|
||||||
|
* @return Message
|
||||||
|
* @throws WindowsConfigurationException
|
||||||
|
*/
|
||||||
|
@PUT
|
||||||
|
@Path("{id}")
|
||||||
|
public Message updateDevice(@PathParam("id") String id, Device device)
|
||||||
|
throws WindowsConfigurationException {
|
||||||
|
String msg;
|
||||||
|
Message responseMessage = new Message();
|
||||||
|
DeviceIdentifier deviceIdentifier = new DeviceIdentifier();
|
||||||
|
deviceIdentifier.setId(id);
|
||||||
|
deviceIdentifier
|
||||||
|
.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
|
boolean result;
|
||||||
|
try {
|
||||||
|
device.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS);
|
||||||
|
result = WindowsAPIUtils.getDeviceManagementService()
|
||||||
|
.updateDeviceInfo(deviceIdentifier, device);
|
||||||
|
if (result) {
|
||||||
|
Response.status(Response.Status.ACCEPTED);
|
||||||
|
responseMessage.setResponseMessage("Device information has modified successfully.");
|
||||||
|
} else {
|
||||||
|
Response.status(Response.Status.NOT_MODIFIED);
|
||||||
|
responseMessage.setResponseMessage("Device not found for the update.");
|
||||||
|
}
|
||||||
|
} catch (DeviceManagementException e) {
|
||||||
|
msg = "Error occurred while modifying the device information.";
|
||||||
|
log.error(msg, e);
|
||||||
|
throw new WindowsConfigurationException(msg, e);
|
||||||
|
}
|
||||||
|
return responseMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("license")
|
||||||
|
@Produces("application/json")
|
||||||
|
public License getLicense() throws WindowsConfigurationException {
|
||||||
|
License license;
|
||||||
|
|
||||||
|
try {
|
||||||
|
license =
|
||||||
|
WindowsAPIUtils.getDeviceManagementService().getLicense(
|
||||||
|
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS,
|
||||||
|
DeviceManagementConstants.LanguageCodes.LANGUAGE_CODE_ENGLISH_US);
|
||||||
|
} catch (DeviceManagementException e) {
|
||||||
|
String msg = "Error occurred while retrieving the license configured for Windows device enrollment";
|
||||||
|
log.error(msg, e);
|
||||||
|
throw new WindowsConfigurationException(msg, e);
|
||||||
|
}
|
||||||
|
return license;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016, 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.wso2.carbon.mdm.mobileservices.windows.services.policymgtservice.impl;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.common.util.Message;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.common.util.WindowsAPIUtils;
|
||||||
|
import org.wso2.carbon.mdm.mobileservices.windows.services.policymgtservice.PolicyMgtService;
|
||||||
|
import org.wso2.carbon.policy.mgt.common.Policy;
|
||||||
|
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
|
||||||
|
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
|
||||||
|
|
||||||
|
import javax.jws.WebService;
|
||||||
|
import javax.ws.rs.*;
|
||||||
|
import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Endpoint for Enforce Effective Policy.
|
||||||
|
*/
|
||||||
|
|
||||||
|
@WebService
|
||||||
|
@Produces({"application/json", "application/xml"})
|
||||||
|
@Consumes({"application/json", "application/xml"})
|
||||||
|
public class PolicyMgtServiceImpl implements PolicyMgtService {
|
||||||
|
private static Log log = LogFactory.getLog(PolicyMgtServiceImpl.class);
|
||||||
|
|
||||||
|
@GET
|
||||||
|
public Message getEffectivePolicy(@HeaderParam("Accept") String acceptHeader,
|
||||||
|
@PathParam("id") String id) throws WindowsConfigurationException {
|
||||||
|
|
||||||
|
DeviceIdentifier deviceIdentifier = WindowsAPIUtils.convertToDeviceIdentifierObject(id);
|
||||||
|
Message responseMessage = new Message();
|
||||||
|
Policy policy;
|
||||||
|
try {
|
||||||
|
PolicyManagerService policyManagerService = WindowsAPIUtils.getPolicyManagerService();
|
||||||
|
policy = policyManagerService.getEffectivePolicy(deviceIdentifier);
|
||||||
|
if (policy == null) {
|
||||||
|
responseMessage.setResponseCode(Response.Status.NO_CONTENT.toString());
|
||||||
|
responseMessage.setResponseMessage("No effective policy found");
|
||||||
|
return responseMessage;
|
||||||
|
} else {
|
||||||
|
responseMessage.setResponseCode(Response.Status.OK.toString());
|
||||||
|
responseMessage.setResponseMessage("Effective policy added to operation");
|
||||||
|
return responseMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (PolicyManagementException e) {
|
||||||
|
String msg = "Error occurred while getting the policy.";
|
||||||
|
log.error(msg, e);
|
||||||
|
throw new WindowsConfigurationException(msg, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.mobileservices.windows.services.syncml.util;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.exceptions.WindowsConfigurationException;
|
|
||||||
import org.wso2.carbon.mdm.mobileservices.windows.common.util.WindowsAPIUtils;
|
|
||||||
import org.wso2.carbon.policy.mgt.common.Policy;
|
|
||||||
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
|
|
||||||
import org.wso2.carbon.policy.mgt.core.PolicyManagerService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* implementation for PolicyManager
|
|
||||||
*/
|
|
||||||
public class PolicyManager {
|
|
||||||
|
|
||||||
private static Log log = LogFactory.getLog(PolicyManager.class);
|
|
||||||
|
|
||||||
public Policy getEffectivePolicy(DeviceIdentifier deviceIdentifier) throws WindowsConfigurationException {
|
|
||||||
Policy policy;
|
|
||||||
PolicyManagerService policyManagerService = WindowsAPIUtils.getPolicyManagerService();
|
|
||||||
try {
|
|
||||||
policy = policyManagerService.getEffectivePolicy(deviceIdentifier);
|
|
||||||
if (policy != null) {
|
|
||||||
return policy;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} catch (PolicyManagementException e) {
|
|
||||||
String msg = "Error occurred while getting policy.";
|
|
||||||
log.error(msg, e);
|
|
||||||
throw new WindowsConfigurationException();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2016, 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.wso2.carbon.mdm.mobileservices.windows.services.syncml.util;
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
|
||||||
import org.apache.commons.logging.LogFactory;
|
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
||||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class for generate Device object from the received data.
|
|
||||||
*/
|
|
||||||
public class SyncmlUtils {
|
|
||||||
|
|
||||||
private static Log log = LogFactory.getLog(SyncmlUtils.class);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method returns Device Management Object for certain tasks such as Device enrollment etc.
|
|
||||||
*
|
|
||||||
* @return DeviceManagementServiceObject
|
|
||||||
*/
|
|
||||||
public static DeviceManagementProviderService getDeviceManagementService() {
|
|
||||||
try {
|
|
||||||
PrivilegedCarbonContext context = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
|
||||||
|
|
||||||
return (DeviceManagementProviderService) context.getOSGiService(DeviceManagementProviderService.class,
|
|
||||||
null);
|
|
||||||
} finally {
|
|
||||||
PrivilegedCarbonContext.endTenantFlow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -0,0 +1,71 @@
|
|||||||
|
#*
|
||||||
|
Copyright (c) 2016, 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.
|
||||||
|
*#
|
||||||
|
<EmailConfig>
|
||||||
|
<Subject>You have been invited to enroll your devices in WSO2 IoT Server</Subject>
|
||||||
|
<Body>
|
||||||
|
<![CDATA[
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WSO2 IoT Server</title>
|
||||||
|
</head>
|
||||||
|
<body style="color: #666666; background-color:#cdcdcd; padding: 0px; margin: 0px;">
|
||||||
|
<div style="background-color:#cdcdcd; font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; padding: 20px 0px; margin: 0px;">
|
||||||
|
<div style="width: 86%; max-width: 650px; padding: 2%; background-color: #ffffff; margin: auto; border-radius: 14px;">
|
||||||
|
<div style="background-color: #49c8f5; line-height: 0px; border-top-left-radius: 10px; border-top-right-radius: 10px; padding: 0px 10px 0px 0px;">
|
||||||
|
<div style="display: inline-block; line-height: 0px;">
|
||||||
|
<img src="http://b.content.wso2.com/sites/all/2015-june-theme/navigation/wso2-nav-logo.png"
|
||||||
|
alt="WSO2" style="margin: 0px 20px 0px 25px; width: 100%; max-width: 251px;"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="background-color: #ffffff; line-height: 170%; color: #666666; padding: 20px 25px;">
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px 20px;">
|
||||||
|
Hi $first-name,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
You have been invited to enrol devices with WSO2 IoT Server.
|
||||||
|
Click <a href="$base-url-https/devicemgt/device/enroll">here</a> to enrol the WSO2 IoT Server devices to begin.</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
Should you need assistance, please contact your administrator.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 20px 0px 5px;">
|
||||||
|
Regards,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
WSO2 IoT Server Administrator
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div style="background-color: #333333; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||||
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 0px 20px 0px 0px;"><img
|
||||||
|
src="http://b.content.wso2.com/newsletter/images/wso2-logo-cloud-footer.png" alt="WSO2"
|
||||||
|
style="margin: 15px 0px 15px 25px; width: 100%; max-width: 258px;"/></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
]]>
|
||||||
|
</Body>
|
||||||
|
</EmailConfig>
|
@ -0,0 +1,81 @@
|
|||||||
|
#*
|
||||||
|
Copyright (c) 2016, 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.
|
||||||
|
*#
|
||||||
|
<EmailConfig>
|
||||||
|
<Subject>You have successfully been registered in WSO2 IoT Server</Subject>
|
||||||
|
<Body>
|
||||||
|
<![CDATA[
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WSO2 IoT Server</title>
|
||||||
|
</head>
|
||||||
|
<body style="color: #666666; background-color:#cdcdcd; padding: 0px; margin: 0px;">
|
||||||
|
<div style="background-color:#cdcdcd; font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; padding: 20px 0px; margin: 0px;">
|
||||||
|
<div style="width: 86%; max-width: 650px; padding: 2%; background-color: #ffffff; margin: auto; border-radius: 14px;">
|
||||||
|
<div style="background-color: #49c8f5; line-height: 0px; border-top-left-radius: 10px; border-top-right-radius: 10px; padding: 0px 10px 0px 0px;">
|
||||||
|
<div style="display: inline-block; line-height: 0px;">
|
||||||
|
<img src="http://b.content.wso2.com/sites/all/2015-june-theme/navigation/wso2-nav-logo.png"
|
||||||
|
alt="WSO2" style="margin: 0px 20px 0px 25px; width: 100%; max-width: 251px;"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="background-color: #ffffff; line-height: 170%; color: #666666; padding: 20px 25px;">
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px 20px;">
|
||||||
|
Hi $first-name,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
You have been registered in WSO2 IoT Server and invited to enrol your device.
|
||||||
|
Click <a href="$base-url-https/devicemgt/device/enroll">here</a> to enrol the WSO2 IoT Server devices to begin.</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
Use following credentials to log in to WSO2 IoT Server.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
<b>Username:</b> $username
|
||||||
|
<br/>
|
||||||
|
<b>Password:</b> $password
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
Should you need assistance, please contact your administrator.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 20px 0px 5px;">
|
||||||
|
Regards,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
WSO2 IoT Server Administrator
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div style="background-color: #333333; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||||
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 0px 20px 0px 0px;"><img
|
||||||
|
src="http://b.content.wso2.com/newsletter/images/wso2-logo-cloud-footer.png" alt="WSO2"
|
||||||
|
style="margin: 15px 0px 15px 25px; width: 100%; max-width: 258px;"/></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
]]>
|
||||||
|
</Body>
|
||||||
|
</EmailConfig>
|
@ -0,0 +1,72 @@
|
|||||||
|
#*
|
||||||
|
Copyright (c) 2016, 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.
|
||||||
|
*#
|
||||||
|
<EmailConfig>
|
||||||
|
<Subject>You have been invited to enroll your device in WSO2 EMM</Subject>
|
||||||
|
<Body>
|
||||||
|
<![CDATA[
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WSO2 Enterprise Mobility Manager</title>
|
||||||
|
</head>
|
||||||
|
<body style="color: #666666; background-color:#cdcdcd; padding: 0px; margin: 0px;">
|
||||||
|
<div style="background-color:#cdcdcd; font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; padding: 20px 0px; margin: 0px;">
|
||||||
|
<div style="width: 86%; max-width: 650px; padding: 2%; background-color: #ffffff; margin: auto; border-radius: 14px;">
|
||||||
|
<div style="background-color: #49c8f5; line-height: 0px; border-top-left-radius: 10px; border-top-right-radius: 10px; padding: 0px 10px 0px 0px;">
|
||||||
|
<div style="display: inline-block; line-height: 0px;">
|
||||||
|
<img src="http://b.content.wso2.com/sites/all/2015-june-theme/navigation/wso2-nav-logo.png"
|
||||||
|
alt="WSO2" style="margin: 0px 20px 0px 25px; width: 100%; max-width: 251px;"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="background-color: #ffffff; line-height: 170%; color: #666666; padding: 20px 25px;">
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px 20px;">
|
||||||
|
Hi $first-name,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
You have been invited to enrol your device in WSO2 Enterprise Mobility Manager.
|
||||||
|
Click <a href="$base-url-https/emm-web-agent/enrollment">here</a> to download the WSO2 EMM client application to begin device
|
||||||
|
enrolment.</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
Should you need assistance, please contact your administrator.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 20px 0px 5px;">
|
||||||
|
Regards,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
WSO2 EMM Administrator
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div style="background-color: #333333; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||||
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 0px 20px 0px 0px;"><img
|
||||||
|
src="http://b.content.wso2.com/newsletter/images/wso2-logo-cloud-footer.png" alt="WSO2"
|
||||||
|
style="margin: 15px 0px 15px 25px; width: 100%; max-width: 258px;"/></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
]]>
|
||||||
|
</Body>
|
||||||
|
</EmailConfig>
|
@ -0,0 +1,82 @@
|
|||||||
|
#*
|
||||||
|
Copyright (c) 2016, 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.
|
||||||
|
*#
|
||||||
|
<EmailConfig>
|
||||||
|
<Subject>You have successfully been registered in WSO2 EMM</Subject>
|
||||||
|
<Body>
|
||||||
|
<![CDATA[
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>WSO2 Enterprise Mobility Manager</title>
|
||||||
|
</head>
|
||||||
|
<body style="color: #666666; background-color:#cdcdcd; padding: 0px; margin: 0px;">
|
||||||
|
<div style="background-color:#cdcdcd; font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; padding: 20px 0px; margin: 0px;">
|
||||||
|
<div style="width: 86%; max-width: 650px; padding: 2%; background-color: #ffffff; margin: auto; border-radius: 14px;">
|
||||||
|
<div style="background-color: #49c8f5; line-height: 0px; border-top-left-radius: 10px; border-top-right-radius: 10px; padding: 0px 10px 0px 0px;">
|
||||||
|
<div style="display: inline-block; line-height: 0px;">
|
||||||
|
<img src="http://b.content.wso2.com/sites/all/2015-june-theme/navigation/wso2-nav-logo.png"
|
||||||
|
alt="WSO2" style="margin: 0px 20px 0px 25px; width: 100%; max-width: 251px;"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="background-color: #ffffff; line-height: 170%; color: #666666; padding: 20px 25px;">
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px 20px;">
|
||||||
|
Hi $first-name,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
You have been registered in WSO2 Enterprise Mobility Manager and invited to enrol your device.
|
||||||
|
Click <a href="$base-url-https/emm-web-agent/enrollment">here</a> to download the WSO2 EMM client application to begin device
|
||||||
|
enrolment.</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
Use following credentials to log in to WSO2 EMM client application.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
<b>Username:</b> $username
|
||||||
|
<br/>
|
||||||
|
<b>Password:</b> $password
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
Should you need assistance, please contact your administrator.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 20px 0px 5px;">
|
||||||
|
Regards,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p style="font-size: 1em; font-family: Arial, Helvetica; line-height: 170%; color: #666666; margin: 5px 0px;">
|
||||||
|
WSO2 EMM Administrator
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div style="background-color: #333333; border-bottom-left-radius: 10px; border-bottom-right-radius: 10px;">
|
||||||
|
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||||
|
<tr>
|
||||||
|
<td style="padding: 0px 20px 0px 0px;"><img
|
||||||
|
src="http://b.content.wso2.com/newsletter/images/wso2-logo-cloud-footer.png" alt="WSO2"
|
||||||
|
style="margin: 15px 0px 15px 25px; width: 100%; max-width: 258px;"/></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
]]>
|
||||||
|
</Body>
|
||||||
|
</EmailConfig>
|
Loading…
Reference in new issue