Items in yellow indicate areas requiring further discussion/testing. POC = Proof of Concept
AOI Uploader to be launched by a button on the BAGIS Tools toolbar
User indicates the AOI they wish to upload; See figure 1 for sample GUI. Check to see if the AOI already exists. (Can user upload > 1 AOI at a time?; Need list of Types and how they correspond to FGDB folders)
If AOI already exists, prompt user to use the update function
If new AOI:
Check to make sure all required layers are present (Need list)
Show list of optional layers which ones should be uploaded (Need UI design for Add-In)
Are the layers converted to .img and .shp by the Add-In before they are sent to repository? If so, which tool does Jarrett use to do the opposite on the sending side?
Zip the files into a single large zip file and send to repository (Need POC on uploading an AOI zip)
Repository pushes a copy of the repository metadata to the local AOI?
If existing AOI with repository metadata file:
Show list of optional layers that have changed since the AOI was downloaded (Need UI design for Add-in). This list includes:
New layers that exist in the AOI but are not listed in the repository metadata file
Deleted layers that are missing from the AOI but were listed in the metadata
Feature classes whose date modified <> the date modified listed in the repository metadata file
Raster datasets with no BAGIS metadata tags in their XML. We assume rasters won't be modified, only overwritten
User confirms list of optional layers to be uploaded. (Same questions as 3.3 and 3.4)
Confirm to user that AOI has been successfully uploaded (Should we push a new copy of the updated repository metadata to the local AOI?)
Figure 1: Proposed add-in screen for uploading an AOI
POST the a multipart html form to https://webservices.geog.pdx.edu/api/rest/aois
The following elements are required in addition to the file:
The security token (in the header)
The filename; This will also be the name of the aoi in the database; Note that duplicates are not allowed and the request will error if the filename exists in the database
The MD5 hash value for the file in a field called md5
The rest service returns a JSON response with "task" property. The "task" property includes a status field containing the status of the upload. Valid values are "PENDING", "SUCCESS", and "FAILED". While the upload is processing, the status will be PENDING.
The JSON response also has a "url" field. Sending a GET request to this url results in a JSON response identical in structure to the one sent from the original upload POST. The task property of this response includes the current upload status
Iteratively send this GET request until the status of the upload is either SUCCESS or FAILED and respond accordingly
Connect to the server, currently basins.pdx.edu
Access the Windows Task Scheduler and look for celery tasks. For example: ebagis_test celery
If the task is not running, right-click on it and select Run
If you need to stop the celery task, stop it first in the Windows Task Scheduler and then use the Windows Task Manager to end the celery.exe process.