Adds to an existing bunsen model with schemas defined in the view

@param {BunsenModel} model Model to expand
@param {BunsenView} view View containing additional schema
@returns {BunsenModel} Expanded version of the model
4660
function expandModel (model, view) {
  const modelPath = new BunsenModelPath(model)
  const modelExpansions = aggregateModels(view, modelPath)
  let newModel = model
  _.forEach(modelExpansions, (propertyModel, path) => {
    newModel = addBunsenModelProperty(newModel, propertyModel, path)
  })
  return newModel
}
819494
function initViews (args) {
    // create views register for model indexed by view name - these names
    // are not required to be the same as global view names
    this.views = {}
    // validate each defined view, get view model if needed
    _.each(args.views, (spec, name) => {
        // get list of model views
        var views = Array.isArray(spec) ? spec : [spec]
        // validate that all model views can be loaded
        _.each(views, view => requireValidModelView(view, args.views, true))
        // add to views
        this.views[name] = views
    })
}
965240
function getViewsOf(model) {
        return getRefsTo(model, function (ref) {
            return (ref instanceof Core.View) && (ref.model === model);
        });
    }
1077740
function ViewModel(view, data, key, opts) {
	var vm = this;

	vm.view = view;
	vm.data = data;
	vm.key = key;

	if (opts) {
		vm.opts = opts;
		vm.cfg(opts);
	}

	var out = isPlainObj(view) ? view : view.call(vm, vm, data, key, opts);

	if (isFunc(out))
		{ vm.render = out; }
	else {
		vm.render = out.render;
		vm.cfg(out);
	}

	vm.init && vm.init.call(vm, vm, vm.data, vm.key, opts);
}
570484
function insert(model) {
      model = this.records.add(model, { merge: true });
      return Promise.resolve(model);
    }
798016
protected void putIntoModel(final Map<String, Object> model, final String key, final Object value) {
        LOGGER.trace("Adding attribute [{}] into the view model for [{}] with value [{}]", key, getClass().getSimpleName(), value);
        model.put(key, value);
    }
1276501
function (model) {
            if (!this.ngModel) {
                return;
            }
            var index = this.selected.indexOf(model);
            if (index !== -1) {
                this.selected.splice(index, 1);
                if (this.multiple) {
                    this.ngModel.$setViewValue(this.selected);
                } else {
                    this.ngModel.$setViewValue(undefined);
                }
            }

        }
1300605
function Context(view, parentContext) {
  this.view = view || {};
  this.cache = {
    '.': this.view
  };
  this.parent = parentContext;

  // If parent context isn't passed, but the model has parents, build the chain
  this.initialize(view, parentContext);
  if (this.isModel(view)) {
    this.lastModel = view;
  } else if (parentContext) {
    this.lastModel = parentContext.lastModel;
  }
}
91058
function normalizeView (bunsenView) {
  if (bunsenView.cellDefinitions) {
    const cellDefinitions = normalizeModelProperty(bunsenView.cellDefinitions)

    if (cellDefinitions !== bunsenView.cellDefinitions) {
      bunsenView = Object.assign({}, bunsenView, {cellDefinitions})
    }
  }

  if (bunsenView.cells) {
    const cells = normalizeModelProperty(bunsenView.cells)

    if (cells !== bunsenView.cells) {
      bunsenView = Object.assign({}, bunsenView, {cells})
    }
  }

  return bunsenView
}
39309
function UMLCollaborationView() {
        UMLGeneralNodeView.apply(this, arguments);

        /** @member {UMLTemplateParameterCompartmentView} */
        this.templateParameterCompartment = new UMLTemplateParameterCompartmentView();
        this.templateParameterCompartment.selectable = Core.SK_PROPAGATE;
        this.templateParameterCompartment.parentStyle = true;
        this.addSubView(this.templateParameterCompartment);

        this.fillColor = PreferenceManager.get("uml.collaboration.fillColor", "#ffffff") || PreferenceManager.get("view.fillColor", "#ffffff");
    }
1160806
function(view, childView, options) {
        var buffer = view.buffer;
        var _childViews = view._childViews;

        childView = view.createChildView(childView, options);
        if (!_childViews.length) { _childViews = view._childViews = _childViews.slice(); }
        _childViews.push(childView);

        if (!childView._morph) {
          buffer.pushChildView(childView);
        }

        view.propertyDidChange('childViews');

        return childView;
      }
931914
function addProperty (model, key, field_definition) {
	var property = {
		get : function() {
			return this['_' + key];
		},
		set : function(value) {
			this._updated_fields[key] = value;
			// should we track old values here and revert them on save error?
			this['_' + key] = value;
		}
	};

	if (field_definition.get) {
		property.get = field_definition.get;
	}

	if (field_definition.set) {
		property.set = function (value) {
			field_definition.set.call(this, value);
			this._updated_fields[key] = this['_' + key];
		};
	}			

	Object.defineProperty(model.prototype, key, property);
}
498335
function extend(schema) {
	var schemas, extendedSchema;

	if (schema.extends) {
		schemas = [{}, schema].concat(schema.extends);
		extendedSchema = _.defaultsDeep.apply(null, schemas);
		extendedSchema = _.omit(extendedSchema, ['extends']);
		return extendedSchema;
	}
	return schema;
}
1008681
function (state, action) {
    const newState = {
      lastAction: CHANGE_MODEL
    }

    // Replace $ref's with definitions so consumers don't have to parse references
    newState.unnormalizedModel = getDereferencedModelSchema(action.model)

    // If we have an unnormalized view then we need to update our model to make
    // sure any model extensions defined in the view get applied
    if (state.unnormalizedView) {
      const normalized = normalizeModelAndView({
        model: newState.unnormalizedModel,
        view: state.unnormalizedView
      })
      newState.baseModel = normalized.model
      newState.baseView = normalized.view
      newState.view = evaluateViewConditions(newState.baseView, state.value)
    } else {
      newState.baseModel = newState.unnormalizedModel
    }

    // Evaluate and remove model conditions so consumers don't have to parse conditions
    newState.model = evaluateConditions(newState.baseModel, state.value, undefined, state.value)

    return _.defaults(newState, state)
  }
533215
def add_view(self, view):
        

        self.add_child(view)
        self.views.append(view)
128836
function addFiltersToModel(model, appName) {
    var rootDir = this.pancakes.getRootDir();
    var apps = ['common', appName];
    var me = this;

    // if filters don't exist in memory yet for given app, get them
    if (!filters[appName]) {
        filters[appName] = {};
        _.each(apps, function (app) {
            var filtersDir = rootDir + '/app/' + app + '/filters';
            var exists = utils.doesFileExist(filtersDir);

            if (exists) {
                _.each(fs.readdirSync(filtersDir), function (fileName) {
                    var filterName = me.pancakes.utils.getCamelCase(fileName);
                    filters[appName][filterName] = me.pancakes.cook('app/' + app + '/filters/' + fileName, null);
                });
            }
        });
    }

    _.extend(model, filters[appName]);
}
415642
function UMLComponentRealizationView() {
        UMLGeneralEdgeView.apply(this, arguments);
        this.tailEndStyle = Core.ES_FLAT;
        this.headEndStyle = Core.ES_TRIANGLE;
        this.lineMode = Core.LM_DOT;
    }