docs: void submit() {
  
          //        if (!m_dateField.isValid()) {
          //            return;
          //        }
          long current = System.currentTimeMillis();
          Date dateValue = m_dateField.getDate();
          long publishTime = dateValue.getTime();
          if (current > publishTime) {
              m_context.error(
                  new CmsException(Messages.get().container(Messages.ERR_PUBLISH_SCHEDULED_DATE_IN_PAST_1, dateValue)));
          } else {
              try {
                  // make copies from the admin cmsobject and the user cmsobject
                  // get the admin cms object
                  CmsWorkplaceAction action = CmsWorkplaceAction.getInstance();
                  CmsObject cmsAdmin = action.getCmsAdminObject();
                  // get the user cms object
                  CmsObject cms = OpenCms.initCmsObject(m_context.getCms());
  
                  // set the current user site to the admin cms object
                  cmsAdmin.getRequestContext().setSiteRoot(cms.getRequestContext().getSiteRoot());
                  CmsProject tmpProject = createTempProject(cmsAdmin, m_context.getResources(), dateValue);
                  // set project as current project
                  cmsAdmin.getRequestContext().setCurrentProject(tmpProject);
                  cms.getRequestContext().setCurrentProject(tmpProject);
  
                  Set<CmsUUID> changeIds = new HashSet<CmsUUID>();
                  for (CmsResource resource : m_context.getResources()) {
                      addToTempProject(cmsAdmin, cms, resource, tmpProject);
                      if (resource.isFolder() && m_includeSubResources.getValue().booleanValue()) {
                          List<CmsResource> subResources = cms.readResources(
                              resource,
                              CmsResourceFilter.ONLY_VISIBLE.addExcludeState(CmsResourceState.STATE_UNCHANGED),
                              true);
                          for (CmsResource sub : subResources) {
                              // check publish permissions on sub resource
                              if (cms.hasPermissions(
                                  sub,
                                  CmsPermissionSet.ACCESS_DIRECT_PUBLISH,
                                  false,
                                  CmsResourceFilter.ALL)) {
                                  addToTempProject(cmsAdmin, cms, sub, tmpProject);
                              }
                          }
                      }
  
                      changeIds.add(resource.getStructureId());
                  }
                  // create a new scheduled job
                  CmsScheduledJobInfo job = new CmsScheduledJobInfo();
                  // the job name
                  String jobName = tmpProject.getName();
                  jobName = jobName.replace("&#47;", "/");
                  // set the job parameters
                  job.setJobName(jobName);
                  job.setClassName("org.opencms.scheduler.jobs.CmsPublishScheduledJob");
                  // create the cron expression
                  Calendar calendar = Calendar.getInstance();
                  calendar.setTime(dateValue);
                  String cronExpr = ""
                      + calendar.get(Calendar.SECOND)
                      + " "
                      + calendar.get(Calendar.MINUTE)
                      + " "
                      + calendar.get(Calendar.HOUR_OF_DAY)
                      + " "
                      + calendar.get(Calendar.DAY_OF_MONTH)
                      + " "
                      + (calendar.get(Calendar.MONTH) + 1)
                      + " "
                      + "?"
                      + " "
                      + calendar.get(Calendar.YEAR);
                  // set the cron expression
                  job.setCronExpression(cronExpr);
                  // set the job active
                  job.setActive(true);
                  // create the context info
                  CmsContextInfo contextInfo = new CmsContextInfo();
                  contextInfo.setProjectName(tmpProject.getName());
                  contextInfo.setUserName(cmsAdmin.getRequestContext().getCurrentUser().getName());
                  // create the job schedule parameter
                  SortedMap<String, String> params = new TreeMap<String, String>();
                  // the user to send mail to
                  String userName = m_context.getCms().getRequestContext().getCurrentUser().getName();
                  params.put(CmsPublishScheduledJob.PARAM_USER, userName);
                  // the job name
                  params.put(CmsPublishScheduledJob.PARAM_JOBNAME, jobName);
                  // the link check
                  params.put(CmsPublishScheduledJob.PARAM_LINKCHECK, "true");
                  // add the job schedule parameter
                  job.setParameters(params);
                  // add the context info to the scheduled job
                  job.setContextInfo(contextInfo);
                  // add the job to the scheduled job list
                  OpenCms.getScheduleManager().scheduleJob(cmsAdmin, job);
                  // update the XML configuration
                  OpenCms.writeConfiguration(CmsSchedulerConfiguration.class);
                  m_context.finish(changeIds);
              } catch (CmsException ex) {
                  LOG.error("Error performing publish scheduled dialog operation.", ex);
                  m_context.error(ex);
              }
          }
  
      }