docs: public CmsPublishData getPublishData(
          CmsObject cms,
          HashMap<String, String> params,
          String workflowId,
          String projectParam,
          List<String> pathList,
          String closeLink,
          boolean confirm)
      throws Exception {
  
          CmsPublishData result;
          boolean canOverrideWorkflow = true;
          Map<String, CmsWorkflow> workflows = OpenCms.getWorkflowManager().getWorkflows(cms);
          if (workflows.isEmpty()) {
              throw new Exception("No workflow available for the current user");
          }
          if (CmsStringUtil.isEmptyOrWhitespaceOnly(workflowId) || !workflows.containsKey(workflowId)) {
              workflowId = getLastWorkflowForUser();
              if (CmsStringUtil.isEmptyOrWhitespaceOnly(workflowId) || !workflows.containsKey(workflowId)) {
                  workflowId = workflows.values().iterator().next().getId();
              }
          } else {
              canOverrideWorkflow = false;
          }
          setLastWorkflowForUser(workflowId);
  
          // need to put this into params here so that the virtual project for direct publishing is included in the result of getManageableProjects()
          if (!pathList.isEmpty()) {
              params.put(CmsPublishOptions.PARAM_FILES, CmsStringUtil.listAsString(pathList, "|"));
          }
          boolean useCurrentPageAsDefault = params.containsKey(CmsPublishOptions.PARAM_START_WITH_CURRENT_PAGE);
          CmsPublishOptions options = getCachedOptions();
          List<CmsProjectBean> projects = OpenCms.getWorkflowManager().getManageableProjects(cms, params);
          Set<CmsUUID> availableProjectIds = Sets.newHashSet();
          for (CmsProjectBean projectBean : projects) {
              availableProjectIds.add(projectBean.getId());
          }
          CmsUUID defaultProjectId = CmsUUID.getNullUUID();
          if (useCurrentPageAsDefault && availableProjectIds.contains(CmsCurrentPageProject.ID)) {
              defaultProjectId = CmsCurrentPageProject.ID;
          }
  
          boolean foundProject = false;
          CmsUUID selectedProject = null;
          if (!pathList.isEmpty()) {
              params.put(CmsPublishOptions.PARAM_ENABLE_INCLUDE_CONTENTS, Boolean.TRUE.toString());
              params.put(CmsPublishOptions.PARAM_INCLUDE_CONTENTS, Boolean.TRUE.toString());
              selectedProject = CmsDirectPublishProject.ID;
              foundProject = true;
          } else {
              if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(projectParam) && CmsUUID.isValidUUID(projectParam)) {
                  selectedProject = new CmsUUID(projectParam);
                  // check if the selected project is a manageable project
                  for (CmsProjectBean project : projects) {
                      if (selectedProject.equals(project.getId())) {
                          foundProject = true;
                          if (project.isWorkflowProject()) {
                              canOverrideWorkflow = false;
                              workflowId = OpenCms.getWorkflowManager().getWorkflowForWorkflowProject(selectedProject);
                          }
                          break;
                      }
                  }
              }
              if (!foundProject) {
                  selectedProject = options.getProjectId();
                  if (selectedProject == null) {
                      selectedProject = defaultProjectId;
                      foundProject = true;
                  } else {
                      // check if the selected project is a manageable project
                      for (CmsProjectBean project : projects) {
                          if (selectedProject.equals(project.getId())) {
                              foundProject = true;
                              if (project.isWorkflowProject()) {
                                  canOverrideWorkflow = false;
                                  workflowId = OpenCms.getWorkflowManager().getWorkflowForWorkflowProject(
                                      selectedProject);
                              }
                              break;
                          }
                      }
                  }
              }
          }
          if (foundProject) {
              options.setProjectId(selectedProject);
          } else {
              options.setProjectId(CmsUUID.getNullUUID());
          }
  
          options.setParameters(params);
          result = new CmsPublishData(
              options,
              projects,
              getResourceGroups(workflows.get(workflowId), options, canOverrideWorkflow),
              workflows,
              workflowId);
          result.setCloseLink(closeLink);
          result.setShowConfirmation(confirm);
          return result;
      }