code: public void addDocumentDependency(CmsObject cms, CmsDocumentDependency resDeps) {
  
          if (resDeps != null) {
              m_doc.addField(CmsSearchField.FIELD_DEPENDENCY_TYPE, resDeps.getType());
              if ((resDeps.getMainDocument() != null) && (resDeps.getType() != null)) {
                  m_doc.addField(
                      CmsSearchField.FIELD_PREFIX_DEPENDENCY + resDeps.getType().toString(),
                      resDeps.getMainDocument().toDependencyString(cms));
              }
              for (CmsDocumentDependency dep : resDeps.getVariants()) {
                  m_doc.addField(
                      CmsSearchField.FIELD_PREFIX_DEPENDENCY + dep.getType().toString(),
                      dep.toDependencyString(cms));
              }
              for (CmsDocumentDependency dep : resDeps.getAttachments()) {
                  m_doc.addField(
                      CmsSearchField.FIELD_PREFIX_DEPENDENCY + dep.getType().toString(),
                      dep.toDependencyString(cms));
              }
          }
      }
docs: Adds the given document dependency to this document.<p>
  
  @param cms the current CmsObject
  @param resDeps the dependency