docs: private CmsContainerElementBean getContainerElementBeanToSave(
          CmsObject cms,
          String containerpageRootPath,
          CmsContainer container,
          CmsContainerElement elementData)
      throws CmsException {
  
          String elementClientId = elementData.getClientId();
          boolean hasUuidPrefix = (elementClientId != null) && elementClientId.matches(CmsUUID.UUID_REGEX + ".*$");
          boolean isCreateNew = elementData.isCreateNew();
          if (elementData.isNew() && !hasUuidPrefix) {
  
              // Due to the changed save system without the save button, we need to make sure that new elements
              // are only created once. This must happen when the user first edits a new element. But we still
              // want to save changes to non-new elements on the page, so we skip new elements while saving.
              return null;
          }
          CmsContainerElementBean element = getCachedElement(elementData.getClientId(), containerpageRootPath);
  
          CmsResource resource;
          if (element.getResource() == null) {
              element.initResource(cms);
              resource = element.getResource();
          } else {
              // make sure resource is readable, this is necessary for new content elements
              if (element.getId().isNullUUID()) {
                  // in memory only element, can not be read nor saved
                  return null;
              }
              resource = cms.readResource(element.getId(), CmsResourceFilter.IGNORE_EXPIRATION);
          }
  
          // check if there is a valid formatter
          int containerWidth = container.getWidth();
          CmsADEConfigData config = getConfigData(containerpageRootPath);
          CmsFormatterConfiguration formatters = config.getFormatters(cms, resource);
          String containerType = null;
          containerType = container.getType();
          I_CmsFormatterBean formatter = null;
          String formatterConfigId = null;
          if ((element.getIndividualSettings() != null)
              && (element.getIndividualSettings().get(
                  CmsFormatterConfig.getSettingsKeyForContainer(container.getName())) != null)) {
              formatterConfigId = element.getIndividualSettings().get(
                  CmsFormatterConfig.getSettingsKeyForContainer(container.getName()));
              if (CmsUUID.isValidUUID(formatterConfigId)) {
                  formatter = OpenCms.getADEManager().getCachedFormatters(false).getFormatters().get(
                      new CmsUUID(formatterConfigId));
              } else if (formatterConfigId.startsWith(CmsFormatterConfig.SCHEMA_FORMATTER_ID)
                  && CmsUUID.isValidUUID(formatterConfigId.substring(CmsFormatterConfig.SCHEMA_FORMATTER_ID.length()))) {
                  formatter = formatters.getFormatterSelection(containerType, containerWidth).get(formatterConfigId);
              }
          }
          if (formatter == null) {
              formatter = CmsElementUtil.getFormatterForContainer(cms, element, container, config, getSessionCache());
              if (formatter != null) {
                  formatterConfigId = formatter.isFromFormatterConfigFile()
                  ? formatter.getId()
                  : CmsFormatterConfig.SCHEMA_FORMATTER_ID + formatter.getJspStructureId().toString();
              }
          }
          CmsContainerElementBean newElementBean = null;
          if (formatter != null) {
              Map<String, String> settings = new HashMap<String, String>(element.getIndividualSettings());
              String formatterKey = CmsFormatterConfig.getSettingsKeyForContainer(container.getName());
              settings.put(formatterKey, formatterConfigId);
              // remove not used formatter settings
              Iterator<Entry<String, String>> entries = settings.entrySet().iterator();
              while (entries.hasNext()) {
                  Entry<String, String> entry = entries.next();
                  if (entry.getKey().startsWith(CmsFormatterConfig.FORMATTER_SETTINGS_KEY)
                      && !entry.getKey().equals(formatterKey)) {
                      entries.remove();
                  }
              }
  
              newElementBean = new CmsContainerElementBean(
                  element.getId(),
                  formatter.getJspStructureId(),
                  settings,
                  isCreateNew);
          }
          return newElementBean;
      }