Package net.sf.json

Examples of net.sf.json.JSONObject.element()


                        jparameter.element("keyName", template.getRole().getName() + " - " + parameter.getName());
                    } else {
                        jparameter.element("keyName", parameter.getName());
                    }
                    String value = template.formatValue(parameter);
                    jparameter.element("value", value);
                    jparameter.element("editor", "v2js_" + template.getEditorTemplate());
                }
            }
        }
View Full Code Here


                    } else {
                        jparameter.element("keyName", parameter.getName());
                    }
                    String value = template.formatValue(parameter);
                    jparameter.element("value", value);
                    jparameter.element("editor", "v2js_" + template.getEditorTemplate());
                }
            }
        }

        return jparameters;
View Full Code Here

    }

    public static JSONObject createRole(Role role, ModuleManager moduleController) {

        JSONObject jrole = new JSONObject();
        jrole.element("name", role.getName());

        if (role.getUserGroup() != null) {
            jrole.element("userGroupKey", role.getUserGroup().getGroupKey());
        } else {
            jrole.element("userGroupKey", "");
View Full Code Here

        JSONObject jrole = new JSONObject();
        jrole.element("name", role.getName());

        if (role.getUserGroup() != null) {
            jrole.element("userGroupKey", role.getUserGroup().getGroupKey());
        } else {
            jrole.element("userGroupKey", "");
        }

        if (moduleController != null) {
View Full Code Here

        jrole.element("name", role.getName());

        if (role.getUserGroup() != null) {
            jrole.element("userGroupKey", role.getUserGroup().getGroupKey());
        } else {
            jrole.element("userGroupKey", "");
        }

        if (moduleController != null) {
            jrole.element("modules", createPermissions(role.getPermissions(), moduleController));
        }
View Full Code Here

        } else {
            jrole.element("userGroupKey", "");
        }

        if (moduleController != null) {
            jrole.element("modules", createPermissions(role.getPermissions(), moduleController));
        }
        return jrole;
    }

    public static JSONArray createPermissions(Collection<Permission> permissions, ModuleManager moduleController) {
View Full Code Here

        JSONArray jmodules = new JSONArray();
        for (String module : pMap.keySet()) {
            JSONObject jModule = new JSONObject();
            jmodules.element(jModule);
            jModule.element("name", module);
            JSONArray jpermissions = new JSONArray();
            jModule.element("permissions", jpermissions);
            Collections.sort(pMap.get(module));
            for (Permission permission : pMap.get(module)) {
                JSONObject jpermission = new JSONObject();
View Full Code Here

        for (String module : pMap.keySet()) {
            JSONObject jModule = new JSONObject();
            jmodules.element(jModule);
            jModule.element("name", module);
            JSONArray jpermissions = new JSONArray();
            jModule.element("permissions", jpermissions);
            Collections.sort(pMap.get(module));
            for (Permission permission : pMap.get(module)) {
                JSONObject jpermission = new JSONObject();
                jpermissions.element(jpermission);
                jpermission.element("key", permission.getKey());
View Full Code Here

            jModule.element("permissions", jpermissions);
            Collections.sort(pMap.get(module));
            for (Permission permission : pMap.get(module)) {
                JSONObject jpermission = new JSONObject();
                jpermissions.element(jpermission);
                jpermission.element("key", permission.getKey());
                jpermission.element("value", permission.getValue());
                jpermission.element("isValuePermission", permission.isValuePermission());
                if (moduleController != null) {
                    PermissionTemplate permissionTemplate = moduleController.getPermissionTemplate(permission.getKey());
                    if (permissionTemplate != null) {
View Full Code Here

            Collections.sort(pMap.get(module));
            for (Permission permission : pMap.get(module)) {
                JSONObject jpermission = new JSONObject();
                jpermissions.element(jpermission);
                jpermission.element("key", permission.getKey());
                jpermission.element("value", permission.getValue());
                jpermission.element("isValuePermission", permission.isValuePermission());
                if (moduleController != null) {
                    PermissionTemplate permissionTemplate = moduleController.getPermissionTemplate(permission.getKey());
                    if (permissionTemplate != null) {
                        jpermission.element("editor", "v2js_" + permissionTemplate.getEditorTemplate());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.