docs: private Map<String, CmsContainerElementData> getElements(
          CmsResource page,
          Collection<String> clientIds,
          String uriParam,
          CmsUUID detailContentId,
          Collection<CmsContainer> containers,
          boolean allwaysCopy,
          String dndOriginContainer,
          boolean isDragMode,
          Locale locale)
      throws CmsException {
  
          CmsObject cms = getCmsObject();
          CmsContainerPageBean pageBean = generateContainerPageForContainers(
              containers,
              cms.getRequestContext().addSiteRoot(uriParam));
          Map<String, CmsContainerElementBean> idMapping = new HashMap<String, CmsContainerElementBean>();
          for (String elemId : clientIds) {
              if ((elemId == null)) {
                  continue;
              }
              CmsContainerElementBean element = getCachedElement(elemId, cms.getRequestContext().addSiteRoot(uriParam));
              if (element.getInstanceId() == null) {
                  element = element.clone();
                  getSessionCache().setCacheContainerElement(element.editorHash(), element);
              }
              element.initResource(cms);
              idMapping.put(elemId, element);
          }
          List<String> foundGroups = new ArrayList<String>();
          if (CmsContainerElement.MENU_CONTAINER_ID.equals(dndOriginContainer)) {
              // this indicates the element is added to the page and not being repositioned, check for model group data
              CmsModelGroupHelper modelHelper = new CmsModelGroupHelper(
                  cms,
                  getConfigData(uriParam),
                  getSessionCache(),
                  isEditingModelGroups(cms, page));
              pageBean = modelHelper.prepareforModelGroupContent(idMapping, foundGroups, pageBean, allwaysCopy, locale);
          }
  
          CmsElementUtil elemUtil = new CmsElementUtil(
              cms,
              uriParam,
              pageBean,
              detailContentId,
              getRequest(),
              getResponse(),
              isDragMode,
              locale);
          Map<String, CmsContainerElementData> result = new HashMap<String, CmsContainerElementData>();
          Set<String> ids = new HashSet<String>();
          for (Entry<String, CmsContainerElementBean> entry : idMapping.entrySet()) {
              CmsContainerElementBean element = entry.getValue();
              String dndId = null;
              if (ids.contains(element.editorHash())) {
                  continue;
              }
              if ((dndOriginContainer != null) && !CmsContainerElement.MENU_CONTAINER_ID.equals(dndOriginContainer)) {
                  CmsFormatterConfiguration formatterConfig = elemUtil.getFormatterConfiguration(element.getResource());
                  Map<String, String> dndSettings = getSettingsToChangeForDnd(
                      element.getIndividualSettings(),
                      formatterConfig,
                      containers,
                      dndOriginContainer);
                  if (!dndSettings.isEmpty()) {
                      CmsContainerElementBean dndElementBean = overrideSettings(element, dndSettings);
                      getSessionCache().setCacheContainerElement(dndElementBean.editorHash(), dndElementBean);
                      dndId = dndElementBean.editorHash();
                      Map<String, CmsContainerElementData> dndResults = getElements(
                          page,
                          Arrays.asList(dndId),
                          uriParam,
                          detailContentId,
                          containers,
                          false,
                          null,
                          isDragMode,
                          locale);
                      result.putAll(dndResults);
                  }
              }
  
              CmsContainerElementData elementData = elemUtil.getElementData(page, element, containers);
              if (elementData == null) {
                  continue;
              }
              // make sure the element with it's current settings is cached
              getSessionCache().setCacheContainerElement(element.editorHash(), element);
              elementData.setDndId(dndId);
              result.put(entry.getKey(), elementData);
              if (elementData.isGroupContainer() || elementData.isInheritContainer()) {
                  // this is a group-container
                  CmsResource elementRes = cms.readResource(element.getId());
                  List<CmsContainerElementBean> subElements = elementData.isGroupContainer()
                  ? getGroupContainerElements(elementRes)
                  : getInheritedElements(elementRes, locale, uriParam);
                  // adding all sub-items to the elements data
                  for (CmsContainerElementBean subElement : subElements) {
                      getSessionCache().setCacheContainerElement(subElement.editorHash(), subElement);
                      if (!ids.contains(subElement.editorHash())) {
                          CmsContainerElementData subItemData = elemUtil.getElementData(page, subElement, containers);
                          ids.add(subElement.editorHash());
                          result.put(subElement.editorHash(), subItemData);
                      }
                  }
              }
              ids.add(element.editorHash());
          }
          for (CmsContainerElementData elementData : result.values()) {
              elementData.setGroup(foundGroups.contains(elementData.getClientId()));
          }
          return result;
      }