code: protected void addEmbeddedGalleryOptions(
          JSONObject result,
          CmsObject cms,
          A_CmsXmlContentValue schemaType,
          CmsMessages messages,
          CmsResource resource,
          Locale contentLocale)
      throws JSONException {
  
          String embeddedImageGalleryOptions = getHtmlWidgetOption().getEmbeddedConfigurations().get("imagegallery");
          String embeddedDownloadGalleryOptions = getHtmlWidgetOption().getEmbeddedConfigurations().get(
              "downloadgallery");
  
          if (embeddedDownloadGalleryOptions != null) {
              CmsAdeDownloadGalleryWidget widget = new CmsAdeDownloadGalleryWidget();
              widget.setConfiguration(embeddedDownloadGalleryOptions);
              String downloadJsonString = widget.getConfiguration(
                  cms,
                  schemaType/*?*/,
                  messages,
                  resource,
                  contentLocale);
  
              JSONObject downloadJsonObj = new JSONObject(downloadJsonString);
              filterEmbeddedGalleryOptions(downloadJsonObj);
              result.put("downloadGalleryConfig", downloadJsonObj);
          }
  
          if (embeddedImageGalleryOptions != null) {
              CmsAdeImageGalleryWidget widget = new CmsAdeImageGalleryWidget();
              widget.setConfiguration(embeddedImageGalleryOptions);
              String imageJsonString = widget.getConfiguration(cms, schemaType/*?*/, messages, resource, contentLocale);
              JSONObject imageJsonObj = new JSONObject(imageJsonString);
              filterEmbeddedGalleryOptions(imageJsonObj);
              result.put("imageGalleryConfig", imageJsonObj);
          }
      }
docs: Adds the configuration for embedded gallery widgets the the JSON object.<p>
  
  @param result the  JSON object to modify
  @param cms the OpenCms context
  @param schemaType the schema type
  @param messages the messages
  @param resource the edited resource
  @param contentLocale the content locale
  
  @throws JSONException in case JSON manipulation fails