Package net.sf.json

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


        JSONObject juser = new JSONObject();
        log.debug(user.getUsername());
       
        DateFormat df = new SimpleDateFormat(ZeroContextHolder.getContext().getConfig().getDateFormat());
       
        juser.element("username", user.getUsername());
        //juser.element("language", user.getLanguage());
        juser.element("password", user.getPassword());
        JSONObject jperson = new JSONObject();
        juser.element("person", jperson);
        jperson.element("firstname", user.getPerson().getFirstname());
View Full Code Here


       
        DateFormat df = new SimpleDateFormat(ZeroContextHolder.getContext().getConfig().getDateFormat());
       
        juser.element("username", user.getUsername());
        //juser.element("language", user.getLanguage());
        juser.element("password", user.getPassword());
        JSONObject jperson = new JSONObject();
        juser.element("person", jperson);
        jperson.element("firstname", user.getPerson().getFirstname());
        jperson.element("lastname", user.getPerson().getLastname());
        jperson.element("phone", user.getPerson().getPhone());
View Full Code Here

        juser.element("username", user.getUsername());
        //juser.element("language", user.getLanguage());
        juser.element("password", user.getPassword());
        JSONObject jperson = new JSONObject();
        juser.element("person", jperson);
        jperson.element("firstname", user.getPerson().getFirstname());
        jperson.element("lastname", user.getPerson().getLastname());
        jperson.element("phone", user.getPerson().getPhone());
        jperson.element("email", user.getPerson().getEmail());
        if (user.getUserGroup() != null) {
            juser.element("userGroupKey", user.getUserGroup().getGroupKey());
View Full Code Here

        //juser.element("language", user.getLanguage());
        juser.element("password", user.getPassword());
        JSONObject jperson = new JSONObject();
        juser.element("person", jperson);
        jperson.element("firstname", user.getPerson().getFirstname());
        jperson.element("lastname", user.getPerson().getLastname());
        jperson.element("phone", user.getPerson().getPhone());
        jperson.element("email", user.getPerson().getEmail());
        if (user.getUserGroup() != null) {
            juser.element("userGroupKey", user.getUserGroup().getGroupKey());
        } else {
View Full Code Here

        juser.element("password", user.getPassword());
        JSONObject jperson = new JSONObject();
        juser.element("person", jperson);
        jperson.element("firstname", user.getPerson().getFirstname());
        jperson.element("lastname", user.getPerson().getLastname());
        jperson.element("phone", user.getPerson().getPhone());
        jperson.element("email", user.getPerson().getEmail());
        if (user.getUserGroup() != null) {
            juser.element("userGroupKey", user.getUserGroup().getGroupKey());
        } else {
            juser.element("userGroupKey", "");
View Full Code Here

        JSONObject jperson = new JSONObject();
        juser.element("person", jperson);
        jperson.element("firstname", user.getPerson().getFirstname());
        jperson.element("lastname", user.getPerson().getLastname());
        jperson.element("phone", user.getPerson().getPhone());
        jperson.element("email", user.getPerson().getEmail());
        if (user.getUserGroup() != null) {
            juser.element("userGroupKey", user.getUserGroup().getGroupKey());
        } else {
            juser.element("userGroupKey", "");
        }
View Full Code Here

    public static JSONObject createUserWithRoles(ZeroUser user, ModuleManager moduleController) {
        JSONObject juser = createUser(user);
        JSONArray jroles = new JSONArray();

        juser.element("roles", jroles);
        for (Role role : user.getRoles()) {
            jroles.element(createRole(role, moduleController));
        }

        return juser;
View Full Code Here

            for (UserParameterTemplate template : module.getUserParameters(user).values()) {
                if (template.isEditableByUser() || !onlyUserEditable) {
                    JSONObject jparameter = new JSONObject();
                    jparameters.element(jparameter);
                    UserParameter parameter = user.getParameter(template.getKey(), template.getRole());
                    jparameter.element("key", parameter.getKey());
                    if (template.getRole() != null) {
                        jparameter.element("keyName", template.getRole().getName() + " - " + parameter.getName());
                    } else {
                        jparameter.element("keyName", parameter.getName());
                    }
View Full Code Here

                    JSONObject jparameter = new JSONObject();
                    jparameters.element(jparameter);
                    UserParameter parameter = user.getParameter(template.getKey(), template.getRole());
                    jparameter.element("key", parameter.getKey());
                    if (template.getRole() != null) {
                        jparameter.element("keyName", template.getRole().getName() + " - " + parameter.getName());
                    } else {
                        jparameter.element("keyName", parameter.getName());
                    }
                    String value = template.formatValue(parameter);
                    jparameter.element("value", value);
View Full Code Here

                    UserParameter parameter = user.getParameter(template.getKey(), template.getRole());
                    jparameter.element("key", parameter.getKey());
                    if (template.getRole() != null) {
                        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

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.