Skip to content
Raman Prasad edited this page Jan 27, 2017 · 5 revisions

This has changed considerably since 12/2016


Code locations for tabular workflow views/templates. These could do with some refactoring, etc.

Workflow, 1st Time File, No Map exists

  1. view: view_mapit_incoming_token64
  • file: gis_shapefiles/views_mapit.py
  1. redirect function: process_tabular_file_info
  • file: gis_shapefiles/views_mapit.py
  1. view: view_tabular_file(tab_md5)
  • file: gis_tabular/views.py
  • Note: Will check if geoconnect or WorldMap already has this map

Templates

  1. main template: gis_tabular/view_tabular_overview.html
  • expected values:
    • tabular_info
    • geocode_types
    • form_lat_lng (always)
    • form_single_column (optional)
  1. sub template: gis_tabular/preview_rows.html
  • expected values:
    • tabular_info
    • NUM_PREVIEW_ROWS
    • tab_file_stats

Workflow, 1st Time File, Attempt to Create Join

  1. ajax view: view_map_tabular_file_form
  • file: gis_tabular/views_create_layer.py

Successful join: Create view with Map and Classify Form

  • view: build_tabular_map_html(WorldMapTabularLayerInfo)
  • file: gis_tabular.views.py
  • main template: gis_tabular/view_tabular_map_div.html
    • expected values (directly in template):
      1. layer_data
      2. worldmap_layerinfo
      3. download_links

All expected values in template and sub-templates:

  1. worldmap_layerinfo (WorldMapJoinLayerInfo or WorldMapLatLngInfo ) 1. tabular_info (worldmap_layerinfo.tabular_info) 1. core_data (worldmap_layerinfo.core_data) 1. download_links (worldmap_layerinfo.download_links) 1. attribute_data (worldmap_layerinfo.attribute_data)
  2. is_tabular_delete (set in view)
  3. delete_form (set in view)
  4. classify_form (set in view)
  5. ATTRIBUTE_VALUE_DELIMITER (set in view)
  6. success_msg or error_msg

Templates

  1. gis_tabular/map_result_message.html - expected values:
    1. worldmap_layerinfo - For a Join Layer:
    • Reads sub-template: gis_tabular/map_message_join.html
    • Expected values:
      1. core_data (worldmap_layerinfo.core_data) - For a Lat/Lng layer:
    • Reads sub-template: gis_tabular/map_message_lat_lng.html
    • Expected values:
      1. core_data (worldmap_layerinfo.core_data)
  2. gis_shapefiles/modal_delete_confirm.html - expected values:
    1. is_tabular_delete
    2. delete_form
  3. gis_shapefiles/modal_save_confirm.html - expected values:
    1. tabular_info
  4. classification/view_classify_form.html - expected values:
    1. classify_form
    2. success_msg or error_msg
  5. classification/classify_form_dynamic_js.html - expected values:
    1. worldmap_layerinfo
    2. worldmap_layerinfo.get_legend_img_url
    3. classify_form
    4. classify_form.get_classify_non_string_choices
    5. classify_form.get_classify_choices
    6. classify_form.get_classify_string_choices
    7. ATTRIBUTE_VALUE_DELIMITER
  6. gis_shapefiles/delete_and_back_to_dv_links.html - gis_shapefiles/link-back-to-dataverse.html
    • expected values:
      1. tabular_info
      2. tabular_info.return_to_dataverse_url
  7. gis_tabular/map_attributes_list.html (debug) - expected values:
    1. attribute_data (worldmap_layerinfo.attribute_data)
    2. core_data (worldmap_layerinfo.core_data)
  8. gis_tabular/core_data_list.html (debug) - expected values:
    1. core_data (worldmap_layerinfo.core_data)

Workflow, Classify a Tabular File

  • ajax view: view_classify_layer_form

  • file: classification/views.py

  • The request fails form ValidationError message contents (JSON): { "success": false "msg": User message "data.div_content": Form with error messages }

    • "div_content" in AJAX message is used for "#div_classify_form"
  • The request succeeds: { "success": true "msg": User message "data.div_content": See note below }

    • Note: template for div_content: classification/view_classify_form.html
      • expected values:
        1. classify_form
        2. success_msg or error_msg