code: protected void checkNewParentsInList(CmsObject userCms, List<CmsResource> resources) throws CmsException {
  
          Map<String, CmsResource> resourcesByPath = new HashMap<String, CmsResource>();
          CmsObject rootCms = OpenCms.initCmsObject(m_adminCms);
          rootCms.getRequestContext().setCurrentProject(userCms.getRequestContext().getCurrentProject());
          rootCms.getRequestContext().setSiteRoot("");
          for (CmsResource resource : resources) {
              resourcesByPath.put(resource.getRootPath(), resource);
          }
          for (CmsResource resource : resources) {
              if (resource.getState().isNew()) {
                  String parentPath = CmsResource.getParentFolder(resource.getRootPath());
                  CmsResource parent = resourcesByPath.get(parentPath);
                  if (parent == null) {
                      parent = rootCms.readResource(parentPath);
                      if (parent.getState().isNew()) {
                          throw new CmsNewParentNotInWorkflowException(
                              Messages.get().container(
                                  Messages.ERR_NEW_PARENT_NOT_IN_WORKFLOW_1,
                                  resource.getRootPath()));
                      }
                  }
              }
          }
      }
docs: Checks that the parent folders of new resources which are released are either not new or are also released.<p>
  
  @param userCms the user CMS context
  @param resources the resources to check
  
  @throws CmsException if the check fails