Skip to content

dataInPortals

Tim Erickson edited this page Jun 2, 2019 · 2 revisions

Data in Portals

based on blodgett, with special attention to time

The basic idea

We have a MySQL database, blodgett, into which we have poured data we have already munged, having gotten it from the original source.

When the user clicks a "get data" button, the path goes like this:

  • The button click invokes its handler (blodgett.getDataButtonPressed), which...
    • Gets the names of the attributes the user has chosen to import (array tAtts)
    • Gets the data from the database (blodgett.DBConnect.getCasesFromDB( tAtts )), which...
      • Assembles a commands object which contains the attribute names plus information on what times the user wants for the data
      • Sends those commands to the server ('blodgett.php'), which...
        • Converts those commands (which come in as $_REQUEST) to a parameterized MySQL query ($query and $params)
        • Ships that query off to MySQL, which returns an associated array of the results $out
        • This gets encoded as json and returned to the js universe.
      • The returned json gets returned unchanged to the handler
    • The json from the database gets altered into the form needed by CODAP (tCODAPCases); this includes translating the names of the variables from the "database" names to the "screen" names.
    • This new object is sent to blodgett.CODAPconnect.saveCasesToCODAP(tCODAPCases) to be inserted into the CODAP document.
Clone this wiki locally