# File app/controllers/metarep_controller.rb, line 442
  def edit
    @object_type = session[:contextobject]
    @dw_object_id = session[:contextid]
    if request.get?
      session[:field] = @field = params[:field]    
      @human_field = @field
      @human_field = "purpose" if @field == "purpose_txt"
      @human_field = "source" if @field == "source_nm"
      @human_field = "selection criteria" if @field == "selctn_criteria_txt"
      @human_field = "author" if @field == "author_nm"
      @human_field = "business owner" if @field == "bus_owner_nm"
      @human_field = "url" if @field == "report_url"
      @human_field = "sample data" if @field == "sample_data_txt"
      @human_field = "sponsor" if @field == "report_spnsr_nm"
      @human_field = "description" if @field == "dsc_txt"
      case @object_type
      when 'Database'
        @object_name = Database.find(@dw_object_id).database_nm
        @DwObject = Database.find(@dw_object_id)
      when 'Schema'
        @object_name = Schema.find(@dw_object_id).schema_nm
        @DwObject = Schema.find(@dw_object_id)
      when 'Report'
        @object_name = Report.find(@dw_object_id).report_nm
        @DwObject = Report.find(@dw_object_id)
      when 'Table'
        @object_name = Table.find(@dw_object_id).table_nm
        @DwObject = Table.find(@dw_object_id)
      when 'Column'
        @object_name = Column.find(@dw_object_id).column_nm
        @DwObject = Column.find(@dw_object_id)
      end
      render :layout => 'simple'
    else
      @field = session[:field]
      @new_value = params[:post][:new_value]
      case @object_type
      when 'Database'
        redirect_to :action => 'update_database_description', :value => @new_value, :id => @dw_object_id
      when 'Schema'
        redirect_to :action => 'update_schema_title', :value => @new_value, :id => @dw_object_id if @field == 'schema_title'
        redirect_to :action => 'update_schema_description', :value => @new_value, :id => @dw_object_id if @field == 'schema_desc'
      when 'Table'
        redirect_to :action => 'update_table_description', :value => @new_value, :id => @dw_object_id
      when 'Column'
        redirect_to :action => 'update_column_sample_data_txt', :value => @new_value, :id => @dw_object_id if @field == 'sample_data_txt'
        redirect_to :action => 'update_column_description', :value => @new_value, :id => @dw_object_id if @field == 'column_desc'
      when 'Report'
        redirect_to :action => 'update_report', :value => @new_value, :field => @field, :id => @dw_object_id
      end
    end
  end