docs: public void doExportAfterPublish(List<CmsPublishedResource> resources, I_CmsReport report)
      throws CmsException, IOException, ServletException {
  
          boolean templatesFound;
  
          // export must be done in the context of the export user
          // this will always use the root site
          CmsObject cmsExportObject = OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserExport());
  
          List<CmsPublishedResource> resourcesToExport = getRelatedResources(cmsExportObject, resources);
          // first export all non-template resources
          templatesFound = exportNonTemplateResources(cmsExportObject, resourcesToExport, report);
          LOG.warn("finished exporting non-template resources. ");
  
          // export template resources (check "plainoptimization" setting)
          if ((templatesFound) || (!OpenCms.getStaticExportManager().getQuickPlainExport())) {
              CmsStaticExportManager manager = OpenCms.getStaticExportManager();
  
              // build resource filter set
              Set<String> resourceFilter = new HashSet<String>();
              for (CmsPublishedResource pubResource : resourcesToExport) {
                  String rfsName = manager.getRfsName(cmsExportObject, pubResource.getRootPath());
                  resourceFilter.add(rfsName.substring(manager.getRfsPrefixForRfsName(rfsName).length()));
              }
  
              long timestamp = 0;
              List<String> publishedTemplateResources;
              boolean newTemplateLinksFound;
              int linkMode = CmsStaticExportManager.EXPORT_LINK_WITHOUT_PARAMETER;
              do {
                  // get all template resources which are potential candidates for a static export
                  publishedTemplateResources = cmsExportObject.readStaticExportResources(linkMode, timestamp);
                  if (publishedTemplateResources == null) {
                      break;
                  }
                  newTemplateLinksFound = publishedTemplateResources.size() > 0;
                  if (newTemplateLinksFound) {
                      if (linkMode == CmsStaticExportManager.EXPORT_LINK_WITHOUT_PARAMETER) {
                          // first loop, switch mode to parameter links, leave the timestamp unchanged
                          linkMode = CmsStaticExportManager.EXPORT_LINK_WITH_PARAMETER;
                          // filter without parameter
                          publishedTemplateResources.retainAll(resourceFilter);
                      } else {
                          // second and subsequent loops, only look for links not already exported
                          // this can only be the case for a link with parameters
                          // that was present on a page also generated with parameters
                          timestamp = System.currentTimeMillis();
                          // filter with parameter
                          Iterator<String> itPubTemplates = publishedTemplateResources.iterator();
                          while (itPubTemplates.hasNext()) {
                              String rfsName = itPubTemplates.next();
                              if (!resourceFilter.contains(rfsName.substring(0, rfsName.lastIndexOf('_')))) {
                                  itPubTemplates.remove();
                              }
                          }
                      }
                      // leave if no template left
                      if (publishedTemplateResources.isEmpty()) {
                          break;
                      }
                      // export
                      LOG.warn("exporting template resources. ");
                      exportTemplateResources(cmsExportObject, publishedTemplateResources, report);
                  }
                  // if no new template links where found we are finished
              } while (newTemplateLinksFound);
          }
      }