Updating base ui app config reader

revert-70aa11f8
dilanua 8 years ago
parent d04cb54ae8
commit 00f98f5cce

@ -22,7 +22,7 @@ var log = new Log("api/data-tables-invoker-api.jag");
var uri = request.getRequestURI();
var uriMatcher = new URIMatcher(String(uri));
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var serviceInvokers = require("/app/modules/backend-service-invoker.js")["backendServiceInvoker"];
function appendQueryParam (url, queryParam , value) {

@ -24,7 +24,7 @@ var log = new Log("api/device-api.jag");
var constants = require("/app/modules/constants.js");
var deviceModule = require("/app/modules/device.js").deviceModule;
var utility = require("/app/modules/utility.js").utility;
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var userModule = require("/app/modules/user.js").userModule;
var serviceInvokers = require("/app/modules/backend-service-invoker.js").backendServiceInvoker;

@ -23,7 +23,7 @@ var uriMatcher = new URIMatcher(String(uri));
var log = new Log("api/device-api.jag");
var constants = require("/app/modules/constants.js");
var utility = require("/app/modules/utility.js").utility;
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var serviceInvokers = require("/app/modules/backend-service-invoker.js").backendServiceInvoker;
var user = session.get(constants.USER_SESSION_KEY);

@ -23,7 +23,7 @@ var uri = request.getRequestURI();
var uriMatcher = new URIMatcher(String(uri));
var constants = require("/app/modules/constants.js");
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var serviceInvokers = require("/app/modules/backend-service-invoker.js")["backendServiceInvoker"];
if (uriMatcher.match("/{context}/api/invoker/execute/")) {

@ -23,7 +23,7 @@ var uriMatcher = new URIMatcher(String(uri));
var log = new Log("api/operation-api.jag");
var serviceInvokers = require("/app/modules/backend-service-invoker.js")["backendServiceInvoker"];
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
if (uriMatcher.match("/{context}/api/operation/paginate")) {
var deviceType = request.getParameter("deviceType");

@ -23,7 +23,7 @@ var uriMatcher = new URIMatcher(String(uri));
var log = new Log("api/user-api.jag");
var constants = require("/app/modules/constants.js");
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var userModule = require("/app/modules/user.js").userModule;
var deviceModule = require("/app/modules/device.js").deviceModule;
var utility = require("/app/modules/utility.js").utility;

@ -16,7 +16,7 @@
* under the License.
*/
var config = function () {
var conf = function () {
var conf = application.get("UI_CONF");
if (!conf) {
conf = require("/app/conf/config.json");
@ -38,4 +38,4 @@ var config = function () {
application.put("UI_CONF", conf);
}
return conf;
};
}();

@ -20,7 +20,7 @@ var apiWrapperUtil = function () {
var module = {};
var tokenUtil = require("/app/modules/util.js").util;
var constants = require("/app/modules/constants.js");
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var log = new Log("/app/modules/api-wrapper-util.js");
module.refreshToken = function () {

@ -31,7 +31,7 @@ var backendServiceInvoker = function () {
var TOKEN_EXPIRED = "Access token expired";
var TOKEN_INVALID = "Invalid input. Access token validation failed";
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var constants = require("/app/modules/constants.js");
var userModule = require("/app/modules/user.js")["userModule"];
var tokenUtil = require("/app/modules/api-wrapper-util.js")["apiWrapperUtil"];

@ -22,7 +22,7 @@ deviceModule = function () {
var utility = require('/app/modules/utility.js').utility;
var constants = require('/app/modules/constants.js');
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var serviceInvokers = require("/app/modules/backend-service-invoker.js").backendServiceInvoker;
var ArrayList = Packages.java.util.ArrayList;

@ -22,7 +22,7 @@ var groupModule = {};
var userModule = require("/app/modules/user.js").userModule;
var constants = require('/app/modules/constants.js');
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var utility = require("/app/modules/utility.js").utility;
var serviceInvokers = require("/app/modules/backend-service-invoker.js").backendServiceInvoker;

@ -17,7 +17,7 @@
*/
var carbonModule = require("carbon");
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var carbonServer = new carbonModule.server.Server({
tenanted: true,
url: devicemgtProps["httpsURL"] + "/admin"

@ -33,7 +33,7 @@ var onFail;
properties = {username: context.input.username, password: context.input.password};
apiWrapperUtil.setupAccessTokenPair(constants.GRANT_TYPE_PASSWORD, properties);
}
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var carbonServer = require("carbon").server;
(new carbonServer.Server({url: devicemgtProps["adminService"]}))
.login(context.input.username, context.input.password);

@ -20,7 +20,7 @@ var operationModule = function () {
var log = new Log("/app/modules/operation.js");
var utility = require('/app/modules/utility.js').utility;
var constants = require('/app/modules/constants.js');
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var serviceInvokers = require("/app/modules/backend-service-invoker.js").backendServiceInvoker;
var publicMethods = {};

@ -25,7 +25,7 @@ policyModule = function () {
var constants = require('/app/modules/constants.js');
var utility = require("/app/modules/utility.js")["utility"];
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var serviceInvokers = require("/app/modules/backend-service-invoker.js").backendServiceInvoker;
var publicMethods = {};

@ -24,7 +24,7 @@ var userModule = function () {
var constants = require("/app/modules/constants.js");
var utility = require("/app/modules/utility.js")["utility"];
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var serviceInvokers = require("/app/modules/backend-service-invoker.js")["backendServiceInvoker"];
/* Initializing user manager */

@ -21,7 +21,7 @@ var util = function () {
var module = {};
var Base64 = Packages.org.apache.commons.codec.binary.Base64;
var String = Packages.java.lang.String;
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var carbon = require('carbon');
var constants = require("/app/modules/constants.js");
var adminUser = devicemgtProps["adminUser"];

@ -20,7 +20,7 @@ var utility;
utility = function () {
var constants = require('/app/modules/constants.js');
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var log = new Log("/app/modules/utility.js");
var JavaClass = Packages.java.lang.Class;
var PrivilegedCarbonContext = Packages.org.wso2.carbon.context.PrivilegedCarbonContext;

@ -21,7 +21,7 @@ function onRequest(context) {
var user = session.get(constants.USER_SESSION_KEY);
var userModule = require("/app/modules/user.js").userModule;
var permissions = userModule.getUIPermissions();
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
if (!permissions.VIEW_DASHBOARD) {
response.sendRedirect(constants.WEB_APP_CONTEXT + "/devices");

@ -23,7 +23,7 @@
* @returns {*} A context object that returns the dynamic state of this page to be presented
*/
function onRequest(context) {
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var page = {};
page["groupNameJSRegEx"] = devicemgtProps.groupValidationConfig.groupNameJSRegEx;
page["groupNameRegExViolationErrorMsg"] = devicemgtProps.groupValidationConfig.groupNameRegExViolationErrorMsg;

@ -26,7 +26,7 @@ function onRequest(context) {
//var log = new Log("/app/pages/cdmf.page.user.create server-side js");
var userModule = require("/app/modules/user.js")["userModule"];
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
var page = {};
var response = userModule.getRolesByUserStore();

@ -20,7 +20,7 @@ function onRequest(context) {
var userModule = require("/app/modules/user.js").userModule;
var userName = request.getParameter("username");
var user = userModule.getUser(userName)["content"];
var devicemgtProps = require("/app/conf/reader/main.js").config();
var devicemgtProps = require("/app/conf/reader/main.js")["conf"];
if (user) {
var title;
if (user.firstname || user.lastname) {

@ -29,7 +29,7 @@ function onRequest(context) {
var page = {};
var userModule = require("/app/modules/user.js")["userModule"];
require("/app/conf/reader/main.js").config();
var deviceMgtProps = require("/app/conf/reader/main.js")["conf"];
page["adminUser"] = deviceMgtProps["adminUser"];
page["permissions"] = userModule.getUIPermissions();

@ -30,9 +30,9 @@ function onRequest (context) {
var userModule = require("/app/modules/user.js").userModule;
var constants = require("/app/modules/constants.js");
var permissions = userModule.getUIPermissions();
var mdmProps = require("/app/conf/reader/main.js").config();
var deviceMgtProps = require("/app/conf/reader/main.js")["conf"];
context.permissions = permissions;
context["enrollmentURL"] = mdmProps.enrollmentURL;
context["enrollmentURL"] = deviceMgtProps.enrollmentURL;
return configs;
}

@ -24,7 +24,7 @@
*/
function onRequest(context) {
var userModule = require("/app/modules/user.js")["userModule"];
var deviceMgtProps = require("/app/conf/reader/main.js").config();
var deviceMgtProps = require("/app/conf/reader/main.js")["conf"];
var response = userModule.getRoles();
if (response["status"] == "success") {
context["roles"] = response["content"];

@ -24,7 +24,7 @@
*/
function onRequest(context) {
var userModule = require("/app/modules/user.js")["userModule"];
var deviceMgtProps = require("/app/conf/reader/main.js").config();
var deviceMgtProps = require("/app/conf/reader/main.js")["conf"];
var uri = request.getRequestURI();
var uriMatcher = new URIMatcher(String(uri));
var isMatched = uriMatcher.match("/{context}/role/edit/{rolename}");

@ -30,7 +30,7 @@ function onRequest(context) {
if (userModule.isAuthorized("/permission/admin/device-mgt/roles/remove")) {
context["removePermitted"] = true;
}
var deviceMgtProps = require("/app/conf/reader/main.js").config();
var deviceMgtProps = require("/app/conf/reader/main.js")["conf"];
context["appContext"] = deviceMgtProps.appContext;
context["adminRole"] = deviceMgtProps.adminRole;
return context;

Loading…
Cancel
Save