code: public void fromJSON(JSONObject json, String rootPath) {
  
          try {
              // language versions
              if (json.has(JSON_LANGUAGES)) {
                  JSONArray jsonLanguages = json.getJSONArray(JSON_LANGUAGES);
                  for (int i = 0; i < jsonLanguages.length(); i++) {
                      JSONObject jsonLang = (JSONObject)jsonLanguages.get(i);
  
                      CmsDocumentDependency lang = new CmsDocumentDependency(null, jsonLang.getString(JSON_PATH));
                      lang.fromJSON(jsonLang, rootPath);
                      addVariant(lang);
                  }
              }
  
              // attachments
              if (json.has(JSON_ATTACHMENTS)) {
                  JSONArray jsonAttachments = json.getJSONArray(JSON_ATTACHMENTS);
                  for (int i = 0; i < jsonAttachments.length(); i++) {
                      try {
                          JSONObject jsonAttachment = (JSONObject)jsonAttachments.get(i);
  
                          CmsDocumentDependency att = new CmsDocumentDependency(
                              null,
                              jsonAttachment.getString(JSON_PATH));
                          att.fromJSON(jsonAttachment, rootPath);
  
                          // language versions of attachment
                          if (jsonAttachment.has(JSON_LANGUAGES)) {
                              JSONArray jsonAttLanguages = jsonAttachment.getJSONArray(JSON_LANGUAGES);
                              for (int j = 0; j < jsonAttLanguages.length(); j++) {
                                  JSONObject jsonAttLanguage = (JSONObject)jsonAttLanguages.get(j);
  
                                  CmsDocumentDependency attLang = new CmsDocumentDependency(
                                      null,
                                      jsonAttLanguage.getString(JSON_PATH));
                                  attLang.fromJSON(jsonAttLanguage, rootPath);
                                  att.addVariant(attLang);
                              }
                          }
                          addAttachment(att);
                      } catch (Exception e) {
                          LOG.error(e);
                      }
                  }
              }
          } catch (Exception ex) {
              if (LOG.isErrorEnabled()) {
                  LOG.error(ex.getLocalizedMessage(), ex);
              }
          }
      }
docs: Read the information out of the given JSON object to fill
  the values of the document.<p>
  
  @param json the JSON object with the information about this document
  @param rootPath the current path the home division