the 2007 aidmatrix summer institute humanitarian free and ...€¦ · the 2007 aidmatrix summer...
Post on 27-May-2020
1 Views
Preview:
TRANSCRIPT
The 2007 Aidmatrix Summer Institute in
Humanitarian Free and Open Source Software
Antonio Alcorn, Giovanni Capalbo, Sylvia Hristakeva, Kumud Nepal, Ernel Wint
Ralph Morelli, Trishan de Lanerolle
Slide: 2 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
• Background
• Goals
• Work Environment
• Sahana Project
• Interface/Functional Changes
• Re-factoring Design Changes
• OpenMRS Project
• MVC Architecture
• Touchscreen Demo
• The Touchscreen Package
• Student Experiences
• Looking Ahead
Outline
From left to right, Trishan de Lanerolle, Giovanni Capalbo, Antonio Alcorn, KumudNepal, Ernel Wint, Sylvia Hristakeva, Ralph Morelli. (Missing: Prof. Heidi Ellis)
Slide: 3 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
• The 2007 Aidmatrix Summer H-FOSS Institute
• H-FOSS = Humanitarian Free and Open Source Software
•The 2007 H-FOSS Team
• Sahana (Sri Lanka)
• Disaster Management System
• LAMP (Linux + Apache + MySQL + PHP) Platform
• Trinity’s Contribution: Volunteer Management (VM) Module
• OpenMRS (Rwanda)
• Paul Farmer, Partners in Health
• Trinity Connection, Christian Allen, ‘00
• Open source Medical Record System
• Java (MySQL, Ajax, JSP, Spring, Hibernate, XML)
Background
Slide: 4 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
• Build Free and Open Source Software
• Learn about and contribute to the open source movement
• Apply CS and IT skills to benefit society
• Explore different ways of learning computer science
• Attract students to the study of computer science
• Summer 2007 Objectives
• Redesign and Re-factor the Sahana VM Module
• Incorporate unit testing and other software engineering principles
• Learn about the OpenMRS system
Goals and Objectives
Slide: 5 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Work Environment
• Used a integrated set of open source applications•Eclipse:
• Java-based, extensible open source development platform (IDE)
• used for both Java/J2EE and PHP projects•Mediawiki:
• Collaborative website, directly editable by its users (Trinity H-FOSS)
•Subversion: • source code revision control system ( websvn )
•Trac:(Volunteer Management Trac site)• an enhanced wiki and issue tracking system for software development projects with subversion integration.
Volunteer Management Module
Slide: 7 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Sahana Overview
• Open source disaster management system
• Web-based portal with sub-applications
• Implemented in Sri Lanka, Pakistan, Philippines, Indonesia
• PHP-based
• http://www.sahana.lk
Access Control
Slide: 9 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Access Control - Sahana
• Store:• Give DB tables classification levels• Assign role(s) to users
• Access Controlling Mechanism:• Roles access data based on classification level
• Problems:• Sahana ACL too restrictive for VM• Unable to restrict access control to single module
Slide: 10 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Access Control – VM Module
• Store:• Requests
• Pages in the system• Defined by URL parameters (act, vm_action)
• Constraints • VM - Requirements, Overrides• Sahana - Classification Constraints
• Link constraints to a request
• Access Controlling Mechanism :• Check all constraints imposed on given request• AccessController class• Each Controller calls AccessController::isAuthorized()
Positions and Credentials
Slide: 12 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Positions and Credentialing
• Expert consultant: Prof. Frank Fiedrich, GW Institute for Crisis, Disaster and Risk Management • Re-factored VM module: Volunteers assigned to positions, within projects• Site managers create positions for their project(physician, sandbag mover, grief counsellor)•Volunteers associated with one or more positions• Benefits:
• Site managers have finer control over volunteer assignments• Initial foundation for advanced credentialing system
• Credentialing (future): validating professional qualifications
Project
positions
volunteers
Reporting, Messaging
Slide: 14 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Reporting Feature
•Available to Main Operations Handler and Site Manager•Extensive listing of all the volunteers
•Affiliation•Number of hours worked•Monetary value•Position Held
•Custom Reporting•Filtering by project, organization, or both•Reporting for specific volunteers
•A little information-breakdown-bubble with all the information•Printer Friendly Version Available
Slide: 15 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Messaging
• Database Setup:• vm_message - store text of messages, timestamp• vm_courier - store who messages are sent to/from• vm_mailbox - store a volunteer’s messages to
prevent loss of message records
• Upgrades:• Can send message to more than one person• Can delete messages without losing message and to/from
information
Time Loggingand Searching
Slide: 17 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Time Logging
• Volunteers are organized by position within a project
• Volunteers submit hours for Project Manager approval
• Volunteers can enter hours or shifts for a Position in a Project
Slide: 18 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Searching
• Search By:• ID• Name • Location• Skills• Availability
• Name search uses soundex() and metaphone()
Volunteer Management Module:
Under the Hood
MVC Architecture, Template Engine, Database Schema
Slide: 21 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
The MVC Architecture
Model• The Model represents application logic (often called the business layer in enterprise applications).
Controller
•The controller is basically the first point of call for any incoming HTTP requests in a web application.
View
• “Views” are basically the end result which we send to a web browser - the HTML generated by our script.
Slide: 22 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
MVC Sahana Design
The Model-View-Controller is very use full method of organizing an application in facilitating updates to the three main parts of any application (model, view, and controller).
Slide: 23 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Code Example
function _shn_vm_del_vol(){
global $global;$db=$global['db'];$pid=$_POST{"pid"};$q="select full_name from person_uuid where p_uuid=$pid";$res=$db->Execute($q); $name=$res->fields[0];$q="update person_status set isReliefWorker=0 where p_uuid=$pid";$res=$db->Execute($q);?> <div id="result_msg"> <?php echo $name?> Volunteer was succesfully Deleted </div><br /><h2> Volunteer Registry</h2> <?php _shn_vm_viewform_allvol();
}
case 'process_delete':$v = new Volunteer(); $v->delete($getvars['p_uuid']);View::View(); $this->displayConfirmation('The requested user was deleted.'); $extra_opts = array (
'showPictures' => true, 'showAvailability' => true, 'showLocation' => true, 'showStatus' => true, 'showAffiliation' => true
); $this->listVolunteers($dao->getVolunteers(), $extra_opts);
break;
KeyModelControllerView
Old VM Code
Re-factored Code
Slide: 24 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Template Engine
View
Template files
Template engine
Cached PHP scripts
data
• Big MVC goal: separate business logic from presentation logic• Template engine: stores presentation logic in templates• “Whiz”, our own lightweight caching template engine• Template files: HTML mixed with specialized presentation logic
{if [condition]} ... {/if}{$someVariable} [echoes variable passed from view]loops
• View passes data to template engine• Template engine translates presentation logic language into PHP code and caches resulting script• example:
becomes
• Improves maintainability and extendibility of interface.
<?php if($numThings > 0) {?>There are <?php echo($numThings); ?> things.
<?php } ?>
{if $numThings > 0}There are {$numThings} things.
{/if}
Slide: 25 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Database Schema
Unit testing
Slide: 27 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Unit Testing
•Unit Tests done using PhpUnit•Tests written for:
•Data access object file, •Project and the volunteer controllers
•Test Outputs generated in a separate file
function getIdTypes() //{
// get the ID codes and names from the 'field_options' table$result = $this->execute("select option_code, option_description from field_options where field_name = 'opt_id_type'");$id_types = array();while(!$result->EOF){
$id_types[$result->fields['option_code']]= $result->fields['option_description'];$result->moveNext();
}return $id_types;
}
public function testGetIdTypes(){$result = $this->fixture->getIdTypes();$expected = array('nic'=>'National Identity Card', 'pas'=>'Passport', 'dln'=>'Driving License Number', 'oth'=>'Other');$this->assertEquals($result, $expected);}
Unit Test Function:
Original Function:
Touchscreen Project
Slide: 29 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
OpenMRS Overview
• Open source medical record system
• Allows design of a customized medical record system
• Implemented in South Africa, Kenya, Rwanda, Lesotho,
Uganda, and Tanzania
• Java-based
• http://www.openmrs.org
Slide: 30 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
MVC- Architecture(OpenMRS)
• Touch Screen Monitor is a user interface device where the VIEW aspect is central.
• Touch Screen Interface does not use the Controller or Model just extends the view.• OpenMrs uses Spring MVC Java/J2EE application framework• Unlike Volunteer Management Module were we developed our own MVC framework.
Slide: 31 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Touchscreen Package
• Javascript, CSS
• Features:
• On-screen movable keyboard
• Navigation bar
• Scroll buttons
• Enlarges inputs
• Fires events on inputs
• Cross-browser capabilities
• Will transform any HTML document into a usable
touchscreen interface
Slide: 32 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
• Touchscreen interface loads through javascript:
• touchscreenToolkit.js
• touchscreenToolkit.css
• openmrsAux.js
• openmrsAux.css
• Interface only shows if module is loaded
Touchscreen Module
Slide: 33 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Touchscreen Toolkit Extends View
View
TouchscreenInterface
<openmrs:extensionPoint pointId="org.openmrs.touchscreenExt" type="html">...</openmrs:extensionPoint>
Model
Controller
Slide: 34 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Student Experiences
• Different levels of experience, in different areas • New concepts learned:
• MVC • Templates • Unit Testing • Version control
• Collaborative work atmosphere • Positive experience
• “changed the way I'll approach future projects”• “gave me a better idea of what I want to do with
computer science in the future”• “real-life experience”• “learning experience for a good cause”
Slide: 35 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
• NSF CPATH Grant ($496,000, two-years)• Can H-FOSS Help Revitalize Undergraduate Computing Education?• Trinity, Wesleyan and Connecticut College• Community building: Academia, IT Corporations, Humanitarian Orgs.
• 2007-2008 Activities• Fall Independent Study: Develop a workshop • Outreach: SIGCSE Workshop, recruit other schools• Spring: Video conference course• Summer 2008: Summer Institute (10 students), local projects
Looking Ahead
Slide: 36 Trinity Humanitarian-FOSS Project © 2007 Hartford, CT 30-Jul-07
Community Building
top related