code: public static CmsDocumentDependency fromDependencyString(String input, String rootPath) {
  
          CmsDocumentDependency result = new CmsDocumentDependency(null, rootPath);
          if (input != null) {
  
              try {
                  if (input.startsWith("{")) {
                      JSONObject jsonDoc = new JSONObject(input);
                      result.fromJSON(jsonDoc, rootPath);
  
                      // main document
                      if (jsonDoc.has(JSON_MAIN)) {
  
                          JSONObject jsonMain = jsonDoc.getJSONObject(JSON_MAIN);
  
                          CmsDocumentDependency main = new CmsDocumentDependency(null, jsonMain.getString(JSON_PATH));
                          main.fromJSON(jsonMain, rootPath);
                          result.setMainDocument(main);
                      }
                  } else {
                      // special handling for news
                      String[] docs = CmsStringUtil.splitAsArray(input, '|');
                      for (int i = 0; i < docs.length; i++) {
                          String doc = docs[i];
  
                          String lang = doc.substring(0, 2);
                          Locale loc = new Locale(lang);
  
                          if (i == 0) {
                              result.setLocale(loc);
                          } else {
                              String rp = doc.substring(3);
                              CmsDocumentDependency dep = new CmsDocumentDependency(null, rp);
                              if (!loc.equals(result.getLocale())) {
                                  dep.setLocale(new Locale(lang));
                                  result.addVariant(dep);
                              }
                          }
                      }
                  }
              } catch (Exception ex) {
                  if (LOG.isErrorEnabled()) {
                      LOG.error(ex.getLocalizedMessage(), ex);
                  }
              }
          }
          return result;
      }
docs: Creates a dependency object from a String representation.<p>
  
  @param input the String representation
  @param rootPath the root path of the base document of which the dependencies are encoded
  
  @return the dependency object created from a String representation