docs: private void mergePages() throws CmsException {
  
          int size = m_foldersEqualnames.size();
          if (size > 0) {
  
              m_report.println(
                  Messages.get().container(Messages.RPT_MERGE_PAGES_BEGIN_1, String.valueOf(size)),
                  I_CmsReport.FORMAT_HEADLINE);
              String defaultLocale = CmsLocaleManager.getDefaultLocale().toString();
              String locale2 = m_cms.readPropertyObject(getParamFolder2(), "locale", true).getValue(defaultLocale);
  
              // lock the source and the target folder
              m_report.print(Messages.get().container(Messages.RPT_LOCK_FOLDER_0), I_CmsReport.FORMAT_NOTE);
              m_report.print(
                  org.opencms.report.Messages.get().container(
                      org.opencms.report.Messages.RPT_ARGUMENT_1,
                      getParamFolder1()));
              m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
              m_cms.lockResource(getParamFolder1());
              m_report.println(
                  org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                  I_CmsReport.FORMAT_OK);
  
              m_report.print(Messages.get().container(Messages.RPT_LOCK_FOLDER_0), I_CmsReport.FORMAT_NOTE);
              m_report.print(
                  org.opencms.report.Messages.get().container(
                      org.opencms.report.Messages.RPT_ARGUMENT_1,
                      getParamFolder2()));
              m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
              m_cms.lockResource(getParamFolder2());
              m_report.println(
                  org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                  I_CmsReport.FORMAT_OK);
  
              // now loop through all collected resources
              int count = 1;
              Iterator i = m_foldersEqualnames.iterator();
              while (i.hasNext()) {
                  String resFolder1Name = (String)i.next();
                  try {
                      String resFolder2Name = getResourceNameInOtherFolder(
                          resFolder1Name,
                          getParamFolder1(),
                          getParamFolder2());
                      m_report.print(org.opencms.report.Messages.get().container(
                          org.opencms.report.Messages.RPT_SUCCESSION_2,
                          String.valueOf(count++),
                          String.valueOf(size)), I_CmsReport.FORMAT_NOTE);
                      m_report.print(Messages.get().container(Messages.RPT_PROCESS_0), I_CmsReport.FORMAT_NOTE);
                      m_report.print(
                          org.opencms.report.Messages.get().container(
                              org.opencms.report.Messages.RPT_ARGUMENT_1,
                              resFolder1Name));
                      m_report.print(Messages.get().container(Messages.RPT_DOUBLE_ARROW_0), I_CmsReport.FORMAT_NOTE);
                      m_report.print(
                          org.opencms.report.Messages.get().container(
                              org.opencms.report.Messages.RPT_ARGUMENT_1,
                              resFolder2Name));
                      m_report.println(
                          org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
  
                      // get the content of the resource in folder1
                      String locale = m_cms.readPropertyObject(resFolder1Name, "locale", true).getValue(defaultLocale);
                      m_report.print(
                          Messages.get().container(Messages.RPT_READ_CONTENT_2, resFolder1Name, locale),
                          I_CmsReport.FORMAT_NOTE);
                      CmsResource resFolder1 = m_cms.readResource(resFolder1Name, CmsResourceFilter.IGNORE_EXPIRATION);
                      CmsFile fileFolder1 = m_cms.readFile(resFolder1);
                      CmsXmlPage pageFolder1 = CmsXmlPageFactory.unmarshal(m_cms, fileFolder1);
                      m_report.println(
                          org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                          I_CmsReport.FORMAT_OK);
  
                      // get the content of the resource in folder2
                      locale = m_cms.readPropertyObject(resFolder2Name, "locale", true).getValue(defaultLocale);
                      m_report.print(
                          Messages.get().container(Messages.RPT_READ_CONTENT_2, resFolder2Name, locale),
                          I_CmsReport.FORMAT_NOTE);
                      CmsResource resFolder2 = m_cms.readResource(resFolder2Name, CmsResourceFilter.IGNORE_EXPIRATION);
                      CmsFile fileFolder2 = m_cms.readFile(resFolder2);
                      CmsXmlPage pageFolder2 = CmsXmlPageFactory.unmarshal(m_cms, fileFolder2);
                      m_report.println(
                          org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                          I_CmsReport.FORMAT_OK);
  
                      // now get all the text elements from the resource in folder 2 which match the the locale of folder 2
                      Locale loc = CmsLocaleManager.getLocale(locale2);
                      List textElements2 = pageFolder2.getNames(loc);
                      Iterator j = textElements2.iterator();
                      while (j.hasNext()) {
                          String textElementName = (String)j.next();
                          m_report.print(
                              Messages.get().container(Messages.RPT_PROCESS_TEXT_ELEM_1, textElementName),
                              I_CmsReport.FORMAT_NOTE);
                          // get the text element from the resource in folder 2...
                          String textElement = pageFolder2.getValue(textElementName, loc).getStringValue(m_cms);
                          // and set it in the resource in folder 1...
                          // WARNING: An existing content will be overwritten!
                          if (!pageFolder1.hasValue(textElementName, loc)) {
                              pageFolder1.addValue(textElementName, loc);
                          }
                          pageFolder1.setStringValue(m_cms, textElementName, loc, textElement);
                          m_report.println(
                              org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                              I_CmsReport.FORMAT_OK);
                      }
                      // the resource in folder 1 now has all text elements in both locales, so update it in the vfs
  
                      m_report.print(
                          Messages.get().container(Messages.RPT_WRITE_CONTENT_1, resFolder1Name),
                          I_CmsReport.FORMAT_NOTE);
                      fileFolder1.setContents(pageFolder1.marshal());
                      m_cms.writeFile(fileFolder1);
                      m_report.println(
                          org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                          I_CmsReport.FORMAT_OK);
  
                      // save all properties from the resource in folder2
                      m_report.print(
                          Messages.get().container(Messages.RPT_READ_PROPERTIES_1, resFolder2Name),
                          I_CmsReport.FORMAT_NOTE);
                      List properties = m_cms.readPropertyObjects(resFolder2Name, false);
                      m_report.println(
                          org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                          I_CmsReport.FORMAT_OK);
  
                      // the next thing to do is to delete the old resource in folder 2
                      m_report.print(
                          Messages.get().container(Messages.RPT_DELETE_PAGE_1, resFolder2Name),
                          I_CmsReport.FORMAT_NOTE);
                      m_cms.deleteResource(resFolder2Name, CmsResource.DELETE_PRESERVE_SIBLINGS);
                      m_report.println(
                          org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                          I_CmsReport.FORMAT_OK);
  
                      // copy a sibling of the resource from folder 1 to folder 2
                      m_report.print(
                          Messages.get().container(Messages.RPT_COPY_2, resFolder1Name, resFolder2Name),
                          I_CmsReport.FORMAT_NOTE);
                      m_cms.copyResource(resFolder1Name, resFolder2Name, CmsResource.COPY_AS_SIBLING);
                      m_report.println(
                          org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                          I_CmsReport.FORMAT_OK);
  
                      // restore the properties at the sibling in folder 2
                      m_report.print(
                          Messages.get().container(Messages.RPT_RESORE_PROPERTIES_1, resFolder2Name),
                          I_CmsReport.FORMAT_NOTE);
                      m_cms.writePropertyObjects(resFolder2Name, properties);
                      m_report.println(
                          org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                          I_CmsReport.FORMAT_OK);
  
                      resFolder1 = null;
                      resFolder2 = null;
                      fileFolder1 = null;
                      fileFolder2 = null;
                      pageFolder1 = null;
                      pageFolder2 = null;
  
                  } catch (CmsException e) {
                      m_report.println(e);
                  }
  
              }
              // lock the source and the target folder
              m_report.print(Messages.get().container(Messages.RPT_UNLOCK_1, getParamFolder1()), I_CmsReport.FORMAT_NOTE);
              m_cms.unlockResource(getParamFolder1());
              m_report.println(
                  org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                  I_CmsReport.FORMAT_OK);
  
              m_report.print(Messages.get().container(Messages.RPT_UNLOCK_1, getParamFolder2()), I_CmsReport.FORMAT_NOTE);
              m_cms.unlockResource(getParamFolder2());
              m_report.println(
                  org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
                  I_CmsReport.FORMAT_OK);
  
              m_report.println(Messages.get().container(Messages.RPT_MERGE_PAGES_END_0), I_CmsReport.FORMAT_HEADLINE);
          }
      }