code: protected void init(CmsObject cms, CmsMessages messages, I_CmsWidgetParameter param, String configuration) {
  
          if (configuration == null) {
              // no configuration String found, return
              return;
          }
          configuration = CmsMacroResolver.resolveMacros(configuration, cms, messages);
          JSONObject jsonObj = new JSONObject();
          try {
              jsonObj = new JSONObject(configuration);
          } catch (JSONException e) {
              // initialization failed
              return;
          }
          // determine the class name that fills in values dynamically
          setClassName(jsonObj.optString(CONFIG_KEY_CLASS, null));
          I_CmsGalleryWidgetDynamicConfiguration dynConf = null;
          if (getClassName() != null) {
              try {
                  dynConf = (I_CmsGalleryWidgetDynamicConfiguration)Class.forName(getClassName()).newInstance();
              } catch (Exception e) {
                  // class not found
              }
          }
          // determine the initial item list settings
          setType(jsonObj.optString(CONFIG_KEY_TYPE));
          if ((CONFIG_VALUE_DYNAMIC.equals(getType()) || CmsStringUtil.isEmpty(getType())) && (dynConf != null)) {
              setType(dynConf.getType(cms, messages, param));
          }
          setGalleryTypes(jsonObj.optString(CONFIG_KEY_GALLERYTYPES, null));
          setStartup(jsonObj.optString(CONFIG_KEY_STARTUP));
          if ((CONFIG_VALUE_DYNAMIC.equals(getStartup()) || CmsStringUtil.isEmpty(getStartup())) && (dynConf != null)) {
              setStartup(dynConf.getStartup(cms, messages, param));
          }
      }
docs: Initializes the widget configuration using the given configuration string.<p>
  
  @param cms an initialized instance of a CmsObject
  @param messages the dialog messages
  @param param the widget parameter to generate the widget for
  @param configuration the widget configuration string