revert-70aa11f8
dilanua 8 years ago
commit 7a0e52e8f9

@ -162,7 +162,8 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
"e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.DESCRIPTION, " + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.DESCRIPTION, " +
"d.NAME, d.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE FROM DM_DEVICE d, " + "d.NAME, d.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE FROM DM_DEVICE d, " +
"DM_DEVICE_TYPE t WHERE DEVICE_TYPE_ID = t.ID AND t.NAME = ? " + "DM_DEVICE_TYPE t WHERE DEVICE_TYPE_ID = t.ID AND t.NAME = ? " +
"AND d.TENANT_ID = ?) d1 WHERE d1.ID = e.DEVICE_ID AND TENANT_ID = ? OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; "AND d.TENANT_ID = ?) d1 WHERE d1.ID = e.DEVICE_ID AND TENANT_ID = ? ORDER BY ENROLMENT_ID" +
" OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setString(1, request.getDeviceType()); stmt.setString(1, request.getDeviceType());
stmt.setInt(2, tenantId); stmt.setInt(2, tenantId);
@ -196,7 +197,7 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
"AS DEVICE_TYPE FROM DM_DEVICE d, (SELECT e.OWNER, e.OWNERSHIP, e.ID AS ENROLMENT_ID, " + "AS DEVICE_TYPE FROM DM_DEVICE d, (SELECT e.OWNER, e.OWNERSHIP, e.ID AS ENROLMENT_ID, " +
"e.DEVICE_ID, e.STATUS, e.DATE_OF_LAST_UPDATE, e.DATE_OF_ENROLMENT FROM DM_ENROLMENT e WHERE " + "e.DEVICE_ID, e.STATUS, e.DATE_OF_LAST_UPDATE, e.DATE_OF_ENROLMENT FROM DM_ENROLMENT e WHERE " +
"e.TENANT_ID = ? AND e.OWNER = ?) e1, DM_DEVICE_TYPE t WHERE d.ID = e1.DEVICE_ID " + "e.TENANT_ID = ? AND e.OWNER = ?) e1, DM_DEVICE_TYPE t WHERE d.ID = e1.DEVICE_ID " +
"AND t.ID = d.DEVICE_TYPE_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; "AND t.ID = d.DEVICE_TYPE_ID ORDER BY ENROLMENT_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);
stmt.setString(2, request.getOwner()); stmt.setString(2, request.getOwner());
@ -230,7 +231,8 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
"e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.NAME, " + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.NAME, " +
"d.DESCRIPTION, t.NAME AS DEVICE_TYPE, d.DEVICE_IDENTIFICATION FROM DM_DEVICE d, " + "d.DESCRIPTION, t.NAME AS DEVICE_TYPE, d.DEVICE_IDENTIFICATION FROM DM_DEVICE d, " +
"DM_DEVICE_TYPE t WHERE d.DEVICE_TYPE_ID = t.ID AND d.NAME LIKE ? AND d.TENANT_ID = ?) d1 " + "DM_DEVICE_TYPE t WHERE d.DEVICE_TYPE_ID = t.ID AND d.NAME LIKE ? AND d.TENANT_ID = ?) d1 " +
"WHERE DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ? OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; "WHERE DEVICE_ID = e.DEVICE_ID AND TENANT_ID = ? ORDER BY ENROLMENT_ID " +
"OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setString(1, request.getDeviceName() + "%"); stmt.setString(1, request.getDeviceName() + "%");
stmt.setInt(2, tenantId); stmt.setInt(2, tenantId);
@ -265,8 +267,8 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
"e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM (SELECT e.ID, e.DEVICE_ID, e.OWNER, e.OWNERSHIP, e.STATUS, " + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM (SELECT e.ID, e.DEVICE_ID, e.OWNER, e.OWNERSHIP, e.STATUS, " +
"e.DATE_OF_ENROLMENT, e.DATE_OF_LAST_UPDATE, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e " + "e.DATE_OF_ENROLMENT, e.DATE_OF_LAST_UPDATE, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e " +
"WHERE TENANT_ID = ? AND OWNERSHIP = ?) e, DM_DEVICE d, DM_DEVICE_TYPE t " + "WHERE TENANT_ID = ? AND OWNERSHIP = ?) e, DM_DEVICE d, DM_DEVICE_TYPE t " +
"WHERE DEVICE_ID = e.DEVICE_ID AND d.DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ? OFFSET ? " + "WHERE DEVICE_ID = e.DEVICE_ID AND d.DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ? ORDER BY ENROLMENT_ID " +
"ROWS FETCH NEXT ? ROWS ONLY"; "OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);
stmt.setString(2, request.getOwnership()); stmt.setString(2, request.getOwnership());
@ -301,8 +303,8 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
"e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM (SELECT e.ID, e.DEVICE_ID, e.OWNER, e.OWNERSHIP, e.STATUS, " + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM (SELECT e.ID, e.DEVICE_ID, e.OWNER, e.OWNERSHIP, e.STATUS, " +
"e.DATE_OF_ENROLMENT, e.DATE_OF_LAST_UPDATE, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e " + "e.DATE_OF_ENROLMENT, e.DATE_OF_LAST_UPDATE, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e " +
"WHERE TENANT_ID = ? AND STATUS = ?) e, DM_DEVICE d, DM_DEVICE_TYPE t " + "WHERE TENANT_ID = ? AND STATUS = ?) e, DM_DEVICE d, DM_DEVICE_TYPE t " +
"WHERE DEVICE_ID = e.DEVICE_ID AND d.DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ? OFFSET ? ROWS" + "WHERE DEVICE_ID = e.DEVICE_ID AND d.DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ? ORDER BY ENROLMENT_ID " +
" FETCH NEXT ? ROWS ONLY"; "OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);
stmt.setString(2, request.getStatus()); stmt.setString(2, request.getStatus());
@ -356,7 +358,7 @@ public class SQLServerDeviceDAOImpl extends AbstractDeviceDAOImpl {
"e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.NAME, " + "e.DATE_OF_ENROLMENT, e.ID AS ENROLMENT_ID FROM DM_ENROLMENT e, (SELECT d.ID, d.NAME, " +
"d.DESCRIPTION, d.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE FROM DM_DEVICE d, " + "d.DESCRIPTION, d.DEVICE_IDENTIFICATION, t.NAME AS DEVICE_TYPE FROM DM_DEVICE d, " +
"DM_DEVICE_TYPE t WHERE d.DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ?" + filteringString + "DM_DEVICE_TYPE t WHERE d.DEVICE_TYPE_ID = t.ID AND d.TENANT_ID = ?" + filteringString +
") d1 WHERE d1.ID = e.DEVICE_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; ") d1 WHERE d1.ID = e.DEVICE_ID ORDER BY ENROLMENT_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);

@ -51,7 +51,7 @@ public class SQLServerNotificationDAOImpl extends AbstractNotificationDAOImpl {
"NOTIFICATION_ID, DEVICE_ID, OPERATION_ID, STATUS, DESCRIPTION FROM DM_NOTIFICATION WHERE " + "NOTIFICATION_ID, DEVICE_ID, OPERATION_ID, STATUS, DESCRIPTION FROM DM_NOTIFICATION WHERE " +
"TENANT_ID = ?) n1 WHERE n1.DEVICE_ID = d.ID AND d.DEVICE_TYPE_ID=t.ID AND TENANT_ID = ?"; "TENANT_ID = ?) n1 WHERE n1.DEVICE_ID = d.ID AND d.DEVICE_TYPE_ID=t.ID AND TENANT_ID = ?";
sql = sql + " OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; sql = sql + " ORDER BY n1.NOTIFICATION_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);
@ -92,7 +92,7 @@ public class SQLServerNotificationDAOImpl extends AbstractNotificationDAOImpl {
"TENANT_ID = ? AND STATUS = ?) n1 WHERE n1.DEVICE_ID = d.ID AND d.DEVICE_TYPE_ID=t.ID " + "TENANT_ID = ? AND STATUS = ?) n1 WHERE n1.DEVICE_ID = d.ID AND d.DEVICE_TYPE_ID=t.ID " +
"AND TENANT_ID = ?"; "AND TENANT_ID = ?";
sql = sql + " OFFSET ? ROWS FETCH NEXT ? ROWS ONLY"; sql = sql + " ORDER BY n1.NOTIFICATION_ID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY";
stmt = conn.prepareStatement(sql); stmt = conn.prepareStatement(sql);
stmt.setInt(1, tenantId); stmt.setInt(1, tenantId);

@ -121,48 +121,49 @@
</div> </div>
<div id="remove-certificate-success-content" class="hide"> <div id="remove-certificate-success-content" class="hide">
<div class="content"> <div class="modal-header">
<div class="row"> <h3 class="pull-left modal-title">Done. Certificate was successfully removed.</h3>
<div class="col-lg-5 col-md-6 col-centered"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
<h3>Done. Certificate was successfully removed.</h3> </div>
<div class="buttons"> <div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<a href="#" id="remove-certificate-success-link" class="btn-operations">
Ok </div>
</a> <div class="modal-footer">
</div> <div class="buttons">
</div>
</div> </div>
</div> </div>
</div> </div>
<div id="remove-certificate-error-content" class="hide"> <div id="remove-certificate-error-content" class="hide">
<div class="content"> <div class="modal-header">
<div class="row"> <h3 class="pull-left modal-title">An unexpected error occurred. Please try again later.</h3>
<div class="col-lg-5 col-md-6 col-centered"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
<h3>An unexpected error occurred. Please try again later.</h3> </div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
<div class="buttons"> </div>
<a href="#" id="remove-certificate-error-link" class="btn-operations"> <div class="modal-footer">
Ok <div class="buttons">
</a>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div id="errorCertificateView" class="hide"> <div id="errorCertificateView" class="hide">
<div class="content"> <div class="modal-header">
<div class="row"> <h3 class="pull-left modal-title">
<div class="col-lg-5 col-md-6 col-centered">
<h3>
<span class="fw-stack"> <span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-error fw-stack-1x"></i> <i class="fw fw-error fw-stack-1x"></i>
</span> </span>
Unauthorized action! Unauthorized action!
</h3> </h3>
</div> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fw fw-cancel"></i></button>
</div>
<div class="modal-body add-margin-top-2x add-margin-bottom-2x">
</div>
<div class="modal-footer">
<div class="buttons">
</div> </div>
</div> </div>
</div> </div>

@ -35,7 +35,6 @@ function setPopupMaxHeight() {
*/ */
function showPopup() { function showPopup() {
$(modalPopup).modal('show'); $(modalPopup).modal('show');
//setPopupMaxHeight();
} }
/* /*

@ -456,7 +456,6 @@ function setPopupMaxHeight() {
*/ */
function showPopup() { function showPopup() {
$(modalPopup).modal('show'); $(modalPopup).modal('show');
//setPopupMaxHeight();
} }
/* /*

@ -269,7 +269,6 @@ function setPopupMaxHeight() {
*/ */
function showPopup() { function showPopup() {
$(modalPopup).modal('show'); $(modalPopup).modal('show');
//setPopupMaxHeight();
} }
/* /*

@ -56,7 +56,7 @@ function onRequest(context) {
page["noPolicy"] = true; page["noPolicy"] = true;
} }
if (userModule.isAuthorized("/permission/admin/device-mgt/policies/delete")) { if (userModule.isAuthorized("/permission/admin/device-mgt/policies/manage")) {
page.managePermitted = true; page.managePermitted = true;
} }
return page; return page;

@ -82,7 +82,6 @@ function setPopupMaxHeight() {
*/ */
function showPopup() { function showPopup() {
$(modalPopup).modal('show'); $(modalPopup).modal('show');
//setPopupMaxHeight();
} }
/* /*

@ -38,5 +38,14 @@
{{/zone}} {{/zone}}
{{#zone "content"}} {{#zone "content"}}
{{unit "cdmf.unit.policy.priority"}} {{#if isAuthorized}}
{{unit "cdmf.unit.policy.priority"}}
{{else}}
<h1 class="page-sub-title">
Permission Denied
</h1>
<br>
You not authorized to enter Policy Management Section.
<br>
{{/if}}
{{/zone}} {{/zone}}

@ -26,4 +26,7 @@ function onRequest(context){
return options.fn(this); return options.fn(this);
} }
}); });
var viewModel = {};
viewModel.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage");
return viewModel;
} }

@ -41,7 +41,7 @@ $(function () {
var apiBasePath = "/api/device-mgt/v1.0"; var apiBasePath = "/api/device-mgt/v1.0";
var modalPopup = ".modal"; var modalPopup = ".modal";
var modalPopupContainer = modalPopup + " .modal-content"; var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-body"; var modalPopupContent = modalPopup + " .modal-content";
var body = "body"; var body = "body";
$(".icon .text").res_text(0.2); $(".icon .text").res_text(0.2);
@ -58,7 +58,6 @@ function setPopupMaxHeight() {
*/ */
function showPopup() { function showPopup() {
$(modalPopup).modal('show'); $(modalPopup).modal('show');
setPopupMaxHeight();
} }
/* /*
@ -67,6 +66,8 @@ function showPopup() {
function hidePopup() { function hidePopup() {
$(modalPopupContent).html(''); $(modalPopupContent).html('');
$(modalPopup).modal('hide'); $(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
} }
/** /**

@ -45,7 +45,6 @@
*/ */
function showQRCodePopup() { function showQRCodePopup() {
$(modalPopup).modal('show'); $(modalPopup).modal('show');
//setPopupMaxHeight();
} }
/* /*

@ -16,70 +16,79 @@
under the License. under the License.
}} }}
{{#zone "content"}} {{#zone "content"}}
<div class="row"> {{#if isAuthorized}}
<div class="col-md-12"> <div class="row">
<div class="container col-centered wr-content policy-platform"> <div class="col-md-12">
<div class="wr-form"> <div class="container col-centered wr-content policy-platform">
<h1 id="policy-platform-page-wizard-title" class="page-sub-title">ADD POLICY</h1> <div class="wr-form">
<hr> <h1 id="policy-platform-page-wizard-title" class="page-sub-title">ADD POLICY</h1>
<div id="policy-platform-wizard-steps" class="row wr-wizard"> <hr>
<div class="col-md-3 col-xs-3"> <div id="policy-platform-wizard-steps" class="row wr-wizard">
<div class="itm-wiz itm-wiz-current" data-step="policy-platform"> <div class="col-md-3 col-xs-3">
<div class="wiz-no">1</div> <div class="itm-wiz itm-wiz-current" data-step="policy-platform">
<div class="wiz-lbl hidden-xs"><span>Select a platform</span></div> <div class="wiz-no">1</div>
<div class="wiz-lbl hidden-xs"><span>Select a platform</span></div>
</div>
<br class="c-both"/>
</div> </div>
<br class="c-both" /> <div class="col-md-3 col-xs-3">
</div> <div class="itm-wiz" data-step="policy-profile">
<div class="col-md-3 col-xs-3"> <div class="wiz-no">2</div>
<div class="itm-wiz" data-step="policy-profile"> <div class="wiz-lbl hidden-xs"><span>Configure profile</span></div>
<div class="wiz-no">2</div> </div>
<div class="wiz-lbl hidden-xs"><span>Configure profile</span></div> <br class="c-both"/>
</div> </div>
<br class="c-both" /> <div class="col-md-3 col-xs-3">
</div> <div class="itm-wiz" data-step="policy-criteria">
<div class="col-md-3 col-xs-3"> <div class="wiz-no">3</div>
<div class="itm-wiz" data-step="policy-criteria"> <div class="wiz-lbl hidden-xs"><span>Assign</span></div>
<div class="wiz-no">3</div> </div>
<div class="wiz-lbl hidden-xs"><span>Assign</span></div> <br class="c-both"/>
</div> </div>
<br class="c-both" /> <div class="col-md-3 col-xs-3">
</div> <div class="itm-wiz" data-step="policy-naming">
<div class="col-md-3 col-xs-3"> <div class="wiz-no">4</div>
<div class="itm-wiz" data-step="policy-naming"> <div class="wiz-lbl hidden-xs"><span>Publish to devices</span></div>
<div class="wiz-no">4</div> </div>
<div class="wiz-lbl hidden-xs"><span>Publish to devices</span></div> <br class="c-both"/>
</div> </div>
<br class="c-both" />
</div> </div>
</div> <hr>
<hr> <div class="row">
<div class="row"> <div class="col-lg-12">
<div class="col-lg-12"> <h4>Step 1: Select a platform</h4>
<h4>Step 1: Select a platform</h4> <br>
<br>
<div class="row wr-tile-buttons-list"> <div class="row wr-tile-buttons-list">
<div class="wr-input-control"> <div class="wr-input-control">
<ul class="tile-buttons row"> <ul class="tile-buttons row">
{{#each types}} {{#each types}}
<li class="col-lg-4" <li class="col-lg-4"
style="margin-top: 5px;margin-bottom: 5px;"> style="margin-top: 5px;margin-bottom: 5px;">
<a href="{{@app.context}}/policy/add/{{name}}" <a href="{{@app.context}}/policy/add/{{name}}"
class="wizard-stepper"> class="wizard-stepper">
<img src="{{icon}}" width="50px" <img src="{{icon}}" width="50px"
height="50px"><br><br> height="50px"><br><br>
<b>{{label}}</b> <b>{{label}}</b>
</a> </a>
</li> </li>
{{/each}} {{/each}}
</ul> </ul>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- content -->
</div> </div>
<!-- content -->
</div> </div>
</div> {{else}}
<h1 class="page-sub-title">
Permission Denied
</h1>
<br>
You not authorized to enter Policy Management Section.
<br>
{{/if}}
{{/zone}} {{/zone}}

@ -24,6 +24,8 @@ function onRequest(context) {
var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var types = {}; var types = {};
types.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage");
types["types"] = []; types["types"] = [];
var typesListResponse = deviceModule.getDeviceTypes(); var typesListResponse = deviceModule.getDeviceTypes();
if (typesListResponse["status"] == "success") { if (typesListResponse["status"] == "success") {

@ -1,222 +1,255 @@
{{#zone "content"}} {{#zone "content"}}
<div class="row"> {{#if isAuthorized }}
<div class="col-md-12"> <div class="row">
<div class="col-md-12">
<div class="wr-steps hidden"> <div class="wr-steps hidden">
<div class="col-md-3 col-xs-3"> <div class="col-md-3 col-xs-3">
<div class="itm-wiz itm-wiz-current" data-step="policy-profile"><div class="wiz-no">1</div><div class="wiz-lbl hidden-xs"><span>Edit current profile</span></div></div> <div class="itm-wiz itm-wiz-current" data-step="policy-profile">
<br class="c-both" /> <div class="wiz-no">1</div>
</div> <div class="wiz-lbl hidden-xs"><span>Edit current profile</span></div>
<div class="col-md-3 col-xs-3"> </div>
<div class="itm-wiz" data-step="policy-criteria"><div class="wiz-no">2</div><div class="wiz-lbl hidden-xs"><span>Edit assignment groups</span></div></div> <br class="c-both"/>
<br class="c-both" /> </div>
</div> <div class="col-md-3 col-xs-3">
<div class="col-md-3 col-xs-3"> <div class="itm-wiz" data-step="policy-criteria">
<div class="itm-wiz" data-step="policy-naming"><div class="wiz-no">3</div><div class="wiz-lbl hidden-xs"><span>Republish to devices</span></div></div> <div class="wiz-no">2</div>
<br class="c-both" /> <div class="wiz-lbl hidden-xs"><span>Edit assignment groups</span></div>
</div>
<br class="c-both"/>
</div>
<div class="col-md-3 col-xs-3">
<div class="itm-wiz" data-step="policy-naming">
<div class="wiz-no">3</div>
<div class="wiz-lbl hidden-xs"><span>Republish to devices</span></div>
</div>
<br class="c-both"/>
</div>
</div> </div>
</div>
<div class="container col-centered wr-content policy-message hidden"> <div class="container col-centered wr-content policy-message hidden">
<div class="wr-form"> <div class="wr-form">
<h1 id="policy-message-page-wizard-title" class="page-sub-title">Policy is successfully re-configured.</h1> <h1 id="policy-message-page-wizard-title" class="page-sub-title">Policy is successfully
<br>Please click <b>"Add Another Policy"</b>, if you wish to add another policy or click re-configured.</h1>
<b>"View policy list"</b> to complete the process and go back to the policy list. <br>Please click <b>"Add Another Policy"</b>, if you wish to add another policy or click
<hr> <b>"View policy list"</b> to complete the process and go back to the policy list.
<button class="wr-btn wizard-stepper" data-current="policy-message" data-direct="/emm/policies/"> <hr>
View policy list <button class="wr-btn wizard-stepper" data-current="policy-message"
</button> data-direct="/emm/policies/">
<a href="/emm/policies/add-policy" class="cu-btn-inner"> View policy list
</button>
<a href="/emm/policies/add-policy" class="cu-btn-inner">
<span class="fw-stack"> <span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i> <i class="fw fw-add fw-stack-1x"></i>
</span> </span>
Add another policy Add another policy
</a> </a>
</div>
</div> </div>
</div>
<div class="container col-centered wr-content policy-naming hidden"> <div class="container col-centered wr-content policy-naming hidden">
<div class="wr-form"> <div class="wr-form">
<h1 id="policy-naming-page-wizard-title" class="page-sub-title">EDIT POLICY</h1> <h1 id="policy-naming-page-wizard-title" class="page-sub-title">EDIT POLICY</h1>
<hr> <hr>
<div id="policy-naming-wizard-steps" class="row wr-wizard"></div> <div id="policy-naming-wizard-steps" class="row wr-wizard"></div>
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h4 class="visible-xs">Step 3: Republish to devices</h4> <h4 class="visible-xs">Step 3: Republish to devices</h4>
<br> <br>
<div id="policy-naming-main-error-msg" class="alert alert-danger hidden" role="alert"> <div id="policy-naming-main-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div>
<div>
<label class="wr-input-label">
Set a name * to your policy<br>
( should be 1-to-30 characters long )
</label>
<div id="policy-name-field" class="form-group wr-input-control">
<div class="cus-col-50">
<input id="policy-name-input" class="form-control" type="text" value="" placeholder="[ Required field ]"/>
</div>
<br class="c-both"/>
<span class=" nameError hidden glyphicon glyphicon-remove form-control-feedback"></span>
<label class="error nameEmpty hidden" for="summary">Policy name is required & Should be be 1-to-30 characters long.</label>
</div> </div>
<label class="wr-input-label"> <div>
Add a description <label class="wr-input-label">
</label> Set a name * to your policy<br>
<div class="wr-input-control"> ( should be 1-to-30 characters long )
<div class="cus-col-50"> </label>
<textarea id="policy-description-input" class="form-control" rows="10" placeholder="[ Optional field ]"></textarea> <div id="policy-name-field" class="form-group wr-input-control">
<div class="cus-col-50">
<input id="policy-name-input" class="form-control" type="text" value=""
placeholder="[ Required field ]"/>
</div>
<br class="c-both"/>
<span class=" nameError hidden glyphicon glyphicon-remove form-control-feedback"></span>
<label class="error nameEmpty hidden" for="summary">Policy name is required &
Should be be 1-to-30 characters long.</label>
</div>
<label class="wr-input-label">
Add a description
</label>
<div class="wr-input-control">
<div class="cus-col-50">
<textarea id="policy-description-input" class="form-control" rows="10"
placeholder="[ Optional field ]"></textarea>
</div>
<br class="c-both"/>
</div> </div>
<br class="c-both" />
</div> </div>
</div> <div class="wr-input-control wr-btn-grp">
<div class="wr-input-control wr-btn-grp"> <a href="#" class="wr-btn wizard-stepper" data-is-back-btn="true"
<a href="#" class="wr-btn wizard-stepper" data-is-back-btn="true" data-current="policy-naming" data-next="policy-criteria"> data-current="policy-naming" data-next="policy-criteria">
Back Back
</a> </a>
<a href="#" class="wr-btn wizard-stepper" data-current="policy-naming-publish" data-next="policy-message" data-validate="true"> <a href="#" class="wr-btn wizard-stepper" data-current="policy-naming-publish"
Save & Publish data-next="policy-message" data-validate="true">
</a> Save & Publish
<a href="#" class="wr-btn wizard-stepper" data-current="policy-naming" data-next="policy-message" data-validate="true"> </a>
Save <a href="#" class="wr-btn wizard-stepper" data-current="policy-naming"
</a> data-next="policy-message" data-validate="true">
Save
</a>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="container col-centered wr-content policy-criteria hidden"> <div class="container col-centered wr-content policy-criteria hidden">
<div class="wr-form"> <div class="wr-form">
<h1 id="policy-criteria-page-wizard-title" class="page-sub-title">EDIT POLICY</h1> <h1 id="policy-criteria-page-wizard-title" class="page-sub-title">EDIT POLICY</h1>
<hr> <hr>
<div id="policy-criteria-wizard-steps" class="row wr-wizard"></div> <div id="policy-criteria-wizard-steps" class="row wr-wizard"></div>
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h4 class="visible-xs">Step 2: Edit assignment groups</h4> <h4 class="visible-xs">Step 2: Edit assignment groups</h4>
<br> <br>
<div id="policy-criteria-main-error-msg" class="alert alert-danger hidden" role="alert"> <div id="policy-criteria-main-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div>
<div>
<label class="wr-input-label">
Set device ownership type
</label>
<div class="wr-input-control">
<div class="cus-col-50">
<select id="ownership-input" class="form-control">
<option value="ANY" selected>ANY</option>
<option value="BYOD">BYOD (Bring Your Own Device) </option>
<option value="COPE">COPE (Corporate-Owned, Personally Enabled)</option>
</select>
</div>
<br class="c-both" />
</div> </div>
<div class="wr-input-control"> <div>
<label class="wr-input-control radio light"> <label class="wr-input-label">
<input id="user-roles-radio-btn" type="radio" name="select-users-radio-btn" class="select-users-radio" checked/> Set device ownership type
<span class="helper">&nbsp;Set user role(s)</span>
</label> </label>
<label class="wr-input-control radio light" rel="assetfilter">
<input id="users-radio-btn" type="radio" name="select-users-radio-btn" class="select-users-radio" />
<span class="helper">&nbsp;Set user(s)</span>
</label>
</div>
<div id="user-roles-select-field" class="select-users">
<div class="wr-input-control"> <div class="wr-input-control">
<div class="cus-col-50"> <div class="cus-col-50">
<select id="user-roles-input" class="form-control select2" multiple="multiple"> <select id="ownership-input" class="form-control">
<option value="ANY" selected>ANY</option> <option value="ANY" selected>ANY</option>
{{#each roles}} <option value="BYOD">BYOD (Bring Your Own Device)</option>
<option>{{this}}</option> <option value="COPE">COPE (Corporate-Owned, Personally Enabled)</option>
{{/each}}
</select> </select>
</div> </div>
<br class="c-both" /> <br class="c-both"/>
</div> </div>
</div> <div class="wr-input-control">
<div id="users-select-field" class="select-users"> <label class="wr-input-control radio light">
<input id="user-roles-radio-btn" type="radio" name="select-users-radio-btn"
class="select-users-radio" checked/>
<span class="helper">&nbsp;Set user role(s)</span>
</label>
<label class="wr-input-control radio light" rel="assetfilter">
<input id="users-radio-btn" type="radio" name="select-users-radio-btn"
class="select-users-radio"/>
<span class="helper">&nbsp;Set user(s)</span>
</label>
</div>
<div id="user-roles-select-field" class="select-users">
<div class="wr-input-control">
<div class="cus-col-50">
<select id="user-roles-input" class="form-control select2"
multiple="multiple">
<option value="ANY" selected>ANY</option>
{{#each roles}}
<option>{{this}}</option>
{{/each}}
</select>
</div>
<br class="c-both"/>
</div>
</div>
<div id="users-select-field" class="select-users">
<div class="wr-input-control">
<div class="cus-col-50">
<select id="users-input" class="form-control select2"
multiple="multiple">
<option value="ANY" selected>ANY</option>
{{#each users}}
<option>{{username}}</option>
{{/each}}
</select>
</div>
<br class="c-both"/>
</div>
</div>
<br>
<label class="wr-input-label" title="">
Set an action upon non-compliance
</label>
<div class="wr-input-control"> <div class="wr-input-control">
<div class="cus-col-50"> <div class="cus-col-50">
<select id="users-input" class="form-control select2" multiple="multiple"> <select id="action-input" class="form-control">
<option value="ANY" selected>ANY</option> <option value="enforce" data-action="enforce" selected>Enforce</option>
{{#each users}} <option value="warn" data-action="warn">Warn</option>
<option>{{username}}</option> <option value="monitor" data-action="monitor">Monitor</option>
{{/each}}
</select> </select>
</div> </div>
<br class="c-both" /> <br class="c-both"/>
</div> </div>
</div> </div>
<br> <div class="wr-input-control wr-btn-grp">
<label class="wr-input-label" title=""> <a href="#" class="wr-btn wizard-stepper" data-is-back-btn="true"
Set an action upon non-compliance data-current="policy-criteria" data-next="policy-profile">
</label> Back
<div class="wr-input-control"> </a>
<div class="cus-col-50"> <a href="#" class="wr-btn wizard-stepper" data-current="policy-criteria"
<select id="action-input" class="form-control"> data-next="policy-naming" data-validate="true">
<option value="enforce" data-action="enforce" selected>Enforce</option> Continue
<option value="warn" data-action="warn">Warn</option> </a>
<option value="monitor" data-action="monitor">Monitor</option>
</select>
</div>
<br class="c-both" />
</div> </div>
</div> </div>
<div class="wr-input-control wr-btn-grp">
<a href="#" class="wr-btn wizard-stepper" data-is-back-btn="true" data-current="policy-criteria" data-next="policy-profile">
Back
</a>
<a href="#" class="wr-btn wizard-stepper" data-current="policy-criteria" data-next="policy-naming" data-validate="true">
Continue
</a>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="container col-centered wr-content policy-profile"> <div class="container col-centered wr-content policy-profile">
<div class="wr-form"> <div class="wr-form">
<h1 id="policy-profile-page-wizard-title" class="page-sub-title">EDIT POLICY</h1> <h1 id="policy-profile-page-wizard-title" class="page-sub-title">EDIT POLICY</h1>
<hr> <hr>
<div id="policy-profile-wizard-steps" class="row wr-wizard"></div> <div id="policy-profile-wizard-steps" class="row wr-wizard"></div>
<hr> <hr>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<h4 class="visible-xs">Step 1: Edit current profile</h4> <h4 class="visible-xs">Step 1: Edit current profile</h4>
<br> <br>
<div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert"> <div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span> <i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="wr-advance-operations"> <div class="wr-advance-operations">
<div class="wr-advance-operations-init"> <div class="wr-advance-operations-init">
<br> <br>
&nbsp;&nbsp; &nbsp;&nbsp;
<i class="fw fw-settings fw-spin fw-2x"></i> <i class="fw fw-settings fw-spin fw-2x"></i>
&nbsp;Loading platform features . . . &nbsp;Loading platform features . . .
<br> <br>
<br> <br>
</div>
</div>
<div class="wr-input-control wr-btn-grp">
<a href="#" class="wr-btn wizard-stepper" data-current="policy-profile"
data-next="policy-criteria" data-validate="true">
Continue
</a>
</div> </div>
</div>
<div class="wr-input-control wr-btn-grp">
<a href="#" class="wr-btn wizard-stepper" data-current="policy-profile" data-next="policy-criteria" data-validate="true">
Continue
</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
<!-- content --> <!-- content -->
</div>
</div> </div>
</div> {{else}}
<h1 class="page-sub-title">
Permission Denied
</h1>
<br>
You not authorized to enter Policy Management Section.
<br>
{{/if}}
{{/zone}} {{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
<!--suppress HtmlUnknownTarget --> <!--suppress HtmlUnknownTarget -->

@ -24,13 +24,13 @@ function onRequest(context) {
var rolesResult = userModule.getRoles(); var rolesResult = userModule.getRoles();
if (rolesResult.status == "success") { if (rolesResult.status == "success") {
context.roles = rolesResult.content; viewModel.roles = rolesResult.content;
} }
var usersResult = userModule.getUsers(); var usersResult = userModule.getUsers();
if (usersResult.status == "success") { if (usersResult.status == "success") {
context.users = usersResult.content; viewModel.users = usersResult.content;
} }
viewModel.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage");
return context; return viewModel;
} }

@ -1,77 +1,87 @@
{{#zone "content"}} {{#zone "content"}}
{{#defineZone "policy-profile-top"}} {{#if isAuthorized}}
<div class="row wr-device-board"> {{#defineZone "policy-profile-top"}}
<div class="col-lg-12 wr-secondary-bar"> <div class="row wr-device-board">
<label id="policy-heading" class="device-id device-select"> <div class="col-lg-12 wr-secondary-bar">
</label> <label id="policy-heading" class="device-id device-select">
</label>
</div>
</div> </div>
</div> {{/defineZone}}
{{/defineZone}}
<!-- #page-content-wrapper --> <!-- #page-content-wrapper -->
<div class="page-content-wrapper"> <div class="page-content-wrapper">
<div class="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;"> <div class="row no-gutter add-padding-5x add-margin-top-5x" style="border: 1px solid #e4e4e4;">
<div class="media"> <div class="media">
<div class="media-body asset-desc add-padding-left-5x"> <div class="media-body asset-desc add-padding-left-5x">
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px"> <div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">
Policy Overview Policy Overview
</div>
{{#defineZone "policy-detail-properties"}}
<table class="table table-responsive table-striped" id="members">
<tbody>
<tr role="row" class="even">
<td class="sorting_1" style="padding:10px 15px; width: 14%;">Platform</td>
<td id="policy-platform" style="padding:10px 15px;"></td>
</tr>
<tr role="row" class="odd">
<td class="sorting_1" style="padding:10px 15px;">Ownership</td>
<td id="policy-assignment" style="padding:10px 15px;"></td>
</tr>
<tr role="row" class="even">
<td class="sorting_1" style="padding:10px 15px;">Action upon non-compliance</td>
<td id="policy-action" style="padding:10px 15px;"></td>
</tr>
<tr role="row" class="even">
<td class="sorting_1" style="padding:10px 15px;">Status</td>
<td id="policy-status" style="padding:10px 15px;"></td>
</tr>
<tr role="row" id="users-row" class="even">
<td class="sorting_1" style="padding:10px 15px;">Assigned Users</td>
<td id="policy-users" style="padding:10px 15px;"></td>
</tr>
<tr role="row" id="roles-row" class="even">
<td class="sorting_1" style="padding:10px 15px;">Assigned Roles</td>
<td id="policy-roles" style="padding:10px 15px;"></td>
</tr>
</tbody>
</table>
{{/defineZone}}
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">Description</div>
<div class="add-margin-top-4x">
<div id="policy-description" class="panel-title-description"></div>
</div>
<br>
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">
Profile Information
</div>
<div class="add-margin-top-4x">
<div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div> </div>
<div class="wr-advance-operations"> {{#defineZone "policy-detail-properties"}}
<div class="wr-advance-operations-init"> <table class="table table-responsive table-striped" id="members">
<br> <tbody>
<i class="fw fw-settings fw-spin fw-2x"></i> <tr role="row" class="even">
Loading platform features . . . <td class="sorting_1" style="padding:10px 15px; width: 14%;">Platform</td>
<br> <td id="policy-platform" style="padding:10px 15px;"></td>
<br> </tr>
<tr role="row" class="odd">
<td class="sorting_1" style="padding:10px 15px;">Ownership</td>
<td id="policy-assignment" style="padding:10px 15px;"></td>
</tr>
<tr role="row" class="even">
<td class="sorting_1" style="padding:10px 15px;">Action upon non-compliance</td>
<td id="policy-action" style="padding:10px 15px;"></td>
</tr>
<tr role="row" class="even">
<td class="sorting_1" style="padding:10px 15px;">Status</td>
<td id="policy-status" style="padding:10px 15px;"></td>
</tr>
<tr role="row" id="users-row" class="even">
<td class="sorting_1" style="padding:10px 15px;">Assigned Users</td>
<td id="policy-users" style="padding:10px 15px;"></td>
</tr>
<tr role="row" id="roles-row" class="even">
<td class="sorting_1" style="padding:10px 15px;">Assigned Roles</td>
<td id="policy-roles" style="padding:10px 15px;"></td>
</tr>
</tbody>
</table>
{{/defineZone}}
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">Description
</div>
<div class="add-margin-top-4x">
<div id="policy-description" class="panel-title-description"></div>
</div>
<br>
<div style="background: #11375B; color: #fff; padding: 10px; margin-bottom: 5px">
Profile Information
</div>
<div class="add-margin-top-4x">
<div id="policy-profile-main-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<div class="wr-advance-operations">
<div class="wr-advance-operations-init">
<br>
<i class="fw fw-settings fw-spin fw-2x"></i>
Loading platform features . . .
<br>
<br>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> {{else}}
<h1 class="page-sub-title">
Permission Denied
</h1>
<br>
You not authorized to enter Policy Management Section.
<br>
{{/if}}
{{/zone}} {{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
<!--suppress HtmlUnknownTarget --> <!--suppress HtmlUnknownTarget -->

@ -21,5 +21,6 @@ function onRequest(context) {
// var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; // var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
// context.roles = userModule.getRoles(); // context.roles = userModule.getRoles();
context.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/view");
return context; return context;
} }

@ -13,7 +13,7 @@ function inputIsValid(regExp, inputString) {
$(document).ready(function () { $(document).ready(function () {
var modalPopup = ".modal"; var modalPopup = ".modal";
// var modalPopupContainer = modalPopup + " .modal-content"; // var modalPopupContainer = modalPopup + " .modal-content";
var modalPopupContent = modalPopup + " .modal-body"; var modalPopupContent = modalPopup + " .modal-content";
$("#change-password").click(function () { $("#change-password").click(function () {

@ -16,9 +16,9 @@
* under the License. * under the License.
*/ */
var modalPopup = ".wr-modalpopup", var modalPopup = ".modal";
modalPopupContainer = modalPopup + " .modalpopup-container", var modalPopupContainer = modalPopup + " .modal-content";
modalPopupContent = modalPopup + " .modalpopup-content"; var modalPopupContent = modalPopup + " .modal-content";
var emmAdminBasePath = "/api/device-mgt/v1.0"; var emmAdminBasePath = "/api/device-mgt/v1.0";
@ -37,8 +37,7 @@ function setPopupMaxHeight() {
* show popup function. * show popup function.
*/ */
function showPopup() { function showPopup() {
$(modalPopup).show(); $(modalPopup).modal('show');
setPopupMaxHeight();
} }
/* /*
@ -47,7 +46,9 @@ function showPopup() {
function hidePopup() { function hidePopup() {
$(modalPopupContent).html(""); $(modalPopupContent).html("");
$(modalPopupContent).removeClass("operation-data"); $(modalPopupContent).removeClass("operation-data");
$(modalPopup).hide(); $(modalPopup).modal('hide');
$('body').removeClass('modal-open').css('padding-right','0px');
$('.modal-backdrop').remove();
} }
var updateNotificationCount = function (data, textStatus, jqXHR) { var updateNotificationCount = function (data, textStatus, jqXHR) {

@ -18,7 +18,7 @@
{{#zone "topCss" override=false}} {{#zone "topCss" override=false}}
{{css "css/custom-theme.css"}} {{css "css/custom-theme.css"}}
{{css "css/custom-common.css"}} {{css "css/custom-common.css"}}
{{css "css/custom-desktop.css"}} {{css "css/custom-desktop.css" combine=false}}
{{css "css/docs.min.css"}} {{css "css/docs.min.css"}}
{{css "css/modal.css"}} {{css "css/modal.css"}}
{{/zone}} {{/zone}}

@ -4431,7 +4431,7 @@ a.thumbnail.active {
.thumbnail.icon { .thumbnail.icon {
border: none; border: none;
margin: 0; margin: 0;
background: #004675; background: #11375b;
color: #fff; color: #fff;
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;

@ -1,5 +1,5 @@
CREATE TABLE DM_DEVICE_CERTIFICATE ( CREATE TABLE DM_DEVICE_CERTIFICATE (
ID INTEGER IDENTITY NOT NULL, ID INTEGER IDENTITY(1,1) NOT NULL,
SERIAL_NUMBER VARCHAR(500) DEFAULT NULL, SERIAL_NUMBER VARCHAR(500) DEFAULT NULL,
CERTIFICATE VARBINARY(max) DEFAULT NULL, CERTIFICATE VARBINARY(max) DEFAULT NULL,
TENANT_ID INTEGER DEFAULT 0, TENANT_ID INTEGER DEFAULT 0,

@ -34,7 +34,7 @@ CREATE TABLE DM_OPERATION (
CREATE TABLE DM_CONFIG_OPERATION ( CREATE TABLE DM_CONFIG_OPERATION (
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NOT NULL,
OPERATION_CONFIG VARBINARY(255) DEFAULT NULL, OPERATION_CONFIG VARBINARY(MAX) DEFAULT NULL,
PRIMARY KEY (OPERATION_ID), PRIMARY KEY (OPERATION_ID),
CONSTRAINT FK_DM_OPERATION_CONFIG FOREIGN KEY (OPERATION_ID) REFERENCES CONSTRAINT FK_DM_OPERATION_CONFIG FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
@ -51,7 +51,7 @@ CREATE TABLE DM_COMMAND_OPERATION (
CREATE TABLE DM_POLICY_OPERATION ( CREATE TABLE DM_POLICY_OPERATION (
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NOT NULL,
ENABLED INTEGER NOT NULL DEFAULT 0, ENABLED INTEGER NOT NULL DEFAULT 0,
OPERATION_DETAILS VARBINARY(255) DEFAULT NULL, OPERATION_DETAILS VARBINARY(MAX) DEFAULT NULL,
PRIMARY KEY (OPERATION_ID), PRIMARY KEY (OPERATION_ID),
CONSTRAINT FK_DM_OPERATION_POLICY FOREIGN KEY (OPERATION_ID) REFERENCES CONSTRAINT FK_DM_OPERATION_POLICY FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
@ -60,7 +60,7 @@ CREATE TABLE DM_POLICY_OPERATION (
CREATE TABLE DM_PROFILE_OPERATION ( CREATE TABLE DM_PROFILE_OPERATION (
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NOT NULL,
ENABLED INTEGER NOT NULL DEFAULT 0, ENABLED INTEGER NOT NULL DEFAULT 0,
OPERATION_DETAILS VARBINARY(255) DEFAULT NULL, OPERATION_DETAILS VARBINARY(MAX) DEFAULT NULL,
PRIMARY KEY (OPERATION_ID), PRIMARY KEY (OPERATION_ID),
CONSTRAINT FK_DM_OPERATION_PROFILE FOREIGN KEY (OPERATION_ID) REFERENCES CONSTRAINT FK_DM_OPERATION_PROFILE FOREIGN KEY (OPERATION_ID) REFERENCES
DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION DM_OPERATION (ID) ON DELETE NO ACTION ON UPDATE NO ACTION
@ -105,7 +105,7 @@ CREATE TABLE DM_DEVICE_OPERATION_RESPONSE (
ID INTEGER IDENTITY(1,1) NOT NULL, ID INTEGER IDENTITY(1,1) NOT NULL,
ENROLMENT_ID INTEGER NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
OPERATION_ID INTEGER NOT NULL, OPERATION_ID INTEGER NOT NULL,
OPERATION_RESPONSE VARBINARY(255) DEFAULT NULL, OPERATION_RESPONSE VARBINARY(MAX) DEFAULT NULL,
RECEIVED_TIMESTAMP DATETIME2 DEFAULT NULL RECEIVED_TIMESTAMP DATETIME2 DEFAULT NULL
PRIMARY KEY (ID), PRIMARY KEY (ID),
CONSTRAINT FK_DM_DEVICE_OPERATION_RESP_ENROLMENT FOREIGN KEY (ENROLMENT_ID) REFERENCES CONSTRAINT FK_DM_DEVICE_OPERATION_RESP_ENROLMENT FOREIGN KEY (ENROLMENT_ID) REFERENCES
@ -150,7 +150,7 @@ CREATE TABLE DM_DEVICE_POLICY (
ID INTEGER IDENTITY(1,1) NOT NULL, ID INTEGER IDENTITY(1,1) NOT NULL,
DEVICE_ID INTEGER NOT NULL , DEVICE_ID INTEGER NOT NULL ,
ENROLMENT_ID INTEGER NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
DEVICE VARBINARY(255) NOT NULL, DEVICE VARBINARY(MAX) NOT NULL,
POLICY_ID INTEGER NOT NULL , POLICY_ID INTEGER NOT NULL ,
PRIMARY KEY (ID) , PRIMARY KEY (ID) ,
CONSTRAINT FK_POLICY_DEVICE_POLICY FOREIGN KEY (POLICY_ID) REFERENCES DM_POLICY (ID) CONSTRAINT FK_POLICY_DEVICE_POLICY FOREIGN KEY (POLICY_ID) REFERENCES DM_POLICY (ID)
@ -176,7 +176,7 @@ CREATE TABLE DM_PROFILE_FEATURES (
FEATURE_CODE VARCHAR(100) NOT NULL, FEATURE_CODE VARCHAR(100) NOT NULL,
DEVICE_TYPE VARCHAR(300) NOT NULL, DEVICE_TYPE VARCHAR(300) NOT NULL,
TENANT_ID INTEGER NOT NULL , TENANT_ID INTEGER NOT NULL ,
CONTENT VARBINARY(255) NULL DEFAULT NULL, CONTENT VARBINARY(MAX) NULL DEFAULT NULL,
PRIMARY KEY (ID), PRIMARY KEY (ID),
CONSTRAINT FK_DM_PROFILE_DM_POLICY_FEATURES FOREIGN KEY (PROFILE_ID) REFERENCES DM_PROFILE (ID) CONSTRAINT FK_DM_PROFILE_DM_POLICY_FEATURES FOREIGN KEY (PROFILE_ID) REFERENCES DM_PROFILE (ID)
ON DELETE NO ACTION ON UPDATE NO ACTION ON DELETE NO ACTION ON UPDATE NO ACTION
@ -205,7 +205,7 @@ CREATE TABLE DM_USER_POLICY (
DEVICE_ID INTEGER NOT NULL , DEVICE_ID INTEGER NOT NULL ,
ENROLMENT_ID INTEGER NOT NULL, ENROLMENT_ID INTEGER NOT NULL,
POLICY_ID INTEGER NOT NULL , POLICY_ID INTEGER NOT NULL ,
POLICY_CONTENT VARBINARY(255) NULL , POLICY_CONTENT VARBINARY(MAX) NULL ,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
APPLIED BIT NULL , APPLIED BIT NULL ,
CREATED_TIME DATETIME2 NULL , CREATED_TIME DATETIME2 NULL ,
@ -239,7 +239,7 @@ CREATE TABLE DM_POLICY_CRITERIA_PROPERTIES (
POLICY_CRITERION_ID INTEGER NOT NULL, POLICY_CRITERION_ID INTEGER NOT NULL,
PROP_KEY VARCHAR(45) NULL, PROP_KEY VARCHAR(45) NULL,
PROP_VALUE VARCHAR(100) NULL, PROP_VALUE VARCHAR(100) NULL,
CONTENT VARBINARY(255) NULL, CONTENT VARBINARY(MAX) NULL,
PRIMARY KEY (ID), PRIMARY KEY (ID),
CONSTRAINT FK_POLICY_CRITERIA_PROPERTIES FOREIGN KEY (POLICY_CRITERION_ID) REFERENCES DM_POLICY_CRITERIA (ID) CONSTRAINT FK_POLICY_CRITERIA_PROPERTIES FOREIGN KEY (POLICY_CRITERION_ID) REFERENCES DM_POLICY_CRITERIA (ID)
ON DELETE CASCADE ON UPDATE NO ACTION ON DELETE CASCADE ON UPDATE NO ACTION
@ -288,7 +288,7 @@ CREATE TABLE DM_APPLICATION (
TYPE VARCHAR(50) NULL, TYPE VARCHAR(50) NULL,
LOCATION_URL VARCHAR(100) DEFAULT NULL, LOCATION_URL VARCHAR(100) DEFAULT NULL,
IMAGE_URL VARCHAR(100) DEFAULT NULL, IMAGE_URL VARCHAR(100) DEFAULT NULL,
APP_PROPERTIES VARBINARY(255) NULL, APP_PROPERTIES VARBINARY(MAX) NULL,
MEMORY_USAGE INTEGER NULL, MEMORY_USAGE INTEGER NULL,
IS_ACTIVE BIT NOT NULL DEFAULT 0, IS_ACTIVE BIT NOT NULL DEFAULT 0,
TENANT_ID INTEGER NOT NULL, TENANT_ID INTEGER NOT NULL,
@ -434,67 +434,3 @@ CREATE TABLE DM_DEVICE_DETAIL (
ON DELETE NO ACTION ON DELETE NO ACTION
ON UPDATE NO ACTION ON UPDATE NO ACTION
); );
-- DASHBOARD RELATED VIEWS --
CREATE VIEW DEVICE_INFO_VIEW AS
SELECT
DM_DEVICE.ID AS DEVICE_ID,
DM_DEVICE.DEVICE_IDENTIFICATION,
DM_DEVICE_TYPE.NAME AS PLATFORM,
DM_ENROLMENT.OWNERSHIP,
DM_ENROLMENT.STATUS AS CONNECTIVITY_STATUS,
DM_DEVICE.TENANT_ID
FROM DM_DEVICE, DM_DEVICE_TYPE, DM_ENROLMENT
WHERE DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID AND DM_DEVICE.ID = DM_ENROLMENT.DEVICE_ID;
CREATE VIEW DEVICE_WITH_POLICY_INFO_VIEW AS
SELECT
DEVICE_ID,
POLICY_ID,
STATUS AS IS_COMPLIANT
FROM DM_POLICY_COMPLIANCE_STATUS;
CREATE VIEW POLICY_COMPLIANCE_INFO AS
SELECT
DEVICE_INFO_VIEW.DEVICE_ID,
DEVICE_INFO_VIEW.DEVICE_IDENTIFICATION,
DEVICE_INFO_VIEW.PLATFORM,
DEVICE_INFO_VIEW.OWNERSHIP,
DEVICE_INFO_VIEW.CONNECTIVITY_STATUS,
IFNULL(DEVICE_WITH_POLICY_INFO_VIEW.POLICY_ID, -1) AS POLICY_ID,
IFNULL(DEVICE_WITH_POLICY_INFO_VIEW.IS_COMPLIANT, -1) AS IS_COMPLIANT,
DEVICE_INFO_VIEW.TENANT_ID
FROM
DEVICE_INFO_VIEW
LEFT JOIN
DEVICE_WITH_POLICY_INFO_VIEW
ON DEVICE_INFO_VIEW.DEVICE_ID = DEVICE_WITH_POLICY_INFO_VIEW.DEVICE_ID
ORDER BY DEVICE_INFO_VIEW.DEVICE_ID;
CREATE VIEW FEATURE_NON_COMPLIANCE_INFO AS
SELECT
DM_DEVICE.ID AS DEVICE_ID,
DM_DEVICE.DEVICE_IDENTIFICATION,
DM_DEVICE_DETAIL.DEVICE_MODEL,
DM_DEVICE_DETAIL.VENDOR,
DM_DEVICE_DETAIL.OS_VERSION,
DM_ENROLMENT.OWNERSHIP,
DM_ENROLMENT.OWNER,
DM_ENROLMENT.STATUS AS CONNECTIVITY_STATUS,
DM_POLICY_COMPLIANCE_STATUS.POLICY_ID,
DM_DEVICE_TYPE.NAME AS PLATFORM,
DM_POLICY_COMPLIANCE_FEATURES.FEATURE_CODE,
DM_POLICY_COMPLIANCE_FEATURES.STATUS AS IS_COMPLAINT,
DM_DEVICE.TENANT_ID
FROM
DM_POLICY_COMPLIANCE_FEATURES, DM_POLICY_COMPLIANCE_STATUS, DM_ENROLMENT, DM_DEVICE, DM_DEVICE_TYPE, DM_DEVICE_DETAIL
WHERE
DM_POLICY_COMPLIANCE_FEATURES.COMPLIANCE_STATUS_ID = DM_POLICY_COMPLIANCE_STATUS.ID AND
DM_POLICY_COMPLIANCE_STATUS.ENROLMENT_ID = DM_ENROLMENT.ID AND
DM_POLICY_COMPLIANCE_STATUS.DEVICE_ID = DM_DEVICE.ID AND
DM_DEVICE.DEVICE_TYPE_ID = DM_DEVICE_TYPE.ID AND
DM_DEVICE.ID = DM_DEVICE_DETAIL.DEVICE_ID
ORDER BY TENANT_ID, DEVICE_ID;
-- END OF DASHBOARD RELATED VIEWS --
Loading…
Cancel
Save