code: public String getJsonOrgUnitList() {
  
          List<CmsOrganizationalUnit> allOus = getOus();
          List<JSONObject> jsonOus = new ArrayList<JSONObject>(allOus.size());
          int index = 0;
          for (CmsOrganizationalUnit ou : allOus) {
              JSONObject jsonObj = new JSONObject();
              try {
                  // 1: OU fully qualified name
                  jsonObj.put("name", ou.getName());
                  // 2: OU display name
                  jsonObj.put("displayname", ou.getDisplayName(m_locale));
                  // 3: OU simple name
                  jsonObj.put("simplename", ou.getSimpleName());
                  // 4: OU description
                  jsonObj.put("description", ou.getDescription(m_locale));
                  // 5: selection flag
                  boolean isSelected = false;
                  if (ou.getName().equals(m_oufqn)
                      || (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_oufqn)
                          && ou.getName().equals(m_oufqn.substring(1)))) {
                      isSelected = true;
                  }
                  jsonObj.put("active", isSelected);
                  // 6: level of the OU
                  jsonObj.put("level", CmsResource.getPathLevel(ou.getName()));
                  // 7: OU index
                  jsonObj.put("index", index);
                  // add the generated JSON object to the result list
                  jsonOus.add(jsonObj);
                  index++;
              } catch (JSONException e) {
                  // error creating JSON object, skip this OU
              }
          }
          // generate a JSON array from the JSON object list
          JSONArray jsonArr = new JSONArray(jsonOus);
          return jsonArr.toString();
      }
docs: Returns the available organizational units as JSON array string.<p>
  
  @return the available organizational units as JSON array string