+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.android.download-agent/download-agent.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.android.download-agent/download-agent.js
new file mode 100644
index 0000000000..438338502a
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.android.download-agent/download-agent.js
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ var log = new Log("mdm.page.enrollments.android.agent.download");
+
+ var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
+ var viewModel = {};
+
+ // setting android agent download URL
+ // Needs host=>http:9763 since self-signed certificates won't allow downloads in android
+ //TODO: try to retrieve page name from UUF
+ viewModel.agentDownloadURL = mdmProps["generalConfig"]["host"] + mdmProps["appContext"] + "public/mdm.page.enrollments.android.download-agent/asset/" + mdmProps["androidAgentApp"];
+ var companyProps = session.get("COMPANY_DETAILS");
+ if (!companyProps) {
+ viewModel.companyName = mdmProps.generalConfig.companyName;
+ } else {
+ viewModel.companyName = companyProps.companyName;
+ }
+ return viewModel;
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.android.download-agent/download-agent.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.android.download-agent/download-agent.json
new file mode 100644
index 0000000000..2a09cb0845
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.android.download-agent/download-agent.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollments/android/download-agent",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.android.download-agent/public/asset/android-agent.apk b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.android.download-agent/public/asset/android-agent.apk
new file mode 100644
index 0000000000..62abf46b6d
Binary files /dev/null and b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.android.download-agent/public/asset/android-agent.apk differ
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.default/default.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.default/default.hbs
new file mode 100644
index 0000000000..f263f350ba
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.default/default.hbs
@@ -0,0 +1,17 @@
+{{!-- 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. --}}
+
+{{!-- This page will route into relevant download url based on User-Agent --}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.default/default.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.default/default.js
new file mode 100644
index 0000000000..5cbfb3c70c
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.default/default.js
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ var log = new Log("mdm.page.enrollments.default");
+ var UAParser = require("/app/modules/ua-parser.min.js")["UAParser"];
+
+ var parser = new UAParser();
+ var userAgent = request.getHeader("User-Agent");
+ parser.setUA(userAgent);
+ parser.getResult();
+ var os = parser.getOS();
+ var platform = os.name;
+
+ if (platform == "Android") {
+ response.sendRedirect(context.app.context + "/enrollments/android/download-agent");
+ } else if (platform == "iOS") {
+ response.sendRedirect(context.app.context + "/enrollments/ios/download-agent");
+ } else if (platform == "Windows Phone") {
+ response.sendRedirect(context.app.context + "/enrollments/windows/invoke-agent");
+ } else {
+ response.sendRedirect(context.app.context + "/enrollments/error/unintentional-request");
+ }
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.default/default.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.default/default.json
new file mode 100644
index 0000000000..25b719866f
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.default/default.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollment",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.errors.unintentional-request/unintentional-request.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.errors.unintentional-request/unintentional-request.hbs
new file mode 100644
index 0000000000..94e4604ef6
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.errors.unintentional-request/unintentional-request.hbs
@@ -0,0 +1,33 @@
+{{!-- 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. --}}
+
+{{!-- Inputting content into defined zones in enrollment layout --}}
+{{unit "mdm.unit.ui.title" pageTitle="Device Enrollment"}}
+{{#zone "headerTitle"}}
+ Unintentional Request
+{{/zone}}
+{{#zone "content"}}
+
+
Possible Causes :
+
+ [1] You have tried making a request call intended to be made by a different Platform.
+ [2] You have tried accessing enrollment steps out of order.
+
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.errors.unintentional-request/unintentional-request.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.errors.unintentional-request/unintentional-request.json
new file mode 100644
index 0000000000..ba7b6802b5
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.errors.unintentional-request/unintentional-request.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollments/error/unintentional-request",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.certificate-error/certificate-error.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.certificate-error/certificate-error.hbs
new file mode 100644
index 0000000000..3251535bb1
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.certificate-error/certificate-error.hbs
@@ -0,0 +1,34 @@
+{{!-- 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. --}}
+
+{{!-- Inputting content into defined zones in enrollment layout --}}
+{{unit "mdm.unit.ui.title" pageTitle="iOS Enrollment | Certificate Download Failure"}}
+{{#zone "headerTitle"}}
+ iOS Certificate Download Failure
+{{/zone}}
+{{#zone "content"}}
+
+
Possible Causes :
+
+ [1] Network Issue.
+ [2] Bad Request Call to Server.
+ [3] Internal Server Error.
+
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.certificate-error/certificate-error.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.certificate-error/certificate-error.json
new file mode 100644
index 0000000000..a2a10b89de
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.certificate-error/certificate-error.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollments/error/ios/certificate-download-failure",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/download-agent.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/download-agent.hbs
new file mode 100644
index 0000000000..5b2429a12e
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/download-agent.hbs
@@ -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. --}}
+
+{{!-- defining controlled access parameters --}}
+{{#zone "accessControl"}}
+ {{
+ unit "mdm.unit.enrollments.access-control"
+ allowedPlatform = "iOS"
+ currentPage = "download-agent"
+ nextPage = "login-agent"
+ }}
+{{/zone}}
+{{!-- Inputting content into defined zones in enrollment layout --}}
+{{unit "mdm.unit.ui.title" pageTitle="iOS Enrollment | Install Certificate and Agent"}}
+{{#zone "headerTitle"}}
+ iOS Enrollment
+{{/zone}}
+{{#zone "content"}}
+ {{
+ unit "mdm.unit.wizard-stepper"
+ steps = "Install Certificate and Agent,
+ Login to Enterprise Mobility Manager,
+ Accept End User License Agreement"
+ currentStep = "Install Certificate and Agent"
+ currentStepIndex = 0
+ }}
+
+
+ If you have not already enrolled this device with {{companyName}},
+ Install following EMM Certificate and Agent to continue.
+
+
+ Also note : EMM certificate should be first installed on the device for a
+ successful installation of the agent.
+
+
+
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/download-agent.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/download-agent.js
new file mode 100644
index 0000000000..cdc1d7695d
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/download-agent.js
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ var log = new Log("asset-download-agent-ios-unit");
+ log.debug("calling asset-download-agent-ios-unit backend js");
+
+ var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
+ var viewModel = {};
+ // setting iOS certificate download URL
+ viewModel.emmCertificateDownloadURL = context.app.context + "/enrollment/ios/download-certificate";
+ // setting iOS agent download URL
+ viewModel.agentDownloadURL = "itms-services://?action=download-manifest&url=" +
+ mdmProps["httpsURL"] + context.app.context + "/enrollment/ios/download-agent";
+ var companyProps = session.get("COMPANY_DETAILS");
+ if (!companyProps) {
+ viewModel.companyName = mdmProps.generalConfig.companyName;
+ } else {
+ viewModel.companyName = companyProps.companyName;
+ }
+ return viewModel;
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/download-agent.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/download-agent.json
new file mode 100644
index 0000000000..ee5e8ebaea
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/download-agent.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollments/ios/download-agent",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/public/asset/Readme.txt b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/public/asset/Readme.txt
new file mode 100644
index 0000000000..d6e6df93ea
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.download-agent/public/asset/Readme.txt
@@ -0,0 +1 @@
+Add the iOS-agent with the name "ios-agent.ipa" into this folder.
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/license.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/license.hbs
new file mode 100644
index 0000000000..796ff5a964
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/license.hbs
@@ -0,0 +1,59 @@
+{{!-- 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. --}}
+
+{{!-- defining controlled access parameters --}}
+{{#zone "accessControl"}}
+ {{
+ unit "mdm.unit.enrollments.access-control"
+ allowedPlatform = "iOS"
+ currentPage = "license-agent"
+ lastPage = "login-agent"
+ nextPage = "thank-you-agent"
+ }}
+{{/zone}}
+{{!-- Inputting content into defined zones in enrollment layout --}}
+{{unit "mdm.unit.ui.title" pageTitle="iOS Enrollment | Accept End User License Agreement"}}
+
+{{#zone "headerTitle"}}
+ iOS Enrollment
+{{/zone}}
+
+{{#zone "content"}}
+ {{
+ unit "mdm.unit.wizard-stepper"
+ steps = "Install Certificate and Agent,
+ Login to Enterprise Mobility Manager,
+ Accept End User License Agreement"
+ currentStep = "Accept End User License Agreement"
+ currentStepIndex = 2
+ }}
+ {{
+ unit "mdm.unit.enrollments.license-box"
+ platform = "ios"
+ languageCode = "en_US"
+ licenseAcceptActionURL = iosLicenseAcceptURL
+ }}
+{{/zone}}
+
+{{#zone "topJs"}}
+
+{{/zone}}
+
+{{#zone "bottomJs"}}
+ {{js "/js/enrollment-completion-checker-ios.js"}}
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/license.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/license.js
new file mode 100644
index 0000000000..6193ae7530
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/license.js
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ var viewModel = {};
+ // setting iOS license download URL
+ viewModel.iosLicenseAcceptURL = context.app.context + "/enrollment/ios/enroll";
+ return viewModel;
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/license.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/license.json
new file mode 100644
index 0000000000..eaf1ab5779
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/license.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollments/ios/license-agent",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/public/js/enrollment-completion-checker-ios.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/public/js/enrollment-completion-checker-ios.js
new file mode 100644
index 0000000000..169fdbdd35
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.license/public/js/enrollment-completion-checker-ios.js
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+$(document).ready(function () {
+ var iOSCheckUrl = contextPath + "/enrollment/ios/check";
+ setInterval(function () {
+ $.post(iOSCheckUrl, function (data, status) {
+ var parsedData = JSON.parse(data);
+ var deviceId = parsedData["deviceID"];
+ var refreshToken = parsedData["refreshToken"];
+ var accessToken = parsedData["accessToken"];
+ var clientCredentials = parsedData["clientCredentials"];
+ if (deviceId) {
+ window.location = contextPath + "/enrollments/ios/thank-you-agent?device-id=" + encodeURI(deviceId) +
+ "&accessToken=" + encodeURI(accessToken) + "&refreshToken=" + encodeURI(refreshToken)
+ + "&clientCredentials=" + encodeURI(clientCredentials);
+ }
+ });
+ }, 1000);
+});
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.login/login.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.login/login.hbs
new file mode 100644
index 0000000000..a185d5f1fd
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.login/login.hbs
@@ -0,0 +1,45 @@
+{{!-- 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. --}}
+
+{{!-- defining controlled access parameters --}}
+{{#zone "accessControl"}}
+ {{
+ unit "mdm.unit.enrollments.access-control"
+ allowedPlatform = "iOS"
+ currentPage = "login-agent"
+ lastPage = "download-agent"
+ nextPage = "license-agent"
+ }}
+{{/zone}}
+{{!-- Inputting content into defined zones in enrollment layout --}}
+{{unit "mdm.unit.ui.title" pageTitle="iOS Enrollment | Login to Enterprise Mobility Manager"}}
+{{#zone "headerTitle"}}
+ iOS Enrollment
+{{/zone}}
+{{#zone "content"}}
+ {{
+ unit "mdm.unit.wizard-stepper"
+ steps = "Install Certificate and Agent,
+ Login to Enterprise Mobility Manager,
+ Accept End User License Agreement"
+ currentStep = "Login to Enterprise Mobility Manager"
+ currentStepIndex = 1
+ }}
+ {{
+ unit "mdm.unit.enrollments.login-box"
+ loginActionURL = iosLoginActionURL
+ }}
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.login/login.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.login/login.js
new file mode 100644
index 0000000000..7ffe438b51
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.login/login.js
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ var viewModel = {};
+ // setting iOS login URL
+ viewModel.iosLoginActionURL = context.app.context + "/enrollment/ios/login";
+ return viewModel;
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.login/login.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.login/login.json
new file mode 100644
index 0000000000..26572e27ac
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.login/login.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollments/ios/login-agent",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/public/js/enrollment-success-note-ios.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/public/js/enrollment-success-note-ios.js
new file mode 100644
index 0000000000..5d53d804b7
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/public/js/enrollment-success-note-ios.js
@@ -0,0 +1,35 @@
+/*
+ * 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 getParameterByName = function (name) {
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
+ var regex = new RegExp("[\\?&]" + name + "=([^]*)"), results = regex.exec(location.search);
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
+};
+
+$(document).ready(function () {
+ setTimeout(function () {
+ var deviceID = getParameterByName("device-id");
+ var accessToken = getParameterByName("accessToken");
+ var refreshToken = getParameterByName("refreshToken");
+ var clientCredentials = getParameterByName("clientCredentials");
+// window.location.href = "wso2agent://" + deviceID;
+ window.location.href = "wso2agent://" + deviceID + "?accessToken=" +
+ accessToken +"&refreshToken=" + refreshToken + "&clientCredentials=" + clientCredentials;
+ }, 1000);
+});
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/thank-you.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/thank-you.hbs
new file mode 100644
index 0000000000..5bc7a1ae59
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/thank-you.hbs
@@ -0,0 +1,52 @@
+{{!-- 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. --}}
+
+{{!-- defining controlled access parameters --}}
+{{#zone "accessControl"}}
+ {{
+ unit "mdm.unit.enrollments.access-control"
+ allowedPlatform = "iOS"
+ currentPage = "thank-you-agent"
+ lastPage = "license-agent"
+ }}
+{{/zone}}
+{{!-- Inputting content into defined zones in enrollment layout --}}
+{{unit "mdm.unit.ui.title" pageTitle="iOS Enrollment | Success Note"}}
+{{#zone "headerTitle"}}
+ iOS Enrollment
+{{/zone}}
+{{#zone "content"}}
+
+
DEVICE ADDED
+
+ You have successfully enrolled your iOS device with {{companyName}}.
+
+
+ Device Owner : {{deviceOwner}}
+
+
+ Changes related to your company device policy will usually be applied
+ on your phone with in the next couple of minutes.
+
+
+ Thank You.
+
+
{{companyName}}
+{{/zone}}
+
+{{#zone "bottomJs"}}
+ {{js "/js/enrollment-success-note-ios.js"}}
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/thank-you.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/thank-you.js
new file mode 100644
index 0000000000..90be529495
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/thank-you.js
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+function onRequest (context) {
+ var viewModel = {};
+ var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
+ viewModel.deviceOwner = session.get("enrolledUser");
+ viewModel.serverURL = mdmProps["httpsURL"] + context.app.context;
+ var companyProps = session.get("COMPANY_DETAILS");
+ if (!companyProps) {
+ viewModel.companyName = mdmProps.generalConfig.companyName;
+ } else {
+ viewModel.companyName = companyProps.companyName;
+ }
+ return viewModel;
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/thank-you.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/thank-you.json
new file mode 100644
index 0000000000..adfc78e7ed
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.ios.thank-you/thank-you.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollments/ios/thank-you-agent",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.invoke-agent/invoke-agent.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.invoke-agent/invoke-agent.hbs
new file mode 100644
index 0000000000..18375a801b
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.invoke-agent/invoke-agent.hbs
@@ -0,0 +1,53 @@
+{{!-- 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. --}}
+
+{{!-- defining controlled access parameters --}}
+{{#zone "accessControl"}}
+ {{
+ unit "mdm.unit.enrollments.access-control"
+ allowedPlatform = "Windows Phone"
+ currentPage = "invoke-agent"
+ nextPage = "login-agent"
+ }}
+{{/zone}}
+{{!-- Inputting content into defined zones in enrollment layout --}}
+{{unit "mdm.unit.ui.title" pageTitle="Windows Phone Enrollment | Start Workplace"}}
+{{#zone "headerTitle"}}
+ Windows Phone Enrollment
+{{/zone}}
+{{#zone "content"}}
+ {{
+ unit "mdm.unit.wizard-stepper"
+ steps = "Start Workplace,
+ Login to Enterprise Mobility Manager,
+ Accept End User License Agreement"
+ currentStep = "Start Workplace"
+ currentStepIndex = 0
+ }}
+ Start the Workplace app to continue device enrollment.
+
+
+ Setting up a Workplace account with WSO2 Enterprise Mobility Manager
+ will offer you company policies, certificates and apps that help you connect
+ to your business.
+
+
+
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.invoke-agent/invoke-agent.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.invoke-agent/invoke-agent.json
new file mode 100644
index 0000000000..2c11547792
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.invoke-agent/invoke-agent.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollments/windows/invoke-agent",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.license/license.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.license/license.hbs
new file mode 100644
index 0000000000..e51813f428
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.license/license.hbs
@@ -0,0 +1,46 @@
+{{!-- 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. --}}
+
+{{!-- defining controlled access parameters --}}
+{{#zone "accessControl"}}
+ {{
+ unit "mdm.unit.enrollments.access-control"
+ allowedPlatform = "Windows Phone"
+ currentPage = "license-agent"
+ lastPage = "login-agent"
+ }}
+{{/zone}}
+{{!-- Inputting content into defined zones in enrollment layout --}}
+{{unit "mdm.unit.ui.title" pageTitle="Windows Phone Enrollment | Accept End User License Agreement"}}
+{{#zone "headerTitle"}}
+ Windows Phone Enrollment
+{{/zone}}
+{{#zone "content"}}
+ {{
+ unit "mdm.unit.wizard-stepper"
+ steps = "Start Workplace,
+ Login to Enterprise Mobility Manager,
+ Accept End User License Agreement"
+ currentStep = "Accept End User License Agreement"
+ currentStepIndex = 2
+ }}
+ {{
+ unit "mdm.unit.enrollments.license-box"
+ platform = "windows"
+ languageCode = "en_US"
+ licenseAcceptActionURL = windowsLicenseAcceptURL
+ }}
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.license/license.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.license/license.js
new file mode 100644
index 0000000000..01da95f27a
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.license/license.js
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ var viewModel = {};
+ // setting iOS license download URL
+ viewModel.windowsLicenseAcceptURL = context.app.context + "/enrollment/windows/enroll";
+ return viewModel;
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.license/license.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.license/license.json
new file mode 100644
index 0000000000..574c45a01f
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.license/license.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollments/windows/license-agent",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.login/login.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.login/login.hbs
new file mode 100644
index 0000000000..458c63acc8
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.login/login.hbs
@@ -0,0 +1,45 @@
+{{!-- 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. --}}
+
+{{!-- defining controlled access parameters --}}
+{{#zone "accessControl"}}
+ {{
+ unit "mdm.unit.enrollments.access-control"
+ allowedPlatform = "Windows Phone"
+ currentPage = "login-agent"
+ lastPage = "invoke-agent"
+ nextPage = "license-agent"
+ }}
+{{/zone}}
+{{!-- Inputting content into defined zones in enrollment layout --}}
+{{unit "mdm.unit.ui.title" pageTitle="Windows Phone Enrollment | Login to Enterprise Mobility Manager"}}
+{{#zone "headerTitle"}}
+ Windows Phone Enrollment
+{{/zone}}
+{{#zone "content"}}
+ {{
+ unit "mdm.unit.wizard-stepper"
+ steps = "Start Workplace,
+ Login to Enterprise Mobility Manager,
+ Accept End User License Agreement"
+ currentStep = "Login to Enterprise Mobility Manager"
+ currentStepIndex = 1
+ }}
+ {{
+ unit "mdm.unit.enrollments.login-box"
+ loginActionURL = windowsLoginActionURL
+ }}
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.login/login.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.login/login.js
new file mode 100644
index 0000000000..f25943ecc5
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.login/login.js
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ var log = new Log("agent-to-web-context-mapper-windows-unit backend js");
+ log.debug("calling agent-to-web-context-mapper-windows-unit");
+
+ var viewModel = {};
+ if (!(session.get("email") && session.get("windowsWorkplaceAppID"))) {
+ // if both email and windowsWorkplaceAppID session values are not set
+ // this means either shifting to the page from agent or directly accessing the page out-of-order
+
+ // checking if user is actually shifting to the page from agent
+ // login_hint passes the user email value entered in Windows workplace app
+ var userEmail = request.getParameter("login_hint");
+ // appru passes app ID of the Windows workplace app
+ var windowsWorkplaceAppID = request.getParameter("appru");
+ if (!userEmail || !windowsWorkplaceAppID) {
+ response.sendRedirect(context.app.context + "/enrollments/error/unintentional-request");
+ } else {
+ /* allowing to skip first step of windows enrollment by
+ setting session.put("lastAccessedPage", "invoke-agent")...
+ This update was proposed to overcome following problem:
+ First step of enrollment and second step of enrollment being linked with two sessions as
+ first step is initiated by Internet explorer and the second by an internal web-view */
+ session.put("lastAccessedPage", "invoke-agent");
+ session.put("email", userEmail);
+ session.put("windowsWorkplaceAppID", windowsWorkplaceAppID);
+ }
+ }
+
+ // setting windows login URL
+ viewModel.windowsLoginActionURL = context.app.context + "/enrollment/windows/login";
+ return viewModel;
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.login/login.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.login/login.json
new file mode 100644
index 0000000000..433caeb464
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.enrollments.windows.login/login.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/enrollments/windows/login-agent",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.error/error.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.error/error.hbs
new file mode 100644
index 0000000000..2c5ac1084e
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.error/error.hbs
@@ -0,0 +1,32 @@
+{{!-- 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. --}}
+
+{{!-- Inputting content into defined zones in enrollment layout --}}
+{{unit "mdm.unit.ui.title" pageTitle="Page Error"}}
+{{#zone "headerTitle"}}
+ 404 - Resource Not Found
+{{/zone}}
+{{#zone "content"}}
+
+
Possible Causes :
+
+ You are seen this page since the resource you are trying to access is not available.
+
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.error/error.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.error/error.json
new file mode 100644
index 0000000000..8bfc512818
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.error/error.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/error/404",
+ "layout": "mdm.layout.enrollment",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.home/home.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.home/home.json
new file mode 100644
index 0000000000..4f2dd893dd
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/pages/mdm.page.home/home.json
@@ -0,0 +1,6 @@
+{
+ "version": "1.0.0",
+ "uri": "/",
+ "isAnonymous": true,
+ "extends": "mdm.page.error"
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.access-control/access-control.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.access-control/access-control.hbs
new file mode 100644
index 0000000000..ea9d56cae1
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.access-control/access-control.hbs
@@ -0,0 +1,15 @@
+{{!-- 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. --}}
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.access-control/access-control.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.access-control/access-control.js
new file mode 100644
index 0000000000..58d161f3ea
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.access-control/access-control.js
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ var log = new Log("enrollment-access-control-unit backend js");
+ log.debug("calling enrollment-access-control-unit");
+
+ var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
+ var UAParser = require("/app/modules/ua-parser.min.js")["UAParser"];
+
+ var parser = new UAParser();
+ var userAgent = request.getHeader("User-Agent");
+ parser.setUA(userAgent);
+ parser.getResult();
+ var userAgentPlatform = parser.getOS()["name"];
+
+ if (userAgentPlatform != context.unit.params["allowedPlatform"]) {
+ // if userAgentPlatform is not allowed
+ log.error("platform not allowed");
+ response.sendRedirect(context.app.context + "/enrollments/error/unintentional-request");
+ } else {
+ var lastPage = context.unit.params["lastPage"];
+ var nextPage = context.unit.params["nextPage"];
+ var currentPage = context.unit.params["currentPage"];
+ // if userAgentPlatform is allowed,
+ // restricting unordered intermediate page access
+ if (lastPage && currentPage && nextPage) {
+ // meaning it's not first page, but a middle page
+ if (!session.get("lastAccessedPage")) {
+ // meaning a middle page is accessed at first
+ response.sendRedirect(context.app.context + "/enrollments/error/unintentional-request");
+ } else if (!(session.get("lastAccessedPage") == currentPage) &&
+ !(session.get("lastAccessedPage") == lastPage) &&
+ !(session.get("lastAccessedPage") == nextPage)) {
+ response.sendRedirect(context.app.context + "/enrollments/error/unintentional-request");
+ } else if (currentPage) {
+ // if currentPage is set, update lastAccessedPage as currentPage
+ session.put("lastAccessedPage", currentPage);
+ }
+ } else if (lastPage && currentPage && !nextPage) {
+ // meaning it's not first page, not a middle page, but the last page in wizard
+ if (!session.get("lastAccessedPage")) {
+ // this means the last page is accessed at first
+ response.sendRedirect(context.app.context + "/enrollments/error/unintentional-request");
+ } else if (!(session.get("lastAccessedPage") == currentPage) &&
+ !(session.get("lastAccessedPage") == lastPage)) {
+ response.sendRedirect(context.app.context + "/enrollments/error/unintentional-request");
+ } else if (currentPage) {
+ // if currentPage is set, update lastAccessedPage as currentPage
+ session.put("lastAccessedPage", currentPage);
+ }
+ } else if (currentPage) {
+ // meaning it's the first page
+ // if currentPage is set, update lastAccessedPage as currentPage
+ session.put("lastAccessedPage", currentPage);
+ }
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("last-accessed-page = " + session.get("lastAccessedPage") +
+ " : " + "session-id = " + session.getId());
+ }
+ return context;
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.access-control/access-control.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.access-control/access-control.json
new file mode 100644
index 0000000000..f2f22da9a9
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.access-control/access-control.json
@@ -0,0 +1,4 @@
+{
+ "version": "1.0.0",
+ "isAnonymous": true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/license-box.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/license-box.hbs
new file mode 100644
index 0000000000..e8a202e6d5
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/license-box.hbs
@@ -0,0 +1,37 @@
+{{!-- 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. --}}
+
+
+
+
+ Please read the following end user license agreement carefully.
+ In order to complete device enrollment, you must accept these terms.
+
+
+
{{companyName}} License Agreement
+
{{license}}
+
+
+
+
+
+{{#zone "bottomJs"}}
+ {{js "/js/license-box.js"}}
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/license-box.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/license-box.js
new file mode 100644
index 0000000000..921c34ba79
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/license-box.js
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ var log = new Log("license-box-agent-unit");
+ log.debug("calling license-box-agent-unit backend js");
+
+ var viewModel = {};
+ var deviceModule = require("/app/modules/business-controllers/device.js")["deviceModule"];
+ var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
+
+ var license = deviceModule.getLicense(context.unit.params["platform"], context.unit.params["languageCode"]);
+ if (license) {
+ viewModel.license = license;
+ } else {
+ viewModel.license = "ERROR: Unable to retrieve License Text.";
+ }
+
+ var companyProps = session.get("COMPANY_DETAILS");
+ if (!companyProps) {
+ viewModel.companyName = mdmProps.generalConfig.companyName;
+ } else {
+ viewModel.companyName = companyProps.companyName;
+ }
+ return viewModel;
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/license-box.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/license-box.json
new file mode 100644
index 0000000000..7769b28fb9
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/license-box.json
@@ -0,0 +1,4 @@
+{
+ "version" : "1.0.0",
+ "isAnonymous" : true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/public/js/license-box.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/public/js/license-box.js
new file mode 100644
index 0000000000..3a9497885f
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.license-box/public/js/license-box.js
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+$(document).ready(function () {
+ var license = $("#license-text").text();
+ $("#license-text").html(license);
+});
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/login-box.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/login-box.hbs
new file mode 100644
index 0000000000..9560b933ec
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/login-box.hbs
@@ -0,0 +1,74 @@
+{{!-- Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+
+WSO2 Inc. licenses this file to you under the Apache License,
+Version 2.0 (the "License"); you may not use this file except
+in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License. --}}
+
+
+{{#zone "bottomJs"}}
+ {{js "/js/login-box.js"}}
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/login-box.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/login-box.js
new file mode 100644
index 0000000000..e1f8bf3b41
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/login-box.js
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ context.handlebars.registerHelper("excludes", function (lvalue, rvalue, options) {
+ if (arguments.length < 3) {
+ throw new Error("Handlebars Helper equal needs 2 parameters");
+ }
+ if (lvalue.indexOf(rvalue) > -1) {
+ return options.inverse(this);
+ } else {
+ return options.fn(this);
+ }
+ });
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/login-box.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/login-box.json
new file mode 100644
index 0000000000..9c7b7aa6d8
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/login-box.json
@@ -0,0 +1,4 @@
+{
+ "version" : "1.0.0",
+ "isAnonymous" : true
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/public/js/login-box.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/public/js/login-box.js
new file mode 100644
index 0000000000..cbdff93944
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.enrollments.login-box/public/js/login-box.js
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ *
+ * WSO2 Inc. licenses this file to you under the Apache License,
+ * Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ * either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * This method will return query parameter value given its name
+ * @param name Query parameter name
+ * @returns {string} Query parameter value
+ */
+var getParameterByName = function (name) {
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
+ var regex = new RegExp("[\\?&]" + name + "=([^]*)"),
+ results = regex.exec(location.search);
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
+};
+
+var errorMsgWrapper = "#enrollment-error-msg";
+var errorMsg = errorMsgWrapper + " span";
+
+/**
+ * This method will execute on login form submission and validate input.
+ * @returns {boolean}
+ */
+var validate = function () {
+ var username = $("input#username").val();
+ var password = $("input#password").val();
+
+ if (!username && !password) {
+ $(errorMsg).text("Both username and password are empty. You cannot proceed.");
+ if ($(errorMsgWrapper).hasClass("hidden")) {
+ $(errorMsgWrapper).removeClass("hidden");
+ }
+ return false;
+ } else if (!username && password) {
+ $(errorMsg).text("Username should not be empty.");
+ if ($(errorMsgWrapper).hasClass("hidden")) {
+ $(errorMsgWrapper).removeClass("hidden");
+ }
+ return false;
+ } else if (username && !password) {
+ $(errorMsg).text("Password should not be empty.");
+ if ($(errorMsgWrapper).hasClass("hidden")) {
+ $(errorMsgWrapper).removeClass("hidden");
+ }
+ return false;
+ } else {
+ return true;
+ }
+};
+
+$(document).ready(function () {
+ var error = getParameterByName("error");
+ if (error == "auth-failed") {
+ var defaultMessage = "Please provide a correct username and password to continue.";
+ var customMessage = getParameterByName("message");
+ if (customMessage) {
+ $(errorMsg).text("Authentication failed. " + customMessage);
+ } else {
+ $(errorMsg).text("Authentication failed. " + defaultMessage);
+ }
+ $(errorMsgWrapper).removeClass("hidden");
+ } else if (error == "unexpected") {
+ $(errorMsg).text("An unexpected error occured. Please try again.");
+ $(errorMsgWrapper).removeClass("hidden");
+ }
+});
+
+$(".btn-download-agent").click(function () {
+ $(".form-login-box").submit();
+});
+
+
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.content.title/title.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.content.title/title.hbs
new file mode 100644
index 0000000000..00dbfdafea
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.content.title/title.hbs
@@ -0,0 +1,24 @@
+{{!
+ 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.
+}}
+{{#zone "contentTitle"}}
+
+
+ {{@unit.params.pageHeader}}
+
+
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.content.title/title.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.content.title/title.json
new file mode 100644
index 0000000000..9eecd8f5bf
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.content.title/title.json
@@ -0,0 +1,3 @@
+{
+ "version": "1.0.0"
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.logo/logo.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.logo/logo.hbs
new file mode 100644
index 0000000000..02f29a3459
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.logo/logo.hbs
@@ -0,0 +1,24 @@
+{{!
+ 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.
+}}
+{{#zone "brand"}}
+
+
+ Enterprise Mobility Manager
+
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.logo/logo.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.logo/logo.json
new file mode 100644
index 0000000000..359f3d131b
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.logo/logo.json
@@ -0,0 +1,4 @@
+{
+ "version": "1.0.0",
+ "extends": "uuf.unit.header.logo"
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.user-menu/user-menu.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.user-menu/user-menu.hbs
new file mode 100644
index 0000000000..5fc7ac3bca
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.user-menu/user-menu.hbs
@@ -0,0 +1,22 @@
+{{!
+ 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.
+}}
+{{#zone "userMenu-items"}}
+
+ Logout
+
+{{/zone}}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.user-menu/user-menu.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.user-menu/user-menu.json
new file mode 100644
index 0000000000..0fa59af73a
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.header.user-menu/user-menu.json
@@ -0,0 +1,4 @@
+{
+ "version": "1.0.0",
+ "extends" : "uuf.unit.header.user-menu"
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.hbs b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.hbs
new file mode 100644
index 0000000000..4aa6a9fdb0
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.hbs
@@ -0,0 +1,117 @@
+{{!
+ 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.
+}}
+{{#zone "navMenu-icon"}}
+
+
+
+{{/zone}}
+
+{{#zone "navMenu-items"}}
+ {{#if permissions.VIEW_DASHBOARD}}
+
+
+
+ Admin Dashboard
+
+
+ {{/if}}
+ {{#if permissions.LIST_DEVICES_ADMIN}}
+
+
+
+ Device Management
+
+
+ {{else}}
+ {{#if permissions.LIST_OWN_DEVICES}}
+
+
+
+ Device Management
+
+
+ {{/if}}
+ {{/if}}
+ {{#if permissions.LIST_GROUPS}}
+
+
+
+ Group Management
+
+
+ {{/if}}
+
User Management
+
+ {{#if permissions.LIST_USERS}}
+ - Users
+ {{/if}}
+
+ {{#if permissions.LIST_ROLES}}
+ - Roles
+ {{/if}}
+
+
+ {{#if permissions.LIST_POLICIES}}
+
Policy Management
+ {{/if}}
+
Configuration Management
+
+
+{{/zone}}
+
+{{#zone "navbarCollapsableRightItems"}}
+
+{{/zone}}
+{{#zone "sidePanes"}}
+
+{{/zone}}
+{{#zone "bottomJs"}}
+
+ {{js "js/nav-menu.js"}}
+{{/zone}}
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.js
new file mode 100644
index 0000000000..ebf967e07f
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.js
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+function onRequest(context) {
+ context.handlebars.registerHelper('equal', function (lvalue, rvalue, options) {
+ if (arguments.length < 3) {
+ throw new Error("Handlebars Helper equal needs 2 parameters");
+ }
+ if (lvalue != rvalue) {
+ return options.inverse(this);
+ } else {
+ return options.fn(this);
+ }
+ });
+ var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
+ var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
+ var constants = require("/app/modules/constants.js");
+ var uiPermissions = userModule.getUIPermissions();
+ context["permissions"] = uiPermissions;
+
+ var links = {
+ "user-mgt": [],
+ "role-mgt": [],
+ "policy-mgt": [],
+ "device-mgt": []
+ };
+
+ // following context.link value comes here based on the value passed at the point
+ // where units are attached to a page zone.
+ // eg: {{unit "appbar" pageLink="users" title="User Management"}}
+ context["currentActions"] = links[context["pageLink"]];
+ context["enrollmentURL"] = mdmProps["generalConfig"]["host"] + mdmProps["enrollmentDir"];
+ var isAuthorizedForNotifications =
+ userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/notifications/view");
+ var currentUser = session.get(constants["USER_SESSION_KEY"]);
+ context["isAuthorizedForNotifications"] = isAuthorizedForNotifications;
+ context["currentUser"] = currentUser;
+ context["appContext"] = context.app.context;
+
+ return context;
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.json
new file mode 100644
index 0000000000..c469d0751b
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.json
@@ -0,0 +1,8 @@
+{
+ "version": "1.0.0",
+ "index": 30,
+ "pushedUris": [
+ "/",
+ "/{+any}"
+ ]
+}
\ No newline at end of file
diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/public/js/jquery.qrcode.min.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/public/js/jquery.qrcode.min.js
new file mode 100644
index 0000000000..2a169909b2
--- /dev/null
+++ b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/app/units/mdm.unit.ui.navbar.nav-menu/public/js/jquery.qrcode.min.js
@@ -0,0 +1,47 @@
+//---------------------------------------------------------------------
+// QRCode for JavaScript
+//
+// Copyright (c) 2009 Kazuhiko Arase
+//
+// URL: http://www.d-project.com/
+//
+// Licensed under the MIT license:
+// http://www.opensource.org/licenses/mit-license.php
+//
+// The word "QR Code" is registered trademark of
+// DENSO WAVE INCORPORATED
+// http://www.denso-wave.com/qrcode/faqpatent-e.html
+//
+//---------------------------------------------------------------------
+
+//---------------------------------------------------------------------
+// QR8bitByte
+//---------------------------------------------------------------------
+(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d
a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
+ 0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
+ j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
+ b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0g;g++)if(null==this.modules[b][i-g]){var n=!1;f>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
+ c),b=new t,e=0;e8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
+ 0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
+a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;dc)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
+a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
+ LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d
+ this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b>>7-a%8&1)},put:function(a,c){for(var d=0;d>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
+ correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e