School Accreditation Photo Handling

Issue #690 resolved
Ghislain Hachey created an issue

Load photos from school accreditation in their respective school Documents.

  • Category (add a new one called School Accreditation and set the photo to that)
  • Description (is set to the description of the sub-criteria in which the photo came from)
  • Source (is set to “School Inspection #: xxxx”)

I think this will be sufficient for how we first handle photos.

Comments (2)

  1. Brian Lewis repo owner

    Current status is that we have ImageProcessor interceptors for google images, and file db images.

    these are invoked by the endpoints

    google/<fileID>

    library/<fileDbId>

    We stilll need to be able to retrieve the image from the google cloud, until it is relocated to the FileDb.

    On saving an inspection:

    all photo remotePaths are extracted, and the Document records are added with those values in new field docCloudId. However, the files themselves are not downloaded. Rather, the document records are placeholders which will be filled when the photo is requested (ie by bringing the file local and saving it into the fileDB)

    The photo can be requested in 2 distinct situations:

    School Documents list (aka Gallery) - here we have the docID for the file from the documents table.

    From a SchoolAccreditation or Wash Xml file. Here we have the google Id of the file.

    School gallery continues to call library/<docID> to display the image.

    Handler then does the following:

    if the file with <docID> is not present in the fileDB:

    go to google drive and get the file, save it into the fileDB, then return it. FRom then on, it is always present in the fileDB

    When displaying from a survey (where we have the cloud file Id), calls for images go to

    google/<fileId>

    This handler does the following:

    – check in the Documents store if there is already a record referencing the fileId in the docCloudID field.

    If there is a document record for this fileID - check if the file exists in the fileDB.

    If the file is there, just return it from the fileDB.

    If the file is not there, go to the google drive, get the file and save it into the fileDB under the guid already allocated to this file. Return it from there.

    Hence forth that google drive file will always be picked up from the local fileDB.

  2. Log in to comment