docs: public String getRfsName(CmsObject cms, String vfsName, String parameters, String targetDetailPage) {
  
          String rfsName;
          try {
              CmsResource vfsRes = null;
              if (OpenCms.getRunLevel() >= OpenCms.RUNLEVEL_4_SERVLET_ACCESS) {
                  // Accessing the ADEManager during setup may not work.
                  try {
                      vfsRes = cms.readResource(vfsName);
                      I_CmsDetailPageFinder finder = OpenCms.getADEManager().getDetailPageFinder();
                      String detailPage = finder.getDetailPage(
                          cms,
                          vfsRes.getRootPath(),
                          cms.getRequestContext().getUri(),
                          targetDetailPage);
                      if (detailPage != null) {
                          vfsName = CmsStringUtil.joinPaths(
                              detailPage,
                              CmsDetailPageUtil.getBestUrlName(cms, vfsRes.getStructureId()),
                              "/");
                      }
                  } catch (CmsVfsResourceNotFoundException e) {
                      // ignore
                  }
              }
              rfsName = getRfsNameWithExportName(cms, vfsName);
              String extension = CmsFileUtil.getExtension(rfsName);
              // check if the VFS resource is a JSP page with a ".jsp" ending
              // in this case the  name suffix must be build with special care,
              // usually it must be set to ".html"
              boolean isJsp = extension.equals(".jsp");
              if (isJsp) {
                  String suffix = null;
                  try {
                      CmsResource res = cms.readResource(vfsName);
                      isJsp = (CmsResourceTypeJsp.isJsp(res));
                      // if the resource is a plain resource then no change in suffix is required
                      if (isJsp) {
                          suffix = cms.readPropertyObject(
                              vfsName,
                              CmsPropertyDefinition.PROPERTY_EXPORTSUFFIX,
                              true).getValue(".html");
                      }
                  } catch (CmsVfsResourceNotFoundException e) {
                      // resource has been deleted, so we are not able to get the right extension from the properties
                      // try to figure out the right extension from file system
                      File rfsFile = new File(
                          CmsFileUtil.normalizePath(
                              getExportPath(cms.getRequestContext().addSiteRoot(vfsName)) + rfsName));
                      File parent = rfsFile.getParentFile();
                      if (parent != null) {
                          File[] paramVariants = parent.listFiles(new CmsPrefixFileFilter(rfsFile.getName()));
                          if ((paramVariants != null) && (paramVariants.length > 0)) {
                              // take the first
                              suffix = paramVariants[0].getAbsolutePath().substring(rfsFile.getAbsolutePath().length());
                          }
                      } else {
                          // if no luck, try the default extension
                          suffix = ".html";
                      }
                  }
                  if ((suffix != null) && !extension.equals(suffix.toLowerCase())) {
                      rfsName += suffix;
                      extension = suffix;
                  }
              }
              if (parameters != null) {
                  // build the RFS name for the link with parameters
                  rfsName = getRfsPath(rfsName, extension, parameters);
                  // we have found a rfs name for a vfs resource with parameters, save it to the database
                  try {
                      cms.writeStaticExportPublishedResource(
                          rfsName,
                          CmsStaticExportManager.EXPORT_LINK_WITH_PARAMETER,
                          parameters,
                          System.currentTimeMillis());
                  } catch (CmsException e) {
                      LOG.error(Messages.get().getBundle().key(Messages.LOG_WRITE_FAILED_1, rfsName), e);
                  }
              }
          } catch (CmsException e) {
              if (LOG.isDebugEnabled()) {
                  LOG.debug(e.getLocalizedMessage(), e);
              }
              // ignore exception, return vfsName as rfsName
              rfsName = vfsName;
          }
  
          // add export rfs prefix and return result
  
          if (!vfsName.startsWith(CmsWorkplace.VFS_PATH_SYSTEM) && !OpenCms.getSiteManager().startsWithShared(vfsName)) {
              return getRfsPrefix(cms.getRequestContext().addSiteRoot(vfsName)).concat(rfsName);
          } else {
              // check if we are generating a link to a related resource in the same rfs rule
              String source = cms.getRequestContext().addSiteRoot(cms.getRequestContext().getUri());
              Iterator<CmsStaticExportRfsRule> it = getRfsRules().iterator();
              while (it.hasNext()) {
                  CmsStaticExportRfsRule rule = it.next();
                  if (rule.getSource().matcher(source).matches() && rule.match(vfsName)) {
                      return rule.getRfsPrefix().concat(rfsName);
                  }
              }
              // this is a link across rfs rules
              return getRfsPrefix(cms.getRequestContext().getSiteRoot() + "/").concat(rfsName);
          }
      }