Returns the configuration for a mode (view, manage, pivot) for an
expected type (list, form). Uses fallback configuration.
322155
protected function makeConfigForMode($mode = 'view', $type = 'list', $throwException = true)
    {
        $config = null;

        /*
         * Look for $this->config->view['list']
         */
        if (
            isset($this->config->{$mode}) &&
            array_key_exists($type, $this->config->{$mode})
        ) {
            $config = $this->config->{$mode}[$type];
        }
        /*
         * Look for $this->config->list
         */
        elseif (isset($this->config->{$type})) {
            $config = $this->config->{$type};
        }

        /*
         * Apply substitutes:
         *
         * - view.list => manage.list
         */
        if (!$config) {
            if ($mode == 'manage' && $type == 'list') {
                return $this->makeConfigForMode('view', $type);
            }

            if ($throwException) {
                throw new ApplicationException('Missing configuration for '.$mode.'.'.$type.' in RelationController definition '.$this->field);
            }

            return false;
        }

        return $this->makeConfig($config);
    }
172919
def get_form(self, step=None, data=None, files=None):
        
        self.form_obj = super(FormWizardAdminView, self).get_form(
            step=step, data=data, files=files)
        return self.form_obj
17210
function getConfig(req, res, next) {
  var params = {
    appId: req.params.projectid || req.params.id
  };

  forms.getAppConfig(req.connectionOptions, params, formsResultHandlers(constants.resultTypes.formProjects, req, next));
}
647138
function getActionComponentConfig(entityName) {
            var components = {};

            u.each(
                ['List', 'Form', 'Success', 'Read', 'Detail'],
                function (type) {
                    var action = entityName + type;
                    var model = action + 'Model';
                    var view = action + 'View';

                    components[action] = {
                        module: entityName + '/' + type,
                        args: [entityName],
                        auto: true,
                        properties: {
                            model: {$ref: model},
                            view: {$ref: view}
                        }
                    };

                    var modelPropperties = {
                        data: {$ref: entityName + 'Data'}
                    };

                    if (type === 'Form') {
                        modelPropperties.validator = {$ref: entityName + 'EntityValidator'};
                    }

                    components[model] = {
                        module: entityName + '/' + type + 'Model',
                        auto: true,
                        properties: modelPropperties
                    };

                    components[view] = {
                        module: entityName + '/' + type + 'View',
                        auto: true
                    };
                }
            );

            return components;
        }
305164
def config_field_type(field, cls):
    
    return defs.ConfigField(lambda _: isinstance(_, cls),
                            lambda: CONFIG_FIELD_TYPE_ERROR.format(field, cls.__name__))
632653
def get_form_class(self):
        
        if self.object.link_type == Link.LINK_TYPE_EMAIL:
            return EmailLinkForm
        elif self.object.link_type == Link.LINK_TYPE_EXTERNAL:
            return ExternalLinkForm

        return None
1019954
def _get_config(self, rel_path, view, api_version=1):
    
    self._require_min_api_version(api_version)
    params = view and dict(view=view) or None
    resp = self._get_resource_root().get(self._path() + '/' + rel_path,
        params=params)
    return json_to_config(resp, view == 'full')
997044
def get_form(self, request, obj=None, **kwargs):
        """"""

        template = get_template_from_request(request, obj)

        #model = create_page_model(get_placeholders(template))

        form = make_form(self.model, get_placeholders(template))

        # bound the form
        language = get_language_from_request(request)
        form.base_fields['language'].initial = language
        if obj:
            initial_slug = obj.slug(language=language, fallback=False)
            initial_title = obj.title(language=language, fallback=False)
            form.base_fields['slug'].initial = initial_slug
            form.base_fields['title'].initial = initial_title

        template = get_template_from_request(request, obj)
        page_templates = settings.get_page_templates()
        template_choices = list(page_templates)
        # is default template is not in the list add it
        if not [tpl for tpl in template_choices if tpl[0] == settings.PAGE_DEFAULT_TEMPLATE]:
            template_choices.insert(0, (settings.PAGE_DEFAULT_TEMPLATE,
                    _('Default template')))
        form.base_fields['template'].choices = template_choices
        form.base_fields['template'].initial = force_text(template)

        for placeholder in get_placeholders(template):
            ctype = placeholder.ctype
            if obj:
                initial = placeholder.get_content(obj, language, lang_fallback=False)
            else:
                initial = None
            form.base_fields[ctype] = placeholder.get_field(obj,
                language, initial=initial)

        return form
598166
def getConfigRoot(cls, create = False):
        
        try:
            return manager.gettree(getattr(cls, 'configkey'), create)
        except AttributeError:
            return None
1310521
function mode() {
      var value = (attr.mdMode || "").trim();
      if (value) {
        switch (value) {
          case MODE_DETERMINATE:
          case MODE_INDETERMINATE:
          case MODE_BUFFER:
          case MODE_QUERY:
            break;
          default:
            value = MODE_INDETERMINATE;
            break;
        }
      }
      return value;
    }
1137066
function getConfig(directors) {
  const data = {};
  return getBackendConfig(directors).then((config) => {
    data.backendConfig = config;
    return getInitConfig(directors);
  }).then((config) => {
    data.initConfig = config;
    data.selectConfig = getBackendSelectConfig(directors);
    return data;
  });
}
109387
protected function evalManageMode()
    {
        if ($mode = post(self::PARAM_MODE)) {
            return $mode;
        }

        if ($this->forceManageMode) {
            return $this->forceManageMode;
        }

        switch ($this->eventTarget) {
            case 'button-create':
            case 'button-update':
                return 'form';

            case 'button-link':
                return 'list';
        }

        switch ($this->relationType) {
            case 'belongsTo':
                return 'list';

            case 'morphToMany':
            case 'morphedByMany':
            case 'belongsToMany':
                if (isset($this->config->pivot)) {
                    return 'pivot';
                }
                elseif ($this->eventTarget == 'list') {
                    return 'form';
                }
                else {
                    return 'list';
                }

            case 'hasOne':
            case 'morphOne':
            case 'hasMany':
            case 'morphMany':
                if ($this->eventTarget == 'button-add') {
                    return 'list';
                }

                return 'form';
        }
    }
1015139
String getDefaultView(String typeName) {

        String result = m_defaultViewRules.getViewForType(typeName);
        if (result == null) {
            result = "view_other";
            try {
                if (OpenCms.getResourceManager().hasResourceType(typeName)
                    && OpenCms.getResourceManager().getResourceType(typeName).isFolder()) {
                    result = "view_folders";
                }
            } catch (CmsLoaderException e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
        }
        return result;
    }
669168
private Form createForm() {
    Form form = Form.of();
    // assign groups from this category
    List<Group> groups = categoryModel.getGroups();
    // if there are no groups, initialize them anyways as a list
    if (groups == null) {
      groups = new ArrayList<>();
    }

    // get groups of this form
    List<com.dlsc.formsfx.model.structure.Group> formGroups = form.getGroups();

    // create PreferenceGroups from Groups
    for (int i = 0; i < groups.size(); i++) {
      PreferencesFxGroup preferencesGroup =
          (PreferencesFxGroup) PreferencesFxGroup.of().title(groups.get(i).getDescription());
      groups.get(i).setPreferencesGroup(preferencesGroup);
      formGroups.add(preferencesGroup);
      // fill groups with settings (as FormsFX fields)
      for (Setting setting : groups.get(i).getSettings()) {
        formGroups.get(i).getElements().add(setting.getField());
      }
    }

    // ensures instant persistance of value changes
    form.binding(BindingMode.CONTINUOUS);
    return form;
  }
262706
def config_mode(self, config_command="configure", pattern=r"[edit]"):
        """"""
        return super(VyOSSSH, self).config_mode(
            config_command=config_command, pattern=pattern
        )
1069255
def get_default_config(self):
        
        config = super(DRBDCollector, self).get_default_config()
        config.update({
            'path': 'drbd'
        })
        return config
1338072
def configure(self):
        # type: () -> None
        
        for i in vars(self):
            if i.startswith("_"):
                continue
            val = self.__get(i, return_type=type(getattr(self, i)))
            if val is not None:
                setattr(self, i, val)