Friday, June 27, 2014

Ticket Handling System in Freemedia

         Ticket handling system is also plays a major role in Freemedia service. Because it is the method volunteer can get to know about media requests.
Basically ticket is created after user(requester) fill the requesting form. Then it will be added to the ticket list where volunteers can see them. Below it show the how it looks like.

Here ticket ID is generated according to the time it creates. Then the volunteer can decide what ticket he/she could choose in order to fulfill. when click on the ticket ID volunteer will be directed to the page where entire ticket will be shown.

In ticket view we can see there are few information attributes .

  • Summary - A brief description summarizing the request. It has the format below.                                               <first name> from <country> need <requested media>
  • Description - This contains the residential address of the requester.
  • Reporter - Requester's email ID.
  • Status -  What is the current status? One of new, assigned, closed, reopened.
  • Keywords - Keywords that a ticket is marked with. Useful for searching and report generation.
  • Media Version - Version of the media that this ticket pertains to.
  • Cc - A comma-separated list of other users or E-Mail addresses to notify.
  • Assigned  - Principal person (volunteer) responsible for handling the ticket. 
  • Resolution- Reason for why a ticket was closed. One of fixed, invalid, wontfix, duplicate,                                     worksforme.

Below illustrate the ticket life cycle.

Integrating bootstrap

To create ticket view I uses bootstrap which is nice framework for UI design.
We can easily  integrate  bootstrap into cakephp.
After download and extract  bootstrap from this link . We can simply add files to the app/webroot folder.
bootstrap.min.css -   app/webroot/css
bootstrap.min.js -     app/webroot/js

To work with bootstrap we need jquery. So simply add jquery-x.x.x.min.js to app/webroot/js.

Then we have to import bootstrap before use. Instead of importing in each view file we can add them in
app\View\Layouts\default.ctp   which is the layout shared in every view in cakephp.
we can import like below.

<?php echo  $this->Html->script('jquery-1.9.1.min');?>
<?php echo  $this->Html->script('bootstrap.min');?>

<?php echo $this->Html->css('bootstrap.min'); ?>

So we can simply update class attribute like below so that all CSS stuffs will added like a magic :)

<?php echo $this->Form->input('Reporter',
         'value'=>  $Email_ID)); ?>

So here class attribute is defined as form-control , then css will be applied to the input.

More details about bootstrap CSS

Wednesday, June 18, 2014

User Form Handling in Freemedia Tool

Very first thing in the  Freemedia process is user filling the form in order to create a ticket(making a request). This form should handle correctly , otherwise whole process will become a mess. That because if user enter invalid details, then volunteers will not be able to fulfill the requests. So form handling mechanism should have;
  • Proper validation for each field.
  • Preventing duplicates.
  • User friendly.  
For achieve these things first we need to have a proper database structure.So following  illustrate the ER diagram. 

After the database design I created models for each entity in cakePHP. For that I use CLI tool provided in cakePHP. It makes life easy :) . By just typing "cake bake model" we can create a new model. CLI tool suggest appropriate models from the database. So that we can select what we want. Then tool suggest what are the things that can included in a model.Such as validations,associations(linking models) and etc.

Then I created controller for handle model data. Up to now controller has add() function which insert user data into the database.

Then we need a view to view the user form.

In next form, there is a field for select country. In order to add country list I used formHelp in view.So I created file in view/Helper and use it in the controller(new helper function name should be added to $helper array). ex- if file is LangHelper.php  in controller $helpers = array('Html', 'Form','Lang', 'Session')  should be added.
Here is the code for helper I added to create country drop down list

Then in view file which controller has added the helper can use helper we can create country list like this

Monday, June 16, 2014

Adding OpenID Auth system to cakePHP

Fedora infrastructure currently support openID and Persona (FedAuth). So I have to add openID Auth system in login system.

What is openID?
    OpenID allows to use an existing account to sign in to multiple websites,without needing to create new passwords. With that, password is only given to identity provider, and that provider then confirms the identity of the person to the website he/she visit. So no need to worry about unscrupulous or insecure website compromising visitors identity.

How to handle OpenID in cakephp?

   In this process we need openID library. So here I found openID library for php by janrain and it is licensed under MIT license.
First of all openID library(Auth folder) should be added to app\vendor folder. Then openID component  (OpenidComponent.php) to app\Controller\Component. Then we need a login form.

Next we have to write controller to handle this form. This controller handle following tasks

  • Show the login form.
  • Redirect user to openId provider (when hit submit)
  • Handle the response from OpenID provider.

    Below code is just checks whether openID is successfully authenticated or not.
Above code is modified version of previous userController.php. Here I added Simple Registration Extension(SReg) which retrieve nine commonly requested information
nickname, email, fullname, dob (date of birth), gender, postcode, country, language, and timezone

So that we can retrieve at least few of them and use to identify the user.All request info arrives as an array by post method.
Check the implementation of this in OpenShift.

Friday, June 13, 2014

Overall Design of the Freemedia Tool

Freemedia Tool consist of five main features. 
  • User profiles and user forms.
  • Ticket System.
  • Report generating System.
  • Email System
All these features along with the system database connect to the back end.

Let's get a simple idea about above features.

User profiles and user forms.

This is the most important feature.Because all interaction with user are done here. For this project I am using cakePHP which uses MVC(Modal View Control) software architecture. So this feature directly connect user , view component and controller component.In future blog posts I'll explain them briefly. 
In this system there are three different types of users.
ex- admin,volunteer,requester.
Each type has a different role in the system. So that each user type has different user interface to interact with. 
ex-Only admins and volunteers have access to user profile page and every other users(requesters) only see request form.

Some expected access details of users.

Ticket system.

Ticket system is fully automated system. Because ticket is generated using the data which are given through the freemedia request page. Not all the data collected by the request page is use in ticket generating. So it need separate database table to store ticket details.
Ticket will rejected in case of ;
  • Duplicates
  • Invalid data 
  • Expire due to no volunteer involve .
Following illustrate the ticket handling done in the system.

Report generating system.

This feature is represent the statistical data of the data in the  freemedia database.
ex-  How many request from each country.
       Number of volunteers in each region.
       How many tickets are fulfilled.

 It will uses charts , graphs and other way of the representing statistical data. This also contain leader board of volunteers(top list of volunteers who fulfilled many requests). 

Email System

Mailing system is used to send notification about each important action done in this system.Following figure describes when mails will be send to the each type of user.

In the ticket handling process, mails are auto generated and send to users.In other situations like asking further clarifications about ticket from the request, volunteers can use the template provided and send them.
Also volunteer can change the notification mail settings. So that he/she will received relevant mails.

Saturday, March 8, 2014

Making freemedia volunteers life easy ……

   Currently this process is having difficulties. Because most of the time it has to be manual. Overcoming those difficulties I will introduce a new system which make feemedia volunteers life easy as much as possible, by giving some automated mechanism to the process.
Following diagram will give brief idea how the process will behave. It also shows different user levels.

From the user level (requester), he/she needs to fill the form providing basic details. Then the question page which mostly like a survey will arrive. It include question like why the user wants freemedia and other useful things. Using the data given in the form and the question page, a ticket will be automatically generated. This can be also edit by the user. Then the ticket data will be stored in freemedia database.
From the volunteer level, he/she should first register as a freemedia member by filling a form. Then one of the admin will accept the request and the volunteers will be given a profile page. Then they can check the report page which is included the free media request tickets.  After they can assign the ticket to themselves and fulfill media requests.
An admin is also a free media volunteer who has above facilities as well as admin rights. As an administrator, he/she has to do is accepting the volunteer’s requests of joining to this program.

Following diagram will describe how the tool works in each user level

In the user level what user fill in the form is going through the duplicate checking and validation mechanism, so that any duplicated ticket will be avoided at the very begin. Main reason for closing ticket is not providing valid email addresses, region not matching the country and not correct address provided. From this mechanism these are avoided. So it makes volunteers life easy, because they have to do all the hard work  checking tickets.
Another good feature of this process is auto generating ticket. It is done by using data provided by the user in the form and the question page. This is also makes user life easy as well as volunteer’s, because manually created ticket will give some trouble to volunteers to identify the priorities and relevant tickets.

Statistic page and leader board

Currently Freemedia statistic page having above format. I suppose it should be more enhanced like providing many details.
Providing No of Requests from Sri Lanka for F19 DVD media in 2013.

Statistics data could be filtered easily because ticket creating is almost automated by this tool. So it can easily use keywords in the ticket to filter data.

In this system it also provide leader boar where the top list of donators appear.
This may be some moral up for the volunteers to contribute to the Freemedia.

Automated mailing system

This is fully automated mailing system. Volunteers no need to subscribe to a mailing list which is much troublesome that send mails when any single change done in trac ticket handling system. Volunteers can change the mailing settings as he/she wish.

Tool that use to handle this process has following features
       1)     Handling forms and ticket
            In this feature there are two special mechanism
                      *  Duplicate checking & user input validation mechanism
                      *  Auto generating ticket mechanism

       2) Mail handling System.(Fully automated)
       3)  Statistic data handling System.
       4)  Wiki

Saturday, March 1, 2014

Difficulties Due to the Current Process of Freemedia in Fedora Project

This process is almost done manually, that is the main difficulty in this. Actually following issues are most of the time basing on this difficulty.

  • Contributors have to go to the [1] and check the ticket relevant to them. He/She should be get email notification about relevant tickets unless they subscribed to "Freemedia Trac list". 
  • Freemedia trac list is high traffic where every single transaction on the trac system is emailed.This may be a burden for members.That is why I think it is optional.
  • Ticket handling process is almost manually done by contributors.
               1) Rejecting of the invalid ticket course following reasons.
                      * No valid email id is provided.
                      * The region does not match the country.
                      * No proper address is given

               This can be done by proper validation when user create the ticket.
              2) Finding duplicates also have to handle by the members, but it should be avoided when ticket                          creates.

  • This process is not much user friendly. 

Those are the difficulties I recognize in this process. I think it should be automated. Then it will be a good service.


image taken from

Process that Freemedia Group is Following to Fulfill a Media Request

What is Freemedia in fedora Project?

  "The Fedora Free Media Program is a volunteer initiative by local Fedora Ambassadors and contributors to distribute Fedora Media (DVDs) for free to individuals who can't afford to buy or download Fedora."

What is the process that Freemedia group following?

   Basically, when individual request a Fedora media, any volunteer from the requester's country or near by burn the media and mail them.
Following flow chart will describe the process done when requesting.

Flow Chart of the Freemedia Process
    First user has to fill the form [1] given , asking for free media. After that ticket for the request has  to be created.Then the contributors  are requested to visit [2]  and go through the tickets. They have to reject invalid tickets and accept valid tickets. If ticket is found as a duplicate, accept one and close the others.
All the accepted ticket are available in [2].
    Now the volunteers can search relevant tickets and assigned to them. Then they burn the media and send them to the requester Meanwhile an email is sent informing that the media is on the way. If accepted ticket which are not assigned withing a month by anyone will be closed.

What are the tools use in this process?

  •     For Freemedia form handling stuffs Puppet[3] (IT automation software) is used.
  •     For wiki and ticket handling trac[4] is used.


Interested in doing a GSOC Project ...


  Well, this is one of my dream .. :)  Last time I wanted to participate. But that time I was not confident enough. Ya this time got much confident .. ;) . First I interested in contributing to Mozilla Firefox even fixed bugs there. But now I'm interested in Fedora project. I'm not saying that now I'm not interested in Firefox. I always be proud of contributing to open source software.
         This time in GSOC  I'm interested in a project called  "Infrastructure for FreeMedia group" [1].In simply Fedora freemedia is a kind of donating fedora products to whom are not eligible to download or buy.A Good work done by Fedora (Y) . Still this process is manual, In this project they want to automate it as much as possible.
                 We'll see whether I will be able to take this project  . :)