Package net.sf.json

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


            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());
                        if (!permissionTemplate.getValues().isEmpty()) {
View Full Code Here


                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());
                        if (!permissionTemplate.getValues().isEmpty()) {
                            JSONArray jvalues = new JSONArray();
                            jpermission.element("values", jvalues);
                            for (KeyValue value : permissionTemplate.getValues()) {
                                JSONObject jvalue = new JSONObject();
View Full Code Here

                    PermissionTemplate permissionTemplate = moduleController.getPermissionTemplate(permission.getKey());
                    if (permissionTemplate != null) {
                        jpermission.element("editor", "v2js_" + permissionTemplate.getEditorTemplate());
                        if (!permissionTemplate.getValues().isEmpty()) {
                            JSONArray jvalues = new JSONArray();
                            jpermission.element("values", jvalues);
                            for (KeyValue value : permissionTemplate.getValues()) {
                                JSONObject jvalue = new JSONObject();
                                jvalues.element(jvalue);
                                jvalue.element("key", value.getKey());
                                jvalue.element("text", value.getValue());
View Full Code Here

                            JSONArray jvalues = new JSONArray();
                            jpermission.element("values", jvalues);
                            for (KeyValue value : permissionTemplate.getValues()) {
                                JSONObject jvalue = new JSONObject();
                                jvalues.element(jvalue);
                                jvalue.element("key", value.getKey());
                                jvalue.element("text", value.getValue());
                            }
                        }
                    }
                }
View Full Code Here

                            jpermission.element("values", jvalues);
                            for (KeyValue value : permissionTemplate.getValues()) {
                                JSONObject jvalue = new JSONObject();
                                jvalues.element(jvalue);
                                jvalue.element("key", value.getKey());
                                jvalue.element("text", value.getValue());
                            }
                        }
                    }
                }
            }
View Full Code Here

    JSONArray jmodules = new JSONArray();
    view.getJson().element("modules", jmodules);
    for (Module module : moduleController.getModules()) {
        JSONObject jmodule = new JSONObject();
        jmodules.element(jmodule);
        jmodule.element("name", module.getName());       
        JSONArray jpermissions = new JSONArray();       
        jmodule.element("permissions", jpermissions);
        for(PermissionTemplate permissionTemplate : module.getPermissionTemplates()) {
            jpermissions.element(permissionTemplate.getKey());
        }
View Full Code Here

    for (Module module : moduleController.getModules()) {
        JSONObject jmodule = new JSONObject();
        jmodules.element(jmodule);
        jmodule.element("name", module.getName());       
        JSONArray jpermissions = new JSONArray();       
        jmodule.element("permissions", jpermissions);
        for(PermissionTemplate permissionTemplate : module.getPermissionTemplates()) {
            jpermissions.element(permissionTemplate.getKey());
        }
    }
    return new ModelAndView(view, null);
View Full Code Here

                    return "v2js_widgets_username";
                }

                public Object getData(Object obj) {
                    JSONObject jLink = new JSONObject();
                    jLink.element("username", ((ZeroUser) obj).getUsername());
                    jLink.element("deleted", ((ZeroUser) obj).isDeleted());
                    return jLink;

                }
            });
View Full Code Here

                }

                public Object getData(Object obj) {
                    JSONObject jLink = new JSONObject();
                    jLink.element("username", ((ZeroUser) obj).getUsername());
                    jLink.element("deleted", ((ZeroUser) obj).isDeleted());
                    return jLink;

                }
            });
View Full Code Here

                    }

                    public Object getData(Object obj) {
                        if (obj instanceof User) {
                            JSONObject jLink = new JSONObject();
                            jLink.element("url", "user/userEdit.do?selected=" + ((ZeroUser) obj).getId());
                            jLink.element("text", "Edit");
                            return jLink;
                        }
                        return "";
                    }
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.