Skip to content

Commit

Permalink
Merge branch 'develop' of github-as-indera:ctsit/redi-dropper-client …
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
asura-asp committed Jan 21, 2016
2 parents f32610d + 0df598f commit 3592da5
Show file tree
Hide file tree
Showing 10 changed files with 672 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@


## [0.0.3a] - 2015-08-27

### Added
* Add sample config files for deploying two application instances
Paths ==> `/alz` and `/onefl` (Andrei Sura)
Expand Down
4 changes: 3 additions & 1 deletion app/deploy/fabfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,9 @@ def restart_wsgi_app():
def check_app():
"""cURL the target server to check if the app is up"""
require('environment', provided_by=[production, staging])
local('curl -sk https://%(project_url)s | grep "Version " ' % env)
local('curl -sk https://%(project_url)s | grep "Version " '
' | grep -oE "[0-9.]{1,2}[0-9.]{1,2}[0-9a-z.]{1,4}" | head -1 ' % env)



def print_project_repo():
Expand Down
2 changes: 2 additions & 0 deletions app/redidropper/models/user_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def is_active(self):

def is_expired(self):
""" An user can be blocked by setting expiration date to yesterday"""
if self.access_expires_at is None:
return False
return self.access_expires_at < datetime.today()

def is_anonymous(self):
Expand Down
31 changes: 31 additions & 0 deletions app/redidropper/static/css/parallax.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,34 @@ This stylesheet and the associated (x)html may be modified in any way to fit you
#support button {
color: #FFFFFF;
}

/*So that all content and icon is visible on smaller screens*/
@media all and (max-width: 1000px) {
#home {
height: 600px;
}
#about {
height: 600px;
}
#information {
height: 600px;
}
#services {
height: 600px;
}
#gettingstarted {
height: 600px;
}
#faq {
height: 600px;
}
#support {
height: 600px;
}
#image2 {
height: 600px;
}
#image3 {
height: 600px;
}
}
4 changes: 2 additions & 2 deletions app/redidropper/static/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ $(document).ready(function() {
$("#wrapper").toggleClass("toggled");
var icon = $(this).parent().find(".fa")
if (icon.hasClass('fa-angle-left'))
icon.removeClass('fa-angle-left').addClass("fa-angle-right");
icon.removeClass('fa-angle-left').addClass("fa-bars");
else
icon.removeClass('fa-angle-right').addClass("fa-angle-left");
icon.removeClass('fa-bars').addClass("fa-angle-left");
});
});
52 changes: 52 additions & 0 deletions docs/functional_specs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Functional Specification for the REDI-Dropper Application

## Authors

* Andrei Sura <asura@ufl.edu>
* Kevin Hanson <kshanson@ufl.edu>
* Philip Chase <pbc@ufl.edu>
* Christopher P. Barnes <cpb@ufl.edu>

## Overview

The RED-I Dropper application is a tool where by dynamic data is transferred
from multiple locations via a modern JavaScript framerwork over encrypted
channel to storage services for further processing. The application can be
customized to place datasets into processing environments that provide analysis
and quanitified data to aggregation points.


## Workflow and Use Cases

### Ella gets a MRI scan uploaded with RED-I Dropper for analysis.

Ella is a woman of latin heritage living in Miami, FL. She is a widow living
with her son-in-law and Daughter. She has undergone a neurocognitive assessment
with Dr. Miami and now she has been referred to the brain imaging specialists
at WeCare Hospital to have an MRI brain image performed. A technician conducts
the MRI image collection process. At the conclusion of which consortium staff
acquire the images and visit a website that is able to handle image uploads
potentially 3gb in size per study participant encounter. When the consortium
staff visits the website they utilize a Shibboleth account to
authenticate securely to the RED-I Dropper website. Once logged on, the
consortium staff see a question asking them which subject goes with the MRI
scan. They see a list that shows the study participant’s ID.

Once the consortium staff verifies that the subject that was scanned is the
same as the one in the list they select the study participant. The staff is
prompted with a <b>file picker</b> where they are able to <b>select
all images</b> obtained from the MRI process at once and set them to upload.
Prior to an image upload the RED-I Dropper program <b>checks to see if a folder
exists</b> on the server for the subjectID and if it doesn't exist
then the <b>folder is created</b> the moment a file is uploaded. As the image
begins to upload, a <b>progress bar</b> displays for the upload process and once
completed they see a message saying “MRI scans for Ella have been uploaded,
thank you!”
The RED-I Dropper server then <b>prefixes the file names</b> with a <b>unique
identifier</b> in the format
“YYYYMMDD_HHMM_SiteID_SubjectID_5digtSequenceNumber” followed by the
<b>original file name</b>.

Example:
original filename: <b>xyz.jpg</b>
stored filename: 20120101_0123_SiteIDA_SubjectIDB_Sequence123_<b>xyz.jpg</b>
497 changes: 497 additions & 0 deletions docs/img/flowchart_diagram_redi_dropper_file_upload_process.ep

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/saml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions docs/technical_specs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

# Work in progress



Technical Specifications for REDIDropper
========================================


## Software Architecture Considerations

1. **use two repositories**

One repository is used for the **client** component and the second one for the **server** component

Advantages:
1. develop the UI separately from the server (different language/framework)
2. force developers to think about the "Not Breaking the Contract" as defined by the supported API functions
3. keep the list of issues related to the UI separate from the Server issues

Disadvantages:
1. can encounter issues with cross-domain requests if the client is deployed on a different server
2. forces deployment of two repositories in order to test the application
3. forces the need to check two repositories during development in order to keep track of changes


2. **use frameworks to allow reusing existing solutions**

Client Candidates:
1. [Angular](https://angularjs.org/)
2. [ReactJS](https://github.com/reactjs/react-tutorial) with [Flux](https://github.com/facebook/flux) [comprehensive-guide](http://tylermcginnis.com/reactjs-tutorial-a-comprehensive-guide-to-building-apps-with-react/)
3. [Knockout](http://knockoutjs.com/)
4. [BackboneJS](http://backbonejs.org/) [blog-posts](https://github.com/jashkenas/backbone/wiki/Tutorials%2C-blog-posts-and-example-sites)

Server Candidates:
1. Python: [Werkzeug](http://werkzeug.pocoo.org/docs/0.9/routing/#), [Flask](http://flask.pocoo.org/docs/0.10/tutorial/), web2py, Tornado, Bottle, CherryPy, Django, Grok, Pylons, Pyjamas, Pyramid
2. NodeJS: [Express](http://expressjs.com/starter/basic-routing.html), EmberJS, SailsJS
3. PHP: CakePHP, Slim, Laravel, Joomla, Symfony
4. Ruby: Sinatra

3. **implement data transfer between the server component and REDCap**

Candidates:
1. [CURL](https://github.com/sburns/advanced-redcap-interfaces/blob/master/slides.md)
2. [Pycap](http://pycap.readthedocs.org/en/latest/)


4. **use a JS library for implementing the large file upload within the browser**

Candidates:
1. [ng-flow](https://github.com/flowjs/ng-flow) ( [PHP server component](https://github.com/flowjs/flow.js/blob/master/samples/Backend%20on%20PHP.md) )
2. [resumable.js](https://github.com/23/resumable.js/blob/master/samples/Backend%20on%20PHP.md)
3. [Real ajax uploader](http://www.albanx.com/programing/ajaxupload/?example=2)


@TODO: read http://stackoverflow.com/questions/2502596/python-http-post-a-large-file-with-streaming


5. understand shibboleth authorization scheme

![saml2-browser-sso-redirect-post](img/saml.png)


6. **choose a server for deployment**

Candidates:
1. [Apache](http://flask.pocoo.org/docs/0.10/deploying/mod_wsgi/)
2. [Nginx](https://www.digitalocean.com/community/tutorials/how-to-deploy-python-wsgi-applications-using-uwsgi-web-server-with-nginx)

[Servers Comparison](https://www.digitalocean.com/community/tutorials/a-comparison-of-web-servers-for-python-based-web-applications)



## Flow Charts

![img/flowchart_diagram_redi_dropper_file_upload_process.png](img/flowchart_diagram_redi_dropper_file_upload_process.png)


## Creating large test files

<pre>
fallocate -l 1G large_file.mri
dd if=/dev/zero of=large_file.mri bs=1G count=1
</pre>

0 comments on commit 3592da5

Please sign in to comment.