docs: public static void copyAndResolveMacro(
          CmsObject cms,
          String source,
          String destination,
          Map<String, String> keyValue,
          boolean adjustLinks,
          CmsResource.CmsResourceCopyMode copyMode,
          I_CmsReport report)
      throws CmsException {
  
          if (report != null) {
              report.println(
                  org.opencms.ui.apps.Messages.get().container(
                      org.opencms.ui.apps.Messages.RPT_MACRORESOLVER_COPY_RESOURCES_1,
                      source));
          }
          cms.copyResource(source, destination, copyMode);
          if (report != null) {
              report.println(
                  org.opencms.ui.apps.Messages.get().container(
                      org.opencms.ui.apps.Messages.RPT_MACRORESOLVER_LINK_ADJUST_0));
          }
          if (adjustLinks) {
              cms.adjustLinks(source, destination);
          }
          //Guards to check if keyValue is set correctly, otherwise no adjustment is done
          if (keyValue == null) {
              return;
          }
          if (keyValue.isEmpty()) {
              return;
          }
  
          if (report != null) {
              report.println(
                  org.opencms.ui.apps.Messages.get().container(
                      org.opencms.ui.apps.Messages.RPT_MACRORESOLVER_APPLY_MACROS_0));
          }
  
          CmsMacroResolver macroResolver = new CmsMacroResolver();
          macroResolver.setKeepEmptyMacros(true);
          for (String key : keyValue.keySet()) {
  
              macroResolver.addMacro(key, keyValue.get(key));
          }
  
          //Collect all resources to loop over
          List<CmsResource> resoucesToCopy = cms.readResources(destination, CmsResourceFilter.ALL, true);
          for (CmsResource resource : resoucesToCopy) {
              if (resource.isFile()
                  && (resource.getTypeId() != CmsResourceTypeBinary.getStaticTypeId())
                  && (resource.getTypeId() != CmsResourceTypeImage.getStaticTypeId())) {
                  CmsFile file = cms.readFile(resource);
                  CmsMacroResolver.updateFile(cms, file, macroResolver);
              }
              CmsMacroResolver.updateProperties(cms, resource, macroResolver);
          }
  
          // apply macro to the folder itself
          CmsResource resource = cms.readResource(destination, CmsResourceFilter.ALL);
  
          CmsMacroResolver.updateProperties(cms, resource, macroResolver);
  
          if (cms.existsResource(ensureFoldername(destination) + CmsSiteManager.MACRO_FOLDER)) {
              cms.deleteResource(
                  ensureFoldername(destination) + CmsSiteManager.MACRO_FOLDER,
                  CmsResource.CmsResourceDeleteMode.valueOf(-1));
          }
  
      }