docs: protected JSONObject getJsonConfig(
          CmsObject cms,
          A_CmsXmlContentValue schemaType,
          CmsMessages messages,
          CmsResource resource,
          Locale contentLocale) {
  
          JSONObject config = new JSONObject();
          try {
              config.put(I_CmsGalleryProviderConstants.CONFIG_START_SITE, m_startSite);
  
              config.put(I_CmsGalleryProviderConstants.CONFIG_SHOW_SITE_SELECTOR, m_showSiteSelector);
              config.put(I_CmsGalleryProviderConstants.CONFIG_REFERENCE_PATH, cms.getSitePath(resource));
              config.put(I_CmsGalleryProviderConstants.CONFIG_LOCALE, contentLocale.toString());
              config.put(I_CmsGalleryProviderConstants.CONFIG_GALLERY_MODE, GalleryMode.widget.name());
              config.put(I_CmsGalleryProviderConstants.CONFIG_GALLERY_STORAGE_PREFIX, "linkselect");
              if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_selectableTypes)) {
                  config.put(I_CmsGalleryProviderConstants.CONFIG_RESOURCE_TYPES, m_selectableTypes.trim());
              }
              String tabConfig = null;
              m_includeFiles = m_includeFiles
                  && (CmsStringUtil.isEmptyOrWhitespaceOnly(m_selectableTypes)
                      || !isOnlyFolders(m_selectableTypes.trim()));
              if (m_includeFiles) {
                  tabConfig = CmsGalleryTabConfiguration.TC_SELECT_ALL;
                  if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_selectableTypes)
                      && !Arrays.asList(m_selectableTypes.split("[, ]+")).contains(
                          CmsResourceTypeXmlContainerPage.getStaticTypeName())) {
                      tabConfig = CmsGalleryTabConfiguration.TC_SELECT_ALL_NO_SITEMAP;
                  }
              } else {
                  tabConfig = CmsGalleryTabConfiguration.TC_FOLDERS;
              }
              config.put(I_CmsGalleryProviderConstants.CONFIG_TAB_CONFIG, tabConfig);
              if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_searchTypes)) {
                  CmsMacroResolver resolver = CmsMacroResolver.newInstance();
                  resolver.addDynamicMacro(DEFAULT_SEARCH_TYPES_MACRO, new SearchTypesFactory(cms, resource));
                  String searchTypes = resolver.resolveMacros(m_searchTypes.trim());
                  config.put(I_CmsGalleryProviderConstants.CONFIG_SEARCH_TYPES, searchTypes);
              } else if (CmsStringUtil.isEmptyOrWhitespaceOnly(m_selectableTypes)) {
                  config.put(I_CmsGalleryProviderConstants.CONFIG_SEARCH_TYPES, getDefaultSearchTypes(cms, resource));
              }
              if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_startFolder)) {
                  config.put(I_CmsGalleryProviderConstants.CONFIG_START_FOLDER, m_startFolder);
              }
              String treeToken = ""
                  + Objects.hashCode(m_startSite, cms.getRequestContext().getSiteRoot(), "" + m_selectableTypes);
              config.put(I_CmsGalleryProviderConstants.CONFIG_TREE_TOKEN, treeToken);
  
              if (m_gallerySelect) {
                  config.put(I_CmsGalleryProviderConstants.CONFIG_GALLERIES_SELECTABLE, "true");
                  config.put(I_CmsGalleryProviderConstants.CONFIG_RESULTS_SELECTABLE, "false");
                  config.put(I_CmsGalleryProviderConstants.CONFIG_TAB_CONFIG, CmsGalleryTabConfiguration.TC_GALLERIES);
              }
  
          } catch (JSONException e) {
              LOG.error(e.getLocalizedMessage(), e);
          }
          return config;
      }