docs: public CmsContainerElementData getElementData(
          CmsResource page,
          CmsContainerElementBean element,
          Collection<CmsContainer> containers)
      throws CmsException {
  
          Locale requestLocale = m_cms.getRequestContext().getLocale();
          m_cms.getRequestContext().setLocale(m_locale);
          element.initResource(m_cms);
          if (element.getResource().isFolder()) {
              return null;
          }
          CmsContainerElementData elementData = getBaseElementData(page, element);
          CmsFormatterConfiguration formatterConfiguraton = getFormatterConfiguration(element.getResource());
          Map<String, String> contents = new HashMap<String, String>();
          if (element.isGroupContainer(m_cms)) {
              Map<String, CmsContainer> containersByName = new HashMap<String, CmsContainer>();
              for (CmsContainer container : containers) {
                  containersByName.put(container.getName(), container);
              }
              CmsXmlGroupContainer xmlGroupContainer = CmsXmlGroupContainerFactory.unmarshal(
                  m_cms,
                  element.getResource(),
                  m_req);
              CmsGroupContainerBean groupContainer = xmlGroupContainer.getGroupContainer(m_cms);
              // make sure to use the content title and not the property title
              elementData.setTitle(groupContainer.getTitle());
              elementData.setTypes(groupContainer.getTypes());
              elementData.setDescription(groupContainer.getDescription());
              if (groupContainer.getTypes().isEmpty()) {
                  if (groupContainer.getElements().isEmpty()) {
                      String emptySub = "<div>NEW AND EMPTY</div>";
                      for (CmsContainer cont : containersByName.values()) {
                          if (formatterConfiguraton.hasFormatter(cont.getType(), cont.getWidth())) {
                              contents.put(cont.getName(), emptySub);
                          }
                      }
                  } else {
                      // TODO: throw appropriate exception
                      return null;
                  }
              } else {
  
                  // add formatter and content entries for the supported types
                  for (CmsContainer cnt : containersByName.values()) {
  
                      String type = cnt.getType();
                      if (checkGroupAllowed(type, groupContainer)) {
                          contents.put(cnt.getName(), "<div>should not be used</div>");
                      }
                  }
              }
              // add subitems
              List<String> subItems = new ArrayList<String>();
  
              for (CmsContainerElementBean subElement : groupContainer.getElements()) {
                  // collect ids
                  subItems.add(subElement.editorHash());
              }
              elementData.setSubItems(subItems);
          } else if (element.isInheritedContainer(m_cms)) {
              CmsInheritanceReferenceParser parser = new CmsInheritanceReferenceParser(m_cms);
              parser.parse(element.getResource());
              CmsInheritanceReference ref = parser.getReference(m_locale);
              String name = null;
              // check for new inheritance reference
              if (ref != null) {
                  name = ref.getName();
                  elementData.setDescription(ref.getDescription());
                  elementData.setTitle(ref.getTitle());
              }
              for (CmsContainer container : containers) {
                  if (formatterConfiguraton.hasFormatter(container.getType(), container.getWidth())) {
                      contents.put(container.getName(), "<div>should not be used</div>");
                  }
              }
  
              List<CmsInheritanceInfo> inheritanceInfos = new ArrayList<CmsInheritanceInfo>();
              if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(name)) {
                  CmsInheritedContainerState result = OpenCms.getADEManager().getInheritedContainerState(
                      m_cms,
                      m_cms.addSiteRoot(m_currentPageUri),
                      name);
                  for (CmsContainerElementBean subElement : result.getElements(true)) {
                      CmsInheritanceInfo inheritanceInfo = subElement.getInheritanceInfo();
                      inheritanceInfo.setClientId(subElement.editorHash());
                      inheritanceInfos.add(inheritanceInfo);
                  }
              } else {
                  // setting a new id for name, will be persisted once the inheritance reference is edited and saved.
                  // use the structure id so it will always be the same for the resource
                  name = element.getResource().getStructureId().toString();
              }
              elementData.setInheritanceInfos(inheritanceInfos);
              elementData.setInheritanceName(name);
          } else {
  
              for (CmsContainer cnt : containers) {
                  boolean missesFormatterSetting = !elementData.getSettings().containsKey(
                      CmsFormatterConfig.getSettingsKeyForContainer(cnt.getName()));
                  if (missesFormatterSetting) {
                      if (element.getFormatterId() == null) {
                          I_CmsFormatterBean formatter = getStartFormatter(
                              m_cms,
                              cnt,
                              m_adeConfig,
                              element,
                              CmsADESessionCache.getCache(m_req, m_cms));
                          if (formatter != null) {
                              elementData.getSettings().put(
                                  CmsFormatterConfig.getSettingsKeyForContainer(cnt.getName()),
                                  formatter.getId());
                              element.addFormatterSetting(cnt.getName(), formatter.getId());
                          }
                      } else {
                          Map<String, I_CmsFormatterBean> formatterSelection = formatterConfiguraton.getFormatterSelection(
                              cnt.getType(),
                              cnt.getWidth());
                          for (Entry<String, I_CmsFormatterBean> formatterEntry : formatterSelection.entrySet()) {
                              I_CmsFormatterBean formatter = formatterEntry.getValue();
                              String id = formatterEntry.getKey();
                              if (element.getFormatterId().equals(formatter.getJspStructureId())) {
                                  elementData.getSettings().put(
                                      CmsFormatterConfig.getSettingsKeyForContainer(cnt.getName()),
                                      id);
                                  break;
                              }
                          }
                      }
                  }
              }
              // get the formatter configuration
              Map<String, String> contentsByName = getContentsByContainerName(element, containers);
              contents = contentsByName;
          }
          elementData.setContents(contents);
          m_cms.getRequestContext().setLocale(requestLocale);
          return elementData;
      }