diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/pom.xml b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/pom.xml deleted file mode 100644 index 88e473897..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - mobile-base-plugin - org.wso2.carbon.devicemgt-plugins - 2.2.8-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.device.mgt.mobile.ui - WSO2 Carbon - EMM Server UI - pom - - - - - maven-assembly-plugin - 2.5.5 - - ${project.artifactId}-${carbon.devicemgt.plugins.version} - false - - src/assembly/src.xml - - - - - create-archive - package - - single - - - - - - - - \ 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/devicemgt/app/conf/app-conf.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json deleted file mode 100644 index d3e82ad57..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "appName": "WSO2 Enterprise Mobility Manager", - "cachingEnabled": true, - "debuggingEnabled": false, - "permissionRoot": "/", - "loginPage": "cdmf.page.sign-in", - "adminServicesUrl": "https://${server.ip}:${server.https_port}/admin/services/", - "authModule": { - "enabled": true, - "login": { - "onSuccess": { - "script": "/app/modules/login.js", - "page": "mdm.page.dashboard" - }, - "onFail": { - "script": "/app/modules/login.js", - "page": "cdmf.page.sign-in" - } - }, - "logout": { - "onSuccess": { - "page": "cdmf.page.sign-in" - }, - "onFail": { - "page": "mdm.page.dashboard" - } - }, - "sso": { - "enabled": false, - "issuer" : "emm", - "appName" : "emm", - "identityProviderUrl" : "https://localhost:9443/samlsso", - "acs": "https://localhost:9443/emm/uuf/sso/acs", - "identityAlias": "wso2carbon", - "responseSigningEnabled" : true, - "validateAssertionValidityPeriod": true, - "validateAudienceRestriction": true, - "assertionSigningEnabled": true - } - }, - "generalConfig" : { - "host" : "https://localhost:9443", - "companyName" : "WSO2 Enterprise Mobility Manager", - "browserTitle" : "WSO2 EMM", - "copyrightPrefix" : "\u00A9 %date-year%, ", - "copyrightOwner" : "WSO2 Inc.", - "copyrightOwnersSite" : "http://www.wso2.org", - "copyrightSuffix" : "" - }, - "errorPages": { - "default": "uuf.page.error" - } -} diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json deleted file mode 100644 index 434db0a38..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json +++ /dev/null @@ -1,124 +0,0 @@ -{ - "appContext": "/emm/", - "webAgentContext" : "/emm-web-agent/", - "apiContext": "api", - "httpsURL" : "%https.ip%", - "httpURL" : "%http.ip%", - "httpsWebURL" : "%https.ip%", - "wssURL" : "%https.ip%", - "wsURL" : "%http.ip%", - "enrollmentDir": "/emm-web-agent/enrollment", - "iOSConfigRoot" : "%https.ip%/ios-enrollment/", - "iOSAPIRoot" : "%https.ip%/ios/", - "adminService": "%https.ip%", - "oauthProvider": { - "appRegistration": { - "appType": "webapp", - "clientName": "emm", - "owner": "admin@carbon.super", - "dynamicClientAppRegistrationServiceURL": "%https.ip%/dynamic-client-web/register", - "apiManagerClientAppRegistrationServiceURL": "%https.ip%/api-application-registration/register/tenants", - "grantType": "password refresh_token urn:ietf:params:oauth:grant-type:saml2-bearer urn:ietf:params:oauth:grant-type:jwt-bearer", - "tokenScope": "admin", - "callbackUrl": "%https.ip%/api/device-mgt/v1.0" - }, - "tokenServiceURL": "%https.ip%/oauth2/token" - }, - "adminUser": "admin@carbon.super", - "adminRole": "admin", - "usernameLength": 30, - "pageSize":10, - "ssoConfiguration" : { - "enabled" : false, - "issuer" : "devicemgt", - "appName" : "devicemgt", - "identityProviderURL" : "%https.ip%/sso/samlsso.jag", - "responseSigningEnabled" : "true", - "keyStorePassword" : "wso2carbon", - "identityAlias" : "wso2carbon", - "keyStoreName" : "/repository/resources/security/wso2carbon.jks" - }, - "userValidationConfig" : { - "usernameJSRegEx" : "^[\\S]{3,30}$", - "usernameRegExViolationErrorMsg" : "Provided username is invalid.", - "usernameHelpMsg" : "Should be in minimum 3 characters long and do not include any whitespaces.", - "firstnameJSRegEx" : "^[\\S]{3,30}$", - "firstnameRegExViolationErrorMsg" : "Provided first name is invalid.", - "lastnameJSRegEx" : "^[\\S]{3,30}$", - "lastnameRegExViolationErrorMsg" : "Provided last name is invalid.", - "emailJSRegEx" : "/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/", - "emailRegExViolationErrorMsg" : "Provided email is invalid." - }, - "groupValidationConfig": { - "groupNameJSRegEx": "^[\\S]{3,30}$", - "groupNameRegExViolationErrorMsg": "Provided group name is invalid.", - "groupNameHelpMsg": "Should be in minimum 3 characters long and should not include any whitespaces." - }, - "roleValidationConfig" : { - "roleNameJSRegEx" : "^[\\S]{3,30}$", - "roleNameRegExViolationErrorMsg" : "Provided role name is invalid.", - "roleNameHelpMsg" : "should be in minimum 3 characters long and do not include any whitespaces." - }, - "generalConfig" : { - "host" : "%https.ip%", - "companyName" : "WSO2 Carbon Device Manager", - "browserTitle" : "WSO2 Device Manager", - "copyrightPrefix" : "\u00A9 %date-year%, ", - "copyrightOwner" : "WSO2 Inc.", - "copyrightOwnersSite" : "http://www.wso2.org", - "copyrightSuffix" : " All Rights Reserved." - }, - "scopes" : [ - "user:manage", - "user:view", - "device-type:admin:view", - "device:view", - "notification:view", - "device:admin:view", - "application:manage", - "activity:view", - "user:admin:reset-password", - "policy:manage", - "policy:view", - "role:manage", - "role:view", - "configuration:view", - "configuration:modify", - "device:android:operation:reboot", - "device:android:operation:camera", - "device:android:operation:vpn", - "device:android:operation:lock", - "device:android:operation:ring", - "device:android:operation:update-app", - "device:android:operation:wipe", - "device:android:operation:encrypt", - "device:android:operation:blacklist-app", - "device:android:operation:applications", - "device:android:operation:enterprise-wipe", - "device:android:operation:info", - "device:android:operation:wifi", - "device:android:operation:uninstall-app", - "device:android:operation:change-lock", - "device:android:operation:notification", - "device:android:operation:upgrade", - "device:android:operation:unlock", - "device:android:operation:mute", - "device:android:operation:location", - "device:android:operation:webclip", - "device:android:operation:clear-password", - "device:android:operation:password-policy", - "device:android:operation:install-app", - "device:android:event:write", - "device:android:event:read", - "device:android:enroll", - "configuration:manage", - "configuration:view", - "device:android:enroll", - "certificate:view", - "certificate:manage" - ], - "isOAuthEnabled" : true, - "backendRestEndpoints" : { - "deviceMgt" : "/api/device-mgt/v1.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/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.js b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.js deleted file mode 100644 index f777ea9af..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.device.operation-bar/operation-bar.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -function onRequest(context) { - var log = new Log("mdm.unit.device.operation-bar"); - var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; - var viewModel = {}; - var permissions = {}; - - // adding android operations related permission checks - permissions["android"] = []; - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/ring")) { - permissions["android"].push("DEVICE_RING"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/lock")) { - permissions["android"].push("DEVICE_LOCK"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/unlock")) { - permissions["android"].push("DEVICE_UNLOCK"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/location")) { - permissions["android"].push("DEVICE_LOCATION"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/clear-password")) { - permissions["android"].push("CLEAR_PASSWORD"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/reboot")) { - permissions["android"].push("DEVICE_REBOOT"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/upgrade-firmware")) { - permissions["android"].push("UPGRADE_FIRMWARE"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/mute")) { - permissions["android"].push("DEVICE_MUTE"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/send-notification")) { - permissions["android"].push("NOTIFICATION"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/change-lock-code")) { - permissions["android"].push("CHANGE_LOCK_CODE"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/enterprise-wipe")) { - permissions["android"].push("ENTERPRISE_WIPE"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/android/wipe")) { - permissions["android"].push("WIPE_DATA"); - } - - // adding ios operations related permission checks - permissions["ios"] = []; - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/ios/lock")) { - permissions["ios"].push("DEVICE_LOCK"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/ios/location")) { - permissions["ios"].push("LOCATION"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/ios/enterprise-wipe")) { - permissions["ios"].push("ENTERPRISE_WIPE"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/ios/notification")) { - permissions["ios"].push("NOTIFICATION"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/ios/ring")) { - permissions["ios"].push("RING"); - } - - // adding windows operations related permission checks - permissions["windows"] = []; - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/windows/lock")) { - permissions["windows"].push("DEVICE_LOCK"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/disenroll/windows")) { - permissions["windows"].push("DISENROLL"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/windows/wipe")) { - permissions["windows"].push("WIPE_DATA"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/windows/ring")) { - permissions["windows"].push("DEVICE_RING"); - } - if (userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/operations/windows/lock-reset")) { - permissions["windows"].push("LOCK_RESET"); - } - - viewModel["permissions"] = stringify(permissions); - - viewModel["deviceType"] = context.unit.params.deviceType; - viewModel["ownership"] = context.unit.params.ownership; - - 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/devicemgt/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/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.hbs deleted file mode 100644 index 1965d4dce..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.hbs +++ /dev/null @@ -1,119 +0,0 @@ -{{! - Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - - WSO2 Inc. licenses this file to you under the Apache License, - Version 2.0 (the "License"); you may not use this file except - in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. -}} -{{#zone "navMenu-icon"}} - - - -{{/zone}} - -{{#zone "navMenu-items"}} - {{#if permissions.LIST_DEVICES}} -
  • - - - - Device Management - -
  • - {{/if}} - {{#if permissions.VIEW_DASHBOARD}} -
  • - - Device Statistics - -
  • - {{/if}} - {{#if permissions.LIST_POLICIES}} -
  • - Policy Management
  • - {{/if}} - {{#if permissions.USER_MGT_PERMITTED}} -
  • User Management - -
  • - {{/if}} - {{#if permissions.CONFIG_MGT_PERMITTED}} -
  • Configuration Management - -
  • - {{/if}} -{{/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/devicemgt/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/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.js deleted file mode 100644 index f5f450c35..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/devicemgt/app/units/mdm.unit.ui.navbar.nav-menu/nav-menu.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -function onRequest(context) { - 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"); - - 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 links = { - "user-mgt": [], - "role-mgt": [], - "policy-mgt": [], - "device-mgt": [] - }; - var viewModel = {}; - - // following viewModel.link value comes here based on the value passed at the point - // where units are attached to a page zone. - // eg: {{unit "app-bar" pageLink="users" title="User Management"}} - viewModel["currentActions"] = links[viewModel["pageLink"]]; - viewModel["enrollmentURL"] = mdmProps["generalConfig"]["host"] + mdmProps["enrollmentDir"]; - viewModel["currentUser"] = session.get(constants["USER_SESSION_KEY"]); - - var permissions = {}; - permissions["LIST_DEVICES"] = userModule.isAuthorized("/permission/admin/device-mgt/devices/owning-device/view"); - permissions["LIST_POLICIES"] = userModule.isAuthorized("/permission/admin/device-mgt/policies/view"); - permissions["LIST_USERS"] = userModule.isAuthorized("/permission/admin/device-mgt/users/view"); - permissions["LIST_ROLES"] = userModule.isAuthorized("/permission/admin/device-mgt/roles/view"); - permissions["USER_MGT_PERMITTED"] = (permissions["LIST_USERS"] || permissions["LIST_ROLES"]); - permissions["LIST_PLATFORM_CONFIGURATIONS"] = userModule.isAuthorized("/permission/admin/device-mgt/platform-configurations/view"); - permissions["LIST_CERTIFICATES"] = userModule.isAuthorized("/permission/admin/device-mgt/certificates/view"); - permissions["CONFIG_MGT_PERMITTED"] = (permissions["LIST_PLATFORM_CONFIGURATIONS"] || permissions["LIST_CERTIFICATES"]); - permissions["LIST_NOTIFICATIONS"] = userModule.isAuthorized("/permission/admin/device-mgt/notifications/view"); - permissions["VIEW_DASHBOARD"] = userModule.isAuthorized("/permission/admin/device-mgt/dashboard/view"); - - viewModel["permissions"] = permissions; - viewModel["appContext"] = mdmProps["appContext"]; - viewModel["serverURL"] = mdmProps["httpsWebURL"]; - - 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/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 deleted file mode 100644 index b5a58494c..000000000 Binary files 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 and /dev/null differ diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/jaggery.conf b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/jaggery.conf deleted file mode 100644 index 0c0285ee2..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.ui/src/main/resources/jaggeryapps/emm-web-agent/jaggery.conf +++ /dev/null @@ -1,148 +0,0 @@ -{ - "displayName": "EMM Web Agent", - "logLevel": "error", - "initScripts": ["/app/modules/init.js"], - "urlMappings": [ - { - "url": "/enrollment", - "path": "/lib/pages.jag" - }, - { - "url": "/enrollment/windows/login", - "path": "/app/modules/enrollments/windows/agent-controller.jag" - }, - { - "url": "/enrollment/windows/enroll", - "path": "/app/modules/enrollments/windows/agent-enroll.jag" - }, - { - "url": "/enrollment/ios/download-certificate", - "path": "/app/modules/enrollments/ios/certificate.jag" - }, - { - "url": "/enrollment/ios/download-agent", - "path": "/app/modules/enrollments/ios/agent.jag" - }, - { - "url": "/enrollment/ios/login", - "path": "/app/modules/enrollments/ios/agent-controller.jag" - }, - { - "url": "/enrollment/ios/enroll", - "path": "/app/modules/enrollments/ios/agent-enroll.jag" - }, - { - "url": "/enrollment/ios/check", - "path": "/app/modules/enrollments/ios/agent-check.jag" - }, - { - "url": "/api/invoker/*", - "path": "/api/invoker-api.jag" - }, - { - "url": "/uuf/login", - "path": "/lib/modules/auth/login.jag" - }, - { - "url": "/uuf/logout", - "path": "/lib/modules/auth/logout.jag" - }, - { - "url": "/uuf/sso/acs", - "path": "/lib/modules/auth/acs.jag" - }, - { - "url": "/public/*", - "path": "/lib/static-files.jag" - }, - { - "url": "/unit/*", - "path": "/lib/units.jag" - }, - { - "url": "/*", - "path": "/lib/pages.jag" - } - ], - "securityConstraints": [ - { - "securityConstraint": { - "webResourceCollection": { - "name": "EMM-WEB-AGENT", - "urlPatterns": [ - "/*" - ] - }, - "userDataConstraint": { - "transportGuarantee": "CONFIDENTIAL" - } - } - }, - { - "securityConstraint": { - "webResourceCollection": { - "name": "EMM-WEB-AGENT-http", - "urlPatterns": [ - "/public/*", - "/enrollments/windows/*", - "/enrollment/windows/*" - ] - }, - "userDataConstraint": { - "transportGuarantee": "NONE" - } - } - } - ], - "filters": [ - { - "name": "URLBasedCachePreventionFilter", - "class": "org.wso2.carbon.ui.filters.cache.URLBasedCachePreventionFilter" - }, - { - "name":"HttpHeaderSecurityFilter", - "class":"org.apache.catalina.filters.HttpHeaderSecurityFilter", - "params" : [{"name" : "hstsEnabled", "value" : "false"}] - } - ], - "filterMappings": [ - { - "name": "URLBasedCachePreventionFilter", - "url": "/api/*" - }, - { - "name": "URLBasedCachePreventionFilter", - "url": "/enrollment/*" - }, - { - "name":"HttpHeaderSecurityFilter", - "url":"*" - } - ], - "listeners" : [ - { - "class" : "org.owasp.csrfguard.CsrfGuardServletContextListener" - }, - { - "class" : "org.owasp.csrfguard.CsrfGuardHttpSessionListener" - } - ], - "servlets" : [ - { - "name" : "JavaScriptServlet", - "class" : "org.owasp.csrfguard.servlet.JavaScriptServlet" - } - ], - "servletMappings" : [ - { - "name" : "JavaScriptServlet", - "url" : "/csrf.js" - } - ], - "contextParams" : [ - { - "name" : "Owasp.CsrfGuard.Config", - "value" : "/repository/conf/security/Owasp.CsrfGuard.dashboard.properties" - } - ] -} diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.url.printer/pom.xml b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.url.printer/pom.xml deleted file mode 100644 index 00126db35..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile.url.printer/pom.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - mobile-base-plugin - org.wso2.carbon.devicemgt-plugins - 2.2.8-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.device.mgt.mobile.url.printer - bundle - WSO2 Carbon - Startup Handler That Prints MDM End-User Web-App URL - WSO2 Carbon - Startup Handler That Prints MDM End-User Web-App URL - http://wso2.org - - - - - org.apache.felix - maven-scr-plugin - - - org.apache.felix - maven-bundle-plugin - 1.4.0 - true - - - ${project.artifactId} - ${project.artifactId} - ${carbon.devicemgt.plugins.version} - Bundle Containing The Startup Handler That Prints MDM End-User Web-App URL - org.wso2.carbon.device.mgt.mobile.url.printer.internal - - org.osgi.framework, - org.osgi.service.component, - org.apache.commons.logging, - org.apache.axis2.*;version="${axis2.osgi.version.range}", - org.wso2.carbon.core, - org.wso2.carbon.utils.*, - - - !org.wso2.carbon.device.mgt.mobile.url.printer.internal, - org.wso2.carbon.device.mgt.mobile.url.printer, - - - - - - - - - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - - - org.wso2.carbon - org.wso2.carbon.core - - - org.wso2.carbon - org.wso2.carbon.logging - - - org.wso2.carbon - org.wso2.carbon.utils - - - org.apache.axis2.wso2 - axis2 - - - - \ No newline at end of file diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/pom.xml b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/pom.xml deleted file mode 100644 index 19ee23a96..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/pom.xml +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - mobile-base-plugin - org.wso2.carbon.devicemgt-plugins - 2.2.8-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.device.mgt.mobile - bundle - WSO2 Carbon - Mobile Device Management Impl - WSO2 Carbon - Mobile Device Management Implementation - http://wso2.org - - - - - org.apache.felix - maven-scr-plugin - - - org.apache.felix - maven-bundle-plugin - 1.4.0 - true - - - ${project.artifactId} - ${project.artifactId} - ${carbon.devicemgt.plugins.version} - Device Management Mobile Impl Bundle - org.wso2.carbon.device.mgt.mobile.internal - - org.osgi.framework, - org.osgi.service.component, - org.apache.commons.logging, - javax.xml.*; !javax.xml.parsers, - javax.xml.parsers; version="${javax.xml.parsers.import.pkg.version}", - javax.naming, - javax.sql, - org.w3c.dom, - org.wso2.carbon.context, - org.wso2.carbon.utils.*, - org.wso2.carbon.device.mgt.common.*, - org.wso2.carbon.ndatasource.core, - org.wso2.carbon.policy.mgt.common.*, - org.wso2.carbon.registry.core, - org.wso2.carbon.registry.core.service, - org.wso2.carbon.registry.core.session, - org.wso2.carbon.registry.api, - org.wso2.carbon.device.mgt.extensions.license.mgt.registry, - com.google.gson.* - - - !org.wso2.carbon.device.mgt.mobile.internal, - !org.wso2.carbon.device.mgt.mobile.impl, - org.wso2.carbon.device.mgt.mobile.*, - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.18 - - - file:src/test/resources/log4j.properties - - - - src/test/resources/testng.xml - - - - - - - - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - - - org.wso2.carbon - org.wso2.carbon.core - - - org.wso2.carbon - org.wso2.carbon.logging - - - org.wso2.carbon - org.wso2.carbon.utils - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.common - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.extensions - - - org.wso2.carbon - org.wso2.carbon.ndatasource.core - - - org.wso2.carbon.devicemgt - org.wso2.carbon.policy.mgt.common - - - org.wso2.carbon.devicemgt - org.wso2.carbon.policy.mgt.core - - - org.wso2.carbon - org.wso2.carbon.registry.api - - - org.wso2.carbon - org.wso2.carbon.registry.core - - - org.testng - testng - - - org.apache.tomcat.wso2 - jdbc-pool - - - com.h2database.wso2 - h2-database-engine - test - - - com.google.code.gson - gson - - - com.google.android.gcm - gcm-server - - - diff --git a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java b/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java deleted file mode 100644 index e9fb47ccd..000000000 --- a/components/mobile-plugins/mobile-base-plugin/org.wso2.carbon.device.mgt.mobile/src/main/java/org/wso2/carbon/device/mgt/mobile/util/MobileDeviceManagementUtil.java +++ /dev/null @@ -1,332 +0,0 @@ -/* - * 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. - */ - -package org.wso2.carbon.device.mgt.mobile.util; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Document; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.mgt.common.Device; -import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; -import org.wso2.carbon.device.mgt.common.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.Feature; -import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; -import org.wso2.carbon.device.mgt.mobile.common.MobileDeviceMgtPluginException; -import org.wso2.carbon.device.mgt.mobile.common.MobilePluginConstants; -import org.wso2.carbon.device.mgt.mobile.dto.*; -import org.wso2.carbon.device.mgt.mobile.internal.MobileDeviceManagementDataHolder; -import org.wso2.carbon.registry.api.RegistryException; -import org.wso2.carbon.registry.api.Resource; -import org.wso2.carbon.registry.core.Registry; - -import javax.xml.XMLConstants; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import java.io.File; -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -/** - * Provides utility methods required by the mobile device management bundle. - */ -public class MobileDeviceManagementUtil { - - private static final Log log = LogFactory.getLog(MobileDeviceManagementUtil.class); - private static final String MOBILE_DEVICE_IMEI = "IMEI"; - private static final String MOBILE_DEVICE_IMSI = "IMSI"; - private static final String MOBILE_DEVICE_VENDOR = "VENDOR"; - private static final String MOBILE_DEVICE_OS_VERSION = "OS_VERSION"; - private static final String MOBILE_DEVICE_MODEL = "DEVICE_MODEL"; - private static final String MOBILE_DEVICE_LATITUDE = "LATITUDE"; - private static final String MOBILE_DEVICE_LONGITUDE = "LONGITUDE"; - private static final String MOBILE_DEVICE_SERIAL = "SERIAL"; - private static final String MOBILE_DEVICE_OS_BUILD_DATE = "OS_BUILD_DATE"; - - public static Document convertToDocument(File file) throws DeviceManagementException { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - try { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); - DocumentBuilder docBuilder = dbf.newDocumentBuilder(); - return docBuilder.parse(file); - } catch (Exception e) { - throw new DeviceManagementException( - "Error occurred while parsing file, while converting " + - "to a org.w3c.dom.Document : " + e.getMessage(), e); - } - } - - private static String getPropertyValue(Device device, String property) { - if (device != null && device.getProperties() != null) { - for (Device.Property prop : device.getProperties()) { - if (property.equals(prop.getName())) { - return prop.getValue(); - } - } - } - return null; - } - - private static Device.Property getProperty(String property, String value) { - if (property != null) { - Device.Property prop = new Device.Property(); - prop.setName(property); - prop.setValue(value); - return prop; - } - return null; - } - - public static MobileDevice convertToMobileDevice(Device device) { - MobileDevice mobileDevice = null; - if (device != null) { - mobileDevice = new MobileDevice(); - mobileDevice.setMobileDeviceId(device.getDeviceIdentifier()); - mobileDevice.setImei(getPropertyValue(device, MOBILE_DEVICE_IMEI)); - mobileDevice.setImsi(getPropertyValue(device, MOBILE_DEVICE_IMSI)); - mobileDevice.setModel(getPropertyValue(device, MOBILE_DEVICE_MODEL)); - mobileDevice.setOsVersion(getPropertyValue(device, MOBILE_DEVICE_OS_VERSION)); - mobileDevice.setVendor(getPropertyValue(device, MOBILE_DEVICE_VENDOR)); - mobileDevice.setLatitude(getPropertyValue(device, MOBILE_DEVICE_LATITUDE)); - mobileDevice.setLongitude(getPropertyValue(device, MOBILE_DEVICE_LONGITUDE)); - mobileDevice.setSerial(getPropertyValue(device, MOBILE_DEVICE_SERIAL)); - mobileDevice.setOsBuildDate(getPropertyValue(device, MOBILE_DEVICE_OS_BUILD_DATE)); - - if (device.getProperties() != null) { - Map deviceProperties = new HashMap(); - for (Device.Property deviceProperty : device.getProperties()) { - deviceProperties.put(deviceProperty.getName(), deviceProperty.getValue()); - } - - mobileDevice.setDeviceProperties(deviceProperties); - } else { - mobileDevice.setDeviceProperties(new HashMap()); - } - } - return mobileDevice; - } - - public static Device convertToDevice(MobileDevice mobileDevice) { - Device device = null; - if (mobileDevice != null) { - device = new Device(); - List propertyList = new ArrayList(); - propertyList.add(getProperty(MOBILE_DEVICE_IMEI, mobileDevice.getImei())); - propertyList.add(getProperty(MOBILE_DEVICE_IMSI, mobileDevice.getImsi())); - propertyList.add(getProperty(MOBILE_DEVICE_MODEL, mobileDevice.getModel())); - propertyList.add(getProperty(MOBILE_DEVICE_OS_VERSION, mobileDevice.getOsVersion())); - propertyList.add(getProperty(MOBILE_DEVICE_OS_BUILD_DATE, mobileDevice.getOsBuildDate())); - propertyList.add(getProperty(MOBILE_DEVICE_VENDOR, mobileDevice.getVendor())); - if(mobileDevice.getLatitude() != null) { - propertyList.add(getProperty(MOBILE_DEVICE_LATITUDE, mobileDevice.getLatitude())); - } - if(mobileDevice.getLongitude() != null) { - propertyList.add(getProperty(MOBILE_DEVICE_LONGITUDE, mobileDevice.getLongitude())); - } - propertyList.add(getProperty(MOBILE_DEVICE_SERIAL, mobileDevice.getSerial())); - - if (mobileDevice.getDeviceProperties() != null) { - for (Map.Entry deviceProperty : mobileDevice.getDeviceProperties() - .entrySet()) { - propertyList - .add(getProperty(deviceProperty.getKey(), deviceProperty.getValue())); - } - } - - device.setProperties(propertyList); - device.setDeviceIdentifier(mobileDevice.getMobileDeviceId()); - } - return device; - } - - public static MobileOperation convertToMobileOperation(Operation operation) { - MobileOperation mobileOperation = new MobileOperation(); - MobileOperationProperty operationProperty; - List properties = new LinkedList(); - mobileOperation.setFeatureCode(operation.getCode()); - mobileOperation.setCreatedDate(new Date().getTime()); - Properties operationProperties = operation.getProperties(); - for (String key : operationProperties.stringPropertyNames()) { - operationProperty = new MobileOperationProperty(); - operationProperty.setProperty(key); - operationProperty.setValue(operationProperties.getProperty(key)); - properties.add(operationProperty); - } - mobileOperation.setProperties(properties); - return mobileOperation; - } - - public static List getMobileOperationIdsFromMobileDeviceOperations( - List mobileDeviceOperationMappings) { - List mobileOperationIds = new ArrayList(mobileDeviceOperationMappings.size()); - for (MobileDeviceOperationMapping mobileDeviceOperationMapping : mobileDeviceOperationMappings) { - mobileOperationIds.add(mobileDeviceOperationMapping.getOperationId()); - } - return mobileOperationIds; - } - - public static Operation convertMobileOperationToOperation(MobileOperation mobileOperation) { - Operation operation = new Operation(); - Properties properties = new Properties(); - operation.setCode(mobileOperation.getFeatureCode()); - for (MobileOperationProperty mobileOperationProperty : mobileOperation.getProperties()) { - properties - .put(mobileOperationProperty.getProperty(), mobileOperationProperty.getValue()); - } - operation.setProperties(properties); - return operation; - } - - public static MobileFeature convertToMobileFeature(Feature feature) { - MobileFeature mobileFeature = new MobileFeature(); - mobileFeature.setName(feature.getName()); - mobileFeature.setCode(feature.getCode()); - mobileFeature.setDescription(feature.getDescription()); - mobileFeature.setDeviceType(feature.getDeviceType()); - return mobileFeature; - } - - public static Feature convertToFeature(MobileFeature mobileFeature) { - Feature feature = new Feature(); - feature.setDescription(mobileFeature.getDescription()); - feature.setDeviceType(mobileFeature.getDeviceType()); - feature.setCode(mobileFeature.getCode()); - feature.setName(mobileFeature.getName()); - return feature; - } - - public static Registry getConfigurationRegistry() throws MobileDeviceMgtPluginException { - try { - int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); - return MobileDeviceManagementDataHolder.getInstance().getRegistryService() - .getConfigSystemRegistry( - tenantId); - } catch (RegistryException e) { - throw new MobileDeviceMgtPluginException( - "Error in retrieving conf registry instance: " + - e.getMessage(), e); - } - } - - public static Resource getRegistryResource(String path) throws MobileDeviceMgtPluginException { - try { - if(MobileDeviceManagementUtil.getConfigurationRegistry().resourceExists(path)){ - return MobileDeviceManagementUtil.getConfigurationRegistry().get(path); - } - return null; - } catch (RegistryException e) { - throw new MobileDeviceMgtPluginException("Error in retrieving registry resource : " + - e.getMessage(), e); - } - } - - public static boolean putRegistryResource(String path, - Resource resource) - throws MobileDeviceMgtPluginException { - boolean status; - try { - MobileDeviceManagementUtil.getConfigurationRegistry().beginTransaction(); - MobileDeviceManagementUtil.getConfigurationRegistry().put(path, resource); - MobileDeviceManagementUtil.getConfigurationRegistry().commitTransaction(); - status = true; - } catch (RegistryException e) { - throw new MobileDeviceMgtPluginException( - "Error occurred while persisting registry resource : " + - e.getMessage(), e); - } - return status; - } - - public static String getResourcePath(String resourceName, String platform) { - String regPath = ""; - switch (platform) { - case DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID: - regPath = MobilePluginConstants.MOBILE_CONFIG_REGISTRY_ROOT + "/" + - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID + - "/" + resourceName; - break; - case DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS: - regPath = MobilePluginConstants.MOBILE_CONFIG_REGISTRY_ROOT + "/" + - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS + - "/" + resourceName; - break; - case DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_IOS: - regPath = MobilePluginConstants.MOBILE_CONFIG_REGISTRY_ROOT + "/" + - DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_IOS + - "/" + resourceName; - break; - } - return regPath; - } - - public static String getPlatformConfigPath(String platform) { - String regPath = ""; - switch (platform) { - case DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID: - regPath = DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID; - break; - case DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS: - regPath = DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_WINDOWS; - break; - case DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_IOS: - regPath = DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_IOS; - break; - } - return regPath; - } - - public static boolean createRegistryCollection(String path) - throws MobileDeviceMgtPluginException { - try { - if (! MobileDeviceManagementUtil.getConfigurationRegistry().resourceExists(path)) { - Resource resource = MobileDeviceManagementUtil.getConfigurationRegistry().newCollection(); - MobileDeviceManagementUtil.getConfigurationRegistry().beginTransaction(); - MobileDeviceManagementUtil.getConfigurationRegistry().put(path, resource); - MobileDeviceManagementUtil.getConfigurationRegistry().commitTransaction(); - } - return true; - } catch (MobileDeviceMgtPluginException e) { - throw new MobileDeviceMgtPluginException( - "Error occurred while creating a registry collection : " + - e.getMessage(), e); - } catch (RegistryException e) { - throw new MobileDeviceMgtPluginException( - "Error occurred while creating a registry collection : " + - e.getMessage(), e); - } - } - - public static List getMissingFeatures(List supportedFeatures, List existingFeatures) { - HashMap featureHashMap = new HashMap(); - for (Feature feature: existingFeatures) { - featureHashMap.put(feature.getCode(),feature); - } - List missingFeatures = new ArrayList(); - for (Feature supportedFeature : supportedFeatures) { - if (featureHashMap.get(supportedFeature.getCode()) != null) { - continue; - } - missingFeatures.add(supportedFeature); - } - return missingFeatures; - } -} diff --git a/components/mobile-plugins/mobile-base-plugin/pom.xml b/components/mobile-plugins/mobile-base-plugin/pom.xml deleted file mode 100644 index 16cb41331..000000000 --- a/components/mobile-plugins/mobile-base-plugin/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - org.wso2.carbon.devicemgt-plugins - mobile-plugins - 2.2.8-SNAPSHOT - ../pom.xml - - - 4.0.0 - mobile-base-plugin - pom - WSO2 Carbon - Mobile Plugins - http://wso2.org - - - org.wso2.carbon.device.mgt.mobile - org.wso2.carbon.device.mgt.mobile.ui - org.wso2.carbon.device.mgt.mobile.url.printer - - - - - - - org.apache.felix - maven-scr-plugin - 1.7.2 - - - generate-scr-scrdescriptor - - scr - - - - - - - - -