Package org.json

Examples of org.json.JSONObject.accumulate()


                    for (FormRow row : (FormRowSet) objValue) {
                        Set<String> props = row.stringPropertyNames();
                        JSONObject jo = new JSONObject();
                        for (String key : props) {
                            String val = row.getProperty(key);
                            jo.accumulate(key, val);
                        }
                        jsonArray.put(jo);
                    }
                    jsonObject.put(propertyName, jsonArray);
                } else if (objValue != null && objValue instanceof Object[]) {
View Full Code Here


            FormBinder binder = (FormBinder) element.getOptionsBinder();
           
            String s = null;
            try {
                JSONObject jo = new JSONObject();
                jo.accumulate(FormUtil.PROPERTY_CLASS_NAME, binder.getClassName());
                jo.accumulate(FormUtil.PROPERTY_PROPERTIES, FormUtil.generatePropertyJsonObject(binder.getProperties()));
               
                s = jo.toString();
            } catch (Exception e) {}
            if (s != null) {
View Full Code Here

           
            String s = null;
            try {
                JSONObject jo = new JSONObject();
                jo.accumulate(FormUtil.PROPERTY_CLASS_NAME, binder.getClassName());
                jo.accumulate(FormUtil.PROPERTY_PROPERTIES, FormUtil.generatePropertyJsonObject(binder.getProperties()));
               
                s = jo.toString();
            } catch (Exception e) {}
            if (s != null) {
                AppDefinition appDef = AppUtil.getCurrentAppDefinition();
View Full Code Here

            empty.put("name", "");

            //JSONArray deptArray = new JSONArray();
            departments = getRecursiveDepartmentList(orgId);
            if (departments != null) {
                jsonObject.accumulate("departments", empty);
                for (Department department : departments) {
                    Map data = new HashMap();
                    data.put("id", department.getId());
                    data.put("name", department.getName());
                    data.put("prefix", (department.getTreeStructure() != null) ? department.getTreeStructure() : "");
View Full Code Here

                for (Department department : departments) {
                    Map data = new HashMap();
                    data.put("id", department.getId());
                    data.put("name", department.getName());
                    data.put("prefix", (department.getTreeStructure() != null) ? department.getTreeStructure() : "");
                    jsonObject.accumulate("departments", data);
                }
            }

            //JSONArray gradeArray = new JSONArray();
            grades = directoryManager.getGradesByOrganizationId(null, orgId, "name", false, null, null);
View Full Code Here

            }

            //JSONArray gradeArray = new JSONArray();
            grades = directoryManager.getGradesByOrganizationId(null, orgId, "name", false, null, null);
            if (grades != null) {
                jsonObject.accumulate("grades", empty);
                for (Grade grade : grades) {
                    Map data = new HashMap();
                    data.put("id", grade.getId());
                    data.put("name", grade.getName());
                    jsonObject.accumulate("grades", data);
View Full Code Here

                jsonObject.accumulate("grades", empty);
                for (Grade grade : grades) {
                    Map data = new HashMap();
                    data.put("id", grade.getId());
                    data.put("name", grade.getName());
                    jsonObject.accumulate("grades", data);
                }
            }
        }

        if (callback != null && callback.trim().length() != 0) {
View Full Code Here

                data.put("employeeCode", employment.getEmployeeCode());
                data.put("role", employment.getRole());
                data.put("organization.name", (employment.getOrganization() != null) ? employment.getOrganization().getName() : "");
                data.put("department.name", (employment.getDepartment() != null) ? employment.getDepartment().getName() : "");
                data.put("grade.name", (employment.getGrade() != null) ? employment.getGrade().getName() : "");
                jsonObject.accumulate("data", data);
            }
        }

        jsonObject.accumulate("total", getDirectoryManager().getTotalEmployments(name, orgId, deptId, gradeId));
        jsonObject.accumulate("start", start);
View Full Code Here

                data.put("grade.name", (employment.getGrade() != null) ? employment.getGrade().getName() : "");
                jsonObject.accumulate("data", data);
            }
        }

        jsonObject.accumulate("total", getDirectoryManager().getTotalEmployments(name, orgId, deptId, gradeId));
        jsonObject.accumulate("start", start);
        jsonObject.accumulate("sort", sort);
        jsonObject.accumulate("desc", desc);

        if (callback != null && callback.trim().length() != 0) {
View Full Code Here

                jsonObject.accumulate("data", data);
            }
        }

        jsonObject.accumulate("total", getDirectoryManager().getTotalEmployments(name, orgId, deptId, gradeId));
        jsonObject.accumulate("start", start);
        jsonObject.accumulate("sort", sort);
        jsonObject.accumulate("desc", desc);

        if (callback != null && callback.trim().length() != 0) {
            writer.write(StringEscapeUtils.escapeHtml(callback) + "(" + jsonObject + ");");
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.