javachat frontdesk major-project

Upload: chrichtian-a-neal

Post on 03-Jun-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Javachat FrontDesk Major-project

    1/109

    Java Chat Room[eFrontDesk]

    (for Liberian Government Ministries Inquiry)

    by

    Chrichtian A. Neal

    A dissertation submitted in partial fulfillment of the requirements of

    Bachelor of Science in Information Technology

    at the

    Amity Center for E-learning

    Amity University, Noida

    June 2013

    June 24, 2013

  • 8/12/2019 Javachat FrontDesk Major-project

    2/109

    i

    CERTIFICATE

    This is to certify that this a bona fide record to the project work done

    satifactorily at Uttar Pradesh by Chrichtian A. Neal (BSc IT01542010-

    2013027) of the BSCIT10 program.

    This report or the similar report on this topic has not been submitted for

    any other examination and does not form part of any othe course

    undergone by the candidate.

    Date: June 24, 2013

    Signature of Project Guide:________________________________

    Sanjay Kumar Dubey

  • 8/12/2019 Javachat FrontDesk Major-project

    3/109

    ii

    ABSTRACT

    A government enacted the Freedom of information law but limited its people to

    information due to the uncongenial layer that exists between the government and its

    people regarding the availability to information. It is the rights of the people to have

    unfiltered information. This project was done to depict the existing problems

    experienced at governments front desk and the hassle faced by the people in getting

    to these front desks where time and cost is involved. Findings backed the development

    of a web application called the eFrontDesk (chat system), an effective way through

    which of technology solved these problems. A Java software development kit was

    used for implementation after analysis of qualitative data collection was applied that

    brought out useful findings. The results supported this project development to bring

    the government and its citizen closer - using chat technology, but also keeping the

    traditional front desk system. The cost analysis showed an average 62% cost

    feasibility considering information access through Internet, and where cost is not a

    factor, time was of the greatest essence. The entire project design phase focused on

    creating a server end application and a client side with full GUI environment for text

    only. This project is applicable to governments wanting to delivery information to itspeople in a timely and cost effective way. It will help governments and people to

    reduce time and cost to access information with similar scenario.

  • 8/12/2019 Javachat FrontDesk Major-project

    4/109

    iii

    ACKNOLEWDGEMENT

    It has taken me some considerate amount to time and effort to complete this project

    but at the same time have to take out time to extend thanks to those special persons

    who have made the complete process very possible.

    I am highly indebted to Mr. Florian Kammermann for being my study guidance during

    this project. He was very instrumental and resourceful even during his bus schedules.

    Very special thanks and gratitude goes to my dearest friend, Tori, who have helpedand inspired me to carry out this project in the manner as I did.

    Another big thank you to the entire staff of Winrock-LESSP for affording me the

    peace I needed on Earth to complete this project. Had it not been for their

    understanding and reduced job requests, I wouldnt have been able to come to a

    reasonable finish.

  • 8/12/2019 Javachat FrontDesk Major-project

    5/109

    iv

    TABLE OF CONTENTTable of Contents1. Introduction .................................................................................................................................... 1

    1.1 Background ............................................................................................................................. 3

    1.2 Objectives................................................................................................................................ 6

    1.3 Purpose, Scope, and Applicability ........................................................................................... 7

    1.3.1 Purpose ........................................................................................................................... 7

    1.3.2 Scope ............................................................................................................................... 7

    1.3.3 Applicability ..................................................................................................................... 8

    1.4 Achievements .......................................................................................................................... 9

    1.5 Organization of Report............................................................................................................ 9

    2. Survey of Technologies ................................................................................................................. 11

    3. Methodology ................................................................................................................................. 13

    3.1 Problem definition ................................................................................................................ 16

    3.2 Requirement Specification .................................................................................................... 17

    3.3 Planning and scheduling ....................................................................................................... 18

    3.4 Software and hardware requirement ................................................................................... 19

    3.4.1 Hardware specification:- .............................................................................................. 19

    3.4.2 Software specifications:- ............................................................................................... 19

    3.4.3 Development:................................................................................................................ 19

    3.5 Preliminary Product Description ........................................................................................... 20

    3.6 Conceptual Models: .............................................................................................................. 21

    3.6.1 System Flow diagram .................................................................................................... 22

    3.6.2 Abstract Use Cases ........................................................................................................ 23

    4. System Design ............................................................................................................................... 294.1 Prototype .............................................................................................................................. 29

    4.1.1 Web Site ........................................................................................................................ 32

    4.1.2 User interface ................................................................................................................ 36

    4.2 Security issues ....................................................................................................................... 37

    4.2.1 Secure enhancement: ................................................................................................... 38

    5. Implementation and Testing ......................................................................................................... 39

    5.1 Server-client implementation ............................................................................................... 40

    5.1.1 Server-side implementation ......................................................................................... 41

  • 8/12/2019 Javachat FrontDesk Major-project

    6/109

    v

    5.1.2 Client-side implementation .......................................................................................... 47

    5.1.3 Code efficiency: ............................................................................................................. 50

    5.1.4 Storage Efficiency .......................................................................................................... 51

    5.2 Testing Approach .................................................................................................................. 53

    5.2.1 Unit testing: ................................................................................................................... 53

    5.2.2 Integrated testing: ........................................................................................................ 54

    5.3 Modifications and Improvements: ........................................................................................ 55

    6. Results and Discussion .................................................................................................................. 56

    6.1 Results overview ................................................................................................................... 56

    6.1.1 Cost indicator ................................................................................................................ 59

    6.2 Results discussion ................................................................................................................. 60

    6.3 Technical result and discussion ............................................................................................. 61

    6.4 User Documentation: ............................................................................................................ 62

    7. Conclusion ..................................................................................................................................... 71

    7.1 Limitations of the System: .................................................................................................... 72

    7.2 Future Scope of the Project .................................................................................................. 73

    Bibliography .......................................................................................................................................... 74

    Glossary ................................................................................................................................................. 75

    Appendix A ............................................................................................................................................ 77

    Appendix B ............................................................................................................................................ 80

    Appendix C ............................................................................................................................................ 89

  • 8/12/2019 Javachat FrontDesk Major-project

    7/109

    1

    1. Introduction

    The clich the world is a global village has had noprofound meaning until recent

    few years when the proliferation of social media chat rooms. It is important to note

    that the unhindered and unlimited free flow of information amongst people across

    continents through the Internet as a result of chat room platforms (applets and

    applications) by which text, voice, video, and other types of files are exchanged has

    led to another unnoticed phenomenon. This paper looked at the development of a chat

    room system. There has been an increase in the number of chat room applications over

    the years, so much that many web sites cutting across all fields of studies have

    incorporated a chat applet on their web page. There are number of reasons for

    embedding these chat rooms into their websites, but what they all have in common isthe real-time interaction amongst people of diverse interest coming together without

    geographic limitations to share information. The eFrontDesk application is no

    exception to this great venture, but it goes beyond boundaries of social media into

    making a government equally liable to providing free, available, and accessible

    information as it regards to the operations of a particular government (The Liberian

    Government). Governments MDG lacks the will in the absence of technology as a

    tool; and where there is availability of resource, the government owes accountability

    and transparency to its people in the form of good governance. The mixture of

    structure and process that brings together all forms of electronic communication that

    exists between any government and its citizenry should be encourage by proving a

    means by which inquiries are asked, and responses are given. This project

    investigation provided valuable resource which supports the creation of an eFrontDesk

    for each government ministrys webpage, -which will foster the free flow of

    information by bridging the gap between the government and people, and promote

    accountability, and transparency.

    The paper provided in details a model for developing a web chat application. The

    project discussed lengthy on the processes of embedding the developed application

    into a web page to create a server-client chat system that would aid prospective users

    cut down on travel cost and reduce time constraints in obtaining needed information.

    As a result of inter-operational functions of governments offices, private businesses,

    non-governmental organization, private individuals, are often faced with hassle

    wherein business processes might require more than a single government ministry or

    office to complete. This process is cumbersome, costly in terms of distance which

    spans over ministries. The project will seek to address the information gap betweenthe government and its people. The development of an electronic front desk will

  • 8/12/2019 Javachat FrontDesk Major-project

    8/109

    2

    relieve the burden, time constraint, transportation cost factor in getting needed

    information as required by users. It will also remove the centralization of information

    distribution from the Capital of ministry offices to limitless boundaries. And all this

    would be made possible by technology. Identified were problems faced by the

    Liberian people in an age where information is abundant, but has limited or scarceaccess to information. Finding presents a clear perspective that problem is political

    and the solution to adopt neutrality is technology. Technology was a resounding yes

    from findings to encourage good governance, foster cordiality between government

    and people, improve transparency and accountability, minimize cost on people by

    reaching out to the with technology. As was amplified by the studys report, it was

    shown the technology was the hope for an improvement to governments relationship

    with citizen.

    A lot of effort was put in finding a unique development toolkit to sprout out a

    prototype for the application to solve the aforementioned problem of reaching the

    doorsteps a people with information. Newer ideas introduced another type of program

    functionality enhancementthe eRejoinder. The rejoinder module and database

    functionality to capture governments indicators was touched upon especially as to

    why they formed part of the limitations of the project. The report brought together two

    types of methodologies. A data collection methodology which was qualitative in

    nature and imbued questionnaire, interviews, and direct observations to have come upwith the analysis supporting the implementation of the projects development, and

    another methodology which was more technical in nature. The technical methodology

    of the SDLC (Software Development Life Circle) was a V-shaped model to enhance

    an RAD (Rapid Application Development) due to minimal planning. The data

    collection tool had a remarkable influence on spotting out new areas on which future

    studies could be made. These findings in turn showed light on some unnoticeable

    misconception on the part of computer users of what the good intention of technology

    is about. The user module of the computer system was emphasized to mean that the

    computer system is not efficient without uses.

  • 8/12/2019 Javachat FrontDesk Major-project

    9/109

    3

    1.1 Background

    The beginning of online chat was from in the mid-1970s when Doug Brown andDavid R. Woolley of the University of Illionois created the Talkomatic. From then on,newer ideas on the development of modern chat systems was initiated for global usageand it was made available to many other people from different parts of the worldthanks to the creation of the Internet. The Internet is the platform on which multi-

    platform computers are interconnected to make chatting possible. Right after that,Jarkko Oikarinen came up with the first IRC client and server application in 1988, atthe University of Oulu in Finland. Since then, online chatting has grown from a tool ofa few researchers and technologists to a wider public, and even inter-personal Internetactivity, which provides a platform amongst users of specific interest group the

    sharing of information and knowledge.

    In recent years, many free email web hosting sites have included a chat feature ontheir services. We see the same with eCommerce, eGovernance, health and medical

    practitioners, military services, hotel and tourism, banking institution, eLearning (ofwhich the Amity University is proud), and very prominentlythe social era ofrelationship seeking through chatting and online dating services, customer support,

    plus more. Internet chat not only being the transmission of text but also incorporating

    video chat for conferencing, and VOIPhas revolutionize the way people onceperceived the Internet and this has changed the way people interact with one anotherlocally and globally forever. Marshall McLuhans the world is a global village isstrongly supported by this trend and consciousness has been extended.

    On the backdrop of electronic globalization, it is binding on governments to bridge thegap between its people and the flow of information it has. For the most part,information in Liberia still seem to be scarcely managed but by a few. There should bea very free flow of information between any and every government and its people

    regardless of the negative impacts. The Government of Liberia signed The Freedom ofInformation Act in October in 2010, making the country the fourth country in Africaand the first country within the West African to have signed such a document. The lawallows both the media and individual citizens to demand information from any publicauthority or any private authority that carries out government functions.

    Within the framework of practicing efficiency and effectiveness in governance, it

    must be noted that good governance initiates opportunities that allows governments to

    recreate means which promote higher level of efficiency in terms of eGovernance. E-Governance when practice well helps the government get closer to the citizenry and

  • 8/12/2019 Javachat FrontDesk Major-project

    10/109

    4

    this leads to a rather closer coalition and relationship with diverse communities of

    expertise, interest, and practice within the context of national development agendas

    with is wholly reliant on proper distribution and sharing of vital information. E-

    Governance being an emerging concept or practice seeks to substantiate processes and

    social structure for harnessing the capabilities of information and communicationtechnologies (ICT) at many diverse levels of government and the public sector.

    As was previously mentioned, the central of the Global Information Infrastructure is

    important to effectuate the concept of flexible regulation, decentralization, and

    dissimilation of information, which is the right of each and every citizen (as enshrined

    by law) living in Liberia to have free unrestricted access public information. The road

    to eGovernance seems more like an emerging revolution, as governments and citizens

    the world over invest more into the experimental phase and exploits deeper into the

    concept with newer media and information technologies. E-Governance has evolved

    to be a new styles of leadership, bringing newer ways of considering and deciding

    strategies, newer means of accessing services, newer ways of doing business, newer

    ways of accessing education, newer ways of listening to citizens, newer ways of

    organizing and delivering information.

    Amongst the many ways eGovernance promotes eDemocracy (which is referred to asthe mixture of structure and process that brings together all forms of electronic

    communication that exists between any government and the citizenry) is by making

    information available and accessible to its people and those in search. A better way to

    do this is what this project has researchedan online chat room which serves as an

    information front desk made available to the people once Internet is available.

    The eFrontDesk is an application coded to run as an applet in a web browser. This

    program enables users to login and interact with help desk representative and request

    relevant information without having to in person visit the government office for

    needed information. This project unlike many other projects is incomparable due to its

    government-to-citizen forecast on availing information. Much similar to this project is

    the inclusion by many universities the world over incorporate web chat on their pages.

    Except that eFrontDesk is limited to just text-based chat, eLearning encompasses text-

    based, video-based, audio-based, and the wholeness of multimedia interactions.

  • 8/12/2019 Javachat FrontDesk Major-project

    11/109

    5

    Evidently in recent times, a lot more educational institutions have added a chat room-

    based teaching environment. This environment permits virtual teaching which occurs

    at different times and locations much more convenient to the students and faculties.

    Due to this improvement, the teaching field is moved to utilizing the best out of this

    technological tool to improve the quality of social and psychological lives of thestudents and forecast their learning abilities. There are some universities which

    created chat rooms supported by Internet that allow students to socialize and share

    their emotions as well as relevant information with other students and faculties. Some

    universities engaging this chat technology are: The University of Delaware in the

    United States did establish a series of online chat rooms for incoming freshmen, while

    the New York University and Kwangwoon University (in South Korea) also did create

    their own chat rooms for students who are single which allowed them to socialize with

    each other and share their photos online to get to know each other better.

    This project comes handy in aiding the Government of Liberia in allowing a

    framework for the people to know their government in what they do, how they do, and

    why they do what they do. It brings to the doorsteps of the people the answers they

    have been waiting for. And this put the government in the position of making

    fulfillment of some of the promises made to the people by reaching out

    technologically with information.

  • 8/12/2019 Javachat FrontDesk Major-project

    12/109

    6

    1.2 Objectives

    This projectsobjective is to create a chat room for the government ministries in

    Liberiawritten in Java, designed to ease the burden off the citizenry whichincludes: NGOs, businesses, and private individuals (home and abroad), and span over

    non-Liberians when it comes to acquiring firsthand information from each of the

    various government ministries. Research was conducted in Liberia, but the product

    would be relevant to people outside the country as well.

    The project will also developed to help alleviate cost and time factor of citizens in

    getting relevant and timely information for effective decision making. Most times, it is

    very difficult on the part of citizens to get to relevant government offices and it takes

    hours to get a small piece of information, which sometimes in either misleading or

    uncompleted.

    Primary objective:

    - To create a single chat server and multiple client connections using sockets allowinguser s to make inquiry to online desk offices.

    - To help Ministries become more interactive, and bridging the information gap

    between it and its people.

    Secondary objective:

    - To study the various classes responsible for socket connections across the Internet and

    how a client side application connects to a server, like the Listener class, while-loop,

    etc.

    - To understand the authentication and communication protocol involved before a

    session.

    - To study Javas greatest strength when it comes to multithreading and networking by

    providing vivid analysis of this characteristic in the project.

    - To study how information is send to database that will store log in session activities

    and chats.

    - To study the cleanup and maintenance after a chat session.

    - If possible, attach a rejoinder app to forward findings to phone numbers and email

    addresses of visitors.

  • 8/12/2019 Javachat FrontDesk Major-project

    13/109

  • 8/12/2019 Javachat FrontDesk Major-project

    14/109

    8

    platforms and it comes across efficient to connectivity. The creation of the Java chat

    room might find itself useful by undergoing a sequence of program development

    methods and procedures which are applicable in the modeling of Java development for

    the purpose of information inquiry. It will leave enormous room for integration into

    web sites. It will further grow its functionality when considering enormous integratedinterworking of offices as far as information exchange is concerned.

    Careful thoughts would be put in to other aspects of the applications data reservation

    (data mining) to enhance a system of monitoring and evaluation, but this feature was a

    limitation due to time and left for future growth. This project is unlike many others

    with full functional voice, video and file sharing capabilities. A very relevant feature

    which would particularly support the purpose of the project is the file sharing. The

    government and people could use this to further cut down on the problems by sharing

    various types of forms, journal, new letter, bills, and so on. In the same way form

    could be submitted to bureau electronically. Functionally,

    1.3.3 Applicability

    This paper implementation, that which is the outcome, would be used at the front-deskof Government Ministries in Liberia to address many forwarded inquiries from users.

    This project is going to contribute meaningfully to the users (who mostly would be

    Liberians) by reducing the time put in to travel from one office to another to make

    queries. It was developed to also reduce the cost of travel for users. The project is

    scoped for Liberians near and for wanting to get information prior to seeing

    governments office. It does not limit non-Liberians from also get similar information

    or making inquiries. It would be very important for all business people, NGOs, and

    private individuals. Since it is going to be Internet supported; this broadens the usage

    to a more global audience.

    On a global spectrum, this project is pilot project to many governments that would

    want to practice eGovernance where transparency and access to information to its

    people would be paramount. It will add value to many governments web page

    inducing a friendly but human interaction which is more flexible and not limiting.

  • 8/12/2019 Javachat FrontDesk Major-project

    15/109

    9

    1.4 Achievements

    A significant achievement has been made as a result of an on-hands initiation and

    implementation of this project. More notable is the importance of the Java as a widely

    used application; much was achieved in terms of developing a messaging protocol

    using socket and how to integrate that into a full application in to a web pagethis

    which was a new lesson learned. Much time was spent on remodeling the user

    interface which was created with Java AWT package coding and this turned out very

    phenomenal. The experience was new, difficult, but paid off.

    Other important issues learned was that of the governmental operation and functions

    in the Liberian political setting. It was discovered through this research that Liberia

    was the fourth nation in African to enact the Freedom of Information Bill and it was

    also the first nation in West Africa to do same. The researcher found it very useful

    through gathering information that despite the literacy margin with is almost the same

    as the illiteracy rate, many look at technology as a means of improvement. Be it

    personal improvement, or a national collective improvement. It is established that

    technology is the new trend by which any government should build its millennium

    development goal upon for a rapid and inclusive growth.

    This project is achieved remarkable success for implementation to those governments

    wanting to reduce time, cost, and hurdle of its people, and allow a cordial free flow of

    information through its authorities (ministries) by a few clicks.

    1.5 Organization of Report

    This project provides a stimulus recipe of an investigative summary researching the

    productivity afforded by employing the use of technology in helping make the most

    out of our day to day situations. It goes further to dissect the SDLC in putting asolution to the problem found with an intention to alleviate the fear relating to cost,

    and time consumption that incur trying to obtain information for a particular setting.

    The rest of the chapters will elaborate more detailed findings and methods taken to

    resolve the problems found. The best tool as was analyzed in chapter 2 was laid out

    and selection done. Chapter 3 spells out clearly the problems and how the problems

    would be solved in a time cautious way -with all of the necessary and relevant

    materials (software and hardware) needed from design to implementation. It focuses

    more on the method of data collection and analysis which was supportive of the

  • 8/12/2019 Javachat FrontDesk Major-project

    16/109

    10

    project. It gives a step-by-step detail for further replication or improvement of similar

    project. In chapter 4 is where explicit discussion and elaboration was done, which

    included the planning, diagram, flow chat, pseudo coding, plus other issues that had to

    do with security were made mention. This chapter is in total the design phase of the

    entire project for developing a complete prototype. The test-try-and-use phase ischapter 5. This chapter implements a platform which enables whatever that was

    developed as a prototype into coding for prompt workable application for a test and

    try. If test-and-try meets specifications, then the prototype is moved into

    implementation or changeover mode. Chapter 6 discusses the result from the test

    cases. Much deliberation is carried out here relating to the combine methods used. An

    insightful peak into the analysis of the data collection procedure is explained, and

    those methods where qualitative, questionnaire, open-ended interviews, and general

    observation. It discusses more on the ability of the application to withstand the reality

    of endurance in a real world scenario. In this chapter user documentation is found.

    The conclusion is the finally chapter (chapter 7), and it brings to together a lot of point

    in a mesmerizing way. It presents a full summary of what the project report is all

    about. What the findings where, and how they were solved, and things which were

    unsolvable, and those that are up for future study or solution based on limitation of

    various sorts.

  • 8/12/2019 Javachat FrontDesk Major-project

    17/109

    11

    2. Survey of Technologies

    The implementation of a chat room which cuts across multi-platform with not much

    hurdle, despite other issue arising from growth and data storageJava stands tall.

    Java's write-once-run-everywherecapability along with its easy accessibility have

    driven the software and Internet communities to embrace it as the de facto standard for

    writing applications for complex networks, and perhaps many other devices.

    In similar manner, we cannot pay a blind eye to other contending tools like C#. Quite

    recently, there have been many controversies when it comes to the strengths and

    weaknesses of the two (Java and C#) devkits. More developers are finding C# highly

    interoperable, portable, and cross platform.

    Diving deep into which of the two app has all it takes to run a project like a chat room,

    it could be simple and easy to choose Java over C# because of the scope of this study,

    but eradicating the politics centering Sun MicroSystem and the .Net/Mono project,

    many would want unlimited restriction or OpenSource privileges.

    PHP (server side) combined with JavaScript (client side) comes across as one perfect

    solution for a chat room application. When combined, Ajax integrates suitable

    techniques for server/client side messaging protocols.

    The truth of the matter is that these languages have interesting features lagging by the

    other, but for now Java seems to have an urge over the rest due to its popularity,

    portability, robustness, maintainability, abstraction, and its politicized writeonce -

    run everywherecampaign. Even though, many programmers would chose C#Mono

    over Java due to its Language Integrated Query (LINQ) feature, the major factor is not

    which programming language is the hallmark of excellence, but which protocol (IRC,

    PSYC, HTTP, or XMPP) serves best the purpose for chat messaging or conferencing.

    Available technologies:

    Java SunMicroSystem

    C# Microsoft

    PHP The PHP Group

    JavaScript Netscape

  • 8/12/2019 Javachat FrontDesk Major-project

    18/109

  • 8/12/2019 Javachat FrontDesk Major-project

    19/109

    13

    3. MethodologyTo develop an application, it is important to apply the right methodology to make the

    development process effective and efficient. As per the requirement and analysis of

    the system, the V-Shaped module was used for its simplistic nature. This model is alsoone of the SDLC models with a high change of success as compare to other modules

    and each phase has a specific deliverable.

    The project specifics modeled around the below listed:

    To use technology to allow freedom to access information for government To mitigate the cost and time put in to obtain the require information, either by

    transport or phone calls. To allow the people and government foster a cordial interrelationship byeradicating the limitations geographic location has on its people along with thenegative effects.

    To alleviate public misconception and misinformation through direct one-on-one means with the help of technology.

    To improve technological skills of front desk personnel on ICT.

    Hence, a Rapid software Prototyping process (or Rapid Prototype Model) was applied.This process describes a practice in software development process or application

    development process and is sometimes referred to as rapid application development(RAD). Rapid Application Development (RAD) is also referred to as a type ofsoftware development methodology, which uses minimal planning in favor of rapid

    prototyping. The planning stage of the software development uses RAD to interleavewith the writing of the software. The projectsbeginning had a minimal plan and allthe following works were strictly based on the plan, even though there were somechanges during the development process. This project was supervised by the Mr.Florian Kemmermann (a software engineer), and periodic reviews on the progress ofthis project were held intermittently during the development of the project.

    With focus set on the purpose of the project, identified were problems faced by apeople (the Liberian people) and found ways through the use of technology to solvethe problems. It sought to mitigate the cost and times factor faced by many peoplewanting information in a feasible way, and in so doing relieved them of stress. Moreimportantly was the emphasis made on the commitment of a government wanting to

    bridge the gap with its people by disseminating unhindered information with the helpof technology. Good governance intertwined with technology produced efficiency ineGovernance and forecasts eDemocracy.

    The study provided a set of problems through a qualitative method, since this methoddid not just investigate the what, where, and when of the decision making,but

  • 8/12/2019 Javachat FrontDesk Major-project

    20/109

    14

    also the why and how. Qualitative data collection also drifts away from thescientific demand unto a rather natural understanding of a problem which was lessscientific driven. The investigation looked at output from a series of data collection

    processes which included questionnaires and a couple of interviews that were open-ended.

    A cross section sampling was done out of a focus group of eight. Questionnaires werehanded out 13 respondents, and a series (five IT professionals and five front desk

    personnel from various ministries) at of open-ended interviews with diverseprofessional groups was held. The respondents were from a cross section of gender,age groups, professions, with much knowledge on the information criteria as madeavailable by the Liberian government ministries. There were series of directobservation made at various front desks as to their inner working of front desk

    practices and procedure in handling the dissemination of information to visitors. Theobservation method proved helpful in determining key variables to the projectsimplementation.

    The interview, questionnaire, and direct observation aimed at obtaining informationon the current front desk system, the effectiveness of it, room for improvement, usingtechnology for improvement, and the decentralization of information. The questionsasked also gave respondents the freedom to reject the validity to undergo this project,

    but fortunately the results proved otherwise. As shown in the appendix (appendix A-1), each respondent of the 13 were provided, through cluster sampling, a questionnairewith two section which collected personal data (which included: age group, sex,occupational category, and IT literacy), and the other section presented 15 questionsthat yielded insightful outcome. The other 10 responded went through the interviewand were presented 10 open-ended questions each (see appendix A-2). The samplingwas judgmental. Responses from the respondents were recorded and later analyzed.All analysis arising from the questionnaires was done using Microsoft Excel 2010,while interviews were narratologically analyzed.

    The duration for the data collection is a little over the one week stipulated in the timeschedule. The process has been ongoing but within a week, all the recorded interviewswere done along with the collection of questionnaire from respondents. Respondents

    were engaged mostly at the mid-day at seven of the 19 ministries which included theMinistry of Foreign Affairs, Ministry of Planning and Economic Affairs, Ministry ofLands, Mines and Energy, Ministry of Health and Social Welfare, Ministry ofEducation, Ministry of Information, Cultural and Tourism, and the Ministry ofFinance and Budget Bureau. A cross sampling interview was also done at some localgovernment agencies which included the Rural Renewable Energy Agency, LiberiaBusiness Registry, Liberia Bureau of Customs, and Liberia Maritime Bureau. All ofthese ministries and agencies are all located within the vicinity of Monrovia andPaynesville cities, Monsterrado County, Liberia.

  • 8/12/2019 Javachat FrontDesk Major-project

    21/109

    15

    Some important factors to make mention of which could have hampered the outcomeof this project are as follow:

    The literacy rate in Liberia is battling out the illiteracy but with a minutemargin. In 2010, the literacy rate stood at 60% wherein that figure in a

    population of approximately 4 Million inhabitants, 56% are females. Balancingthe ratio could have led to variance had computer literacy not been adetermining variable.

    The demography of the country is shifted largely to a few bigger cities, makingit difficult to obtain proportional data sampling from all parts of the country.

    Political factor: some respondents felt that the process was to discredit thepresent government of which they are closely linked or partisans. This couldhave put a damper on the quality of responses.

    - To avoid the above mentioned anticipated problems, a prescreening was alsoinitiated in form of a conversation which was more or less an open-endedinterview to get hold of the respondents utterance. This inclusion criterion wasused to determine the level of education of the respondent.

    - As for reaching throughout the countrys demography representatively, thiswas in a sense very difficult. The reason is that the countrys (Liberia) politicalsetting is centralized to the capital (Monrovia). This had a negative bearingwhen it came to representative data collection. All government ministries are inMonrovia with no or non-functional sub branches.

    - A careful introduction to respondents was done in order to ensure that they

    actually understood the intension of the exercise. To eradicate the politicalatmosphere during the data collection process, the problem statement was

    presented in a manner that shifted the political ideology to a communicationalgap and a technological enhancement.

  • 8/12/2019 Javachat FrontDesk Major-project

    22/109

    16

    3.1 Problem definitionOne of the great disadvantages faced by people in the Information Age is informationovercharge. So much information out there and one might not know from which to

    select. This also applies to the many government offices, agencies, and ministries,where occasionally, their functions interlaced with each other. Businesses, non-governmental organization, private individuals, are often faced with hassle wherein

    business processes might require (unknowingly) more than a single governmentministry or office to complete. This is cumbersome enough, time consuming, costly interms of distance -spanning over ministries, offers delay in business transactions.During the close of the year, especially holidays seasons, this could be very irritatingsince transportation means is difficult, and government offices close-down far tooearly.

    It is frustrating to know that many government ministries do not have websites. Somedo have websites but they are not regularly updated. Front Desk offices are either notavailable or without the information needed. Many others in a hurry to get informationare impatient. This unavailability of relevant information at front desk is viewed bymany citizens in Liberia as a way the government chose to hide information fromthem. Inasmuch as the Freedom of Information Law was enacted into law, and yetmany still feel disenfranchised to information.Information should be free and available at all times to those in need. The governmenthas a duty to its people to provide the information they need if they should make theright decisions.

    To summarize, the project found the following problems which it will seek to address:1. Information gap between the government and its people2. Burdensome, time consuming, phone communication and or transportation cost

    factor in getting needed information3. Information retrieval is geographically centralized because governance is also

    centralized.

    This project did identify the above listed problems faced by the Liberian people and

    found a way by using technology to solve the said problems. It sought to mitigate thecost and times factor faced by people wanting information in a feasible and costeffective way, and in doing so -relieve them of stress.

  • 8/12/2019 Javachat FrontDesk Major-project

    23/109

  • 8/12/2019 Javachat FrontDesk Major-project

    24/109

    18

    3.3 Planning and scheduling

    Like every undertaking, planning is the first step. A developer must go through this

    phase in order to properly organize the many sub-phases of the project, and afford himthe relevant documentation on the system he wants to build. It is by this means the

    system comes under critical studying, the collection of data, design implementation,

    system coding, series of testing, and finally, implementation of the system is achieved.

    Table 2: Simulated Gnatt chart

    ID Task Procedures Duration wk1 wk2 wk3 wk4 wk5 Wk6 Wk7 Wk8

    1 Begin project 2months

    2 Phase0 Survey and analysis 6days

    3 Phase1 Server module coding 3days

    4 Phase2 Client module coding 9days

    5 Phase3 Web page creation 2days

    6 Phase4 Client module 3days

    7 Phase5 Embedding client module in HTML 2day

    8 Phase6 Testing validation 6days

    9 Phase7 Debugging errors 5days

    10 Phase8 Remodeling 2days

    11 Phase9- Testing validation 2days

    12 Phase10-Final testing and implementation 1days

    13 Phase11 Integrated Testing 2days

    14 Phase12: Modification to suite spec 2days

    15 Phase13: Testing and debugging 2days

    16 Finish: implementation

    The time duration as displayed by the Gnatt chart is far less than the 3 months period asstipulated by the project schedule. In additional, this depicts an estimated time value, anddue to unavoidable circumstances, schedule can incur fluctuation.

  • 8/12/2019 Javachat FrontDesk Major-project

    25/109

    19

    3.4 Software and hardware requirement

    Minimum requirements:

    3.4.1 Hardware specification:-Processor : Intel Pentium II or higher

    Speed : 350 MHz processor or higher

    Memory : 128MB RAM or higher

    Hard drive : 10GB or higher

    USB port : 1 port or multiple

    Keyboard : Standard keyboard

    Monitor : 15 color CRT (Cathode Ray Tube)

    Compact disk drive : Combo Drive

    Mouse : Scroll Mouse

    Network card : 10/100 mbps

    In addition to the above mentioned hardware specification, it should benoted that the requirement for implementation is not limited to mobileusers.

    3.4.2 Software specifications:- JVM (Java Virtual Machine) Internet web browser (Internet Explorer, Mozilla Firefox, Google

    Chrome, Safari, Opera,..) TCP/IP, Socket OS [cross platform]

    3.4.3 Development: Java IDE (NetBeans 7.0.1) EditPad Lite 7 JDK 1.3.1 or above Microsoft Office 2003 or above

  • 8/12/2019 Javachat FrontDesk Major-project

    26/109

    20

    3.5 Preliminary Product Description

    The significance of this project is to provide a decentralized, inexpensive, less time

    consuming alternative to users wanting information from any of the governmentsministries in Liberia with the help of technology. This new web enabled chat

    application will be used by those in Liberia as well as Liberians and non-Liberians

    outside the country. This will help them to make resourceful inquiries from

    government offices near and far by a few clicks. The application will allow users to

    login with a user name or chatter handle or nickname and will each user will be

    validated to chat with front desk personnel.

    The eFrontDesk system should be able to meet the following requirements:

    The system should be able to have an attentive server listening to connections. The application should allow multiple users to logon to the server through a

    web application. Redundant nicknames should be discouraged. Chat users should be able to provide a username to be validated. Users must be able to communicate with front desk personnel and get instant

    feedback through chat. The system must be easy to use. System should allow user tranquility or abstention from unnecessary chatter(s). It should allow user to terminate connection if they so desire. The system should be able to keep track of logged in users.

  • 8/12/2019 Javachat FrontDesk Major-project

    27/109

    21

    3.6 Conceptual Models:

    The eFrontDesk system will mediate between people seeking information and those at

    the various ministries frontdesks representing the voice of the government by

    providing such information:

    Figure 1: A simple illustration of the chat logic from concept

  • 8/12/2019 Javachat FrontDesk Major-project

    28/109

    22

    3.6.1 System Flow diagram

    I. Client 1 connects to the server. Validation takes place to avoid duplicate nick names.

    II. The server sends a USERLIST_MESSAGE message to Client 1 (The user list window ispopulated with all online users and all available public chat rooms)

    III. Client 2 connects to the server.

    IV. The server sends a USERLIST_MESSAGE message to Client 2 (The user list window ispopulated with all online users and all available public chat rooms)

    V. Client 1 sends a CHATINVITE_MESSAGE for Client 2 to the server

    VI. The server sends an OPENCHAT_MESSAGE to Client 2 (A private chat window is openedon Client 2)

    VII. Client 2 sends a BROADCAST_MESSAGE to the server for the private chat room that Client1 and 2 are now in

    VIII. The server sends a BROADCAST_MESSAGE to all clients in the specified chat room. (Themessage is printed in the chat window on both clients)

    Figure 2: A message flow diagram between a server and two clients

  • 8/12/2019 Javachat FrontDesk Major-project

    29/109

    23

    IX. Client 1 sends a LEAVEROOM_MESSAGE to the server. (The server removes Client 1 fromthe chat room)

    X. Client 2 sends a LEAVEROOM_MESSAGE to the server. (The server removes Client 2 fromthe chat room. Since there are no longer any clients in the chat room, the server closes theroom and makes the chat room ID available for future use)

    XI. Client 1 sends an EXIT_MESSAGE to the server. (The clients connection is terminated andthe client is removed from the online users.)

    XII. The server sends a USERLIST_MESSAGE to Client 2 (This message will no longer containClient 1)

    3.6.2 Abstract Use CasesThe abstracting use case is a makeup of the requirements specifications. The areacovers the most important functionalities and requirements. The abstraction of theclient-side consists of the following use cases:

    1. Use Case 1: Login2. Use Case 3: Chat in one room3. Use Case 4: Logout

    In this use case diagram, the pane with the labeleFrontDesk System indicated theboundary of this system, and the three ellipses showed the use cases inside this

    boundary and occupied some part of system resources, but not all of them. Exceptthose use cases, the remaining part indicated some other resources of this system, such

    USE CASE 1

    Login

    USE CASE 2

    Chat in room

    USE CASE 3

    Logout

    User/chatter

    **

    eFrontDesk System

    Figure 3: Use Case diagram [user login]

  • 8/12/2019 Javachat FrontDesk Major-project

    30/109

    24

    as web page part. On leftside of system boundary, the symbols represented users partof this system, and ** means the user quantity can be ranged from zero to

    infinite. The following use cases were not fully dressed, only successful systemoperations were recorded and the failed operations were ignored:

    :: Use case 1: Login

    1. The system displays a login menu. The use click the Login menu button and a

    dialog box appears, asking user to enter a nickname that used for chatting, a servername, and port number. The server name is not important and it could be null. The

    port is defaulted to 1436.2. The user enters a nickname and then presses Connect button.3. The system displays a card-layout GUI chat room window to user.

    :: Use case 2: Chatting in room

    1. User can type in General Message! text box and press Send Message! to sendgeneral message to all users in chat room.2. A user can also send private message to specific user in chat room by double clickusers name, or by selecting specific user and clicking the Send Direct Message

    button. A private chat window will display for personal chatting.3. User can also select a particular user and ignore conversation or chat from selectedor highlighted user.4. User can send/broadcast message to all logged on users or engage Admin/front desk

    personnel for inquiry.

    :: Use case 3: Logout1. User can click the Exit Chat button to leave chat room. 2. The server stops the active session of the user and closed the user chat window byexiting the system.

    Start/Stop Chat

    Server

    Chat Admin

    eFrontDesk System

    Respond to user

    ueries

    Figure 4: Chat Admin [Admin actions]

  • 8/12/2019 Javachat FrontDesk Major-project

    31/109

    25

    :: Use case for Admin1. The Chat Admin start the server and or stop server application.2. The Chat Admin respond to various inquiries made by users.

    Detailed use case diagram of server/client:

    Log Onto

    ChatServer

    Quit

    Chatroom

    Send Message to

    Admin

    Send Control

    Message

    Send Message

    to ALL

    Decode

    Chatter

    User/Chatter

    Chat Admin

    Respond to

    chatter query

    The above diagram is similar to the previous but elaborates more on the actions that could beperformed by the user/chatter and the proposed role of the administrator/help desk personnel.

    1: ChatterLogon to chat room.Send General message.

    Send private message.Send message to Admin/help desk person.

    2: Admin/Help desk personnelStart/stop server.Respond to chatter inquires.

  • 8/12/2019 Javachat FrontDesk Major-project

    32/109

    26

    A Chat Message Use Case Sequence Diagram showing groups of objects

    interworking

    X

    aSendMessag

    eWindow

    client

    aClientSocket

    * write() aServerSocket

    * recieve()

    mssgType :=

    getMssgType()

    new aBroadcastMssg

    |

    |

    |

    |

    |

    ||

    validMss

    aLogEntry

    |

    |

    new

  • 8/12/2019 Javachat FrontDesk Major-project

    33/109

    27

    A Client Create Sequence Diagram asynchronousmessaging

    X

    aChatClient

    new aClientListener

    new aChatClientSender

    |

    |

    |

    |

    |

    |

    recieve()

    postToClient

    *

    mssgRequest()

    sendToServer

    *

    kill

    kill

    logout

    new

  • 8/12/2019 Javachat FrontDesk Major-project

    34/109

    28

    A Collaboration Diagram for the Chat Message Use Case

    :SendMessag

    eWindow

    1 :clientMessage()

    :ClientSocket

    1.1 * write()

    :ServerSocket

    1.1.1 * recieve()

    1.1.2 getMssgType()

    :BroadcastMssg

    1.1.4: [validMssg]:new

    : LogEntry

    1.1.3:

  • 8/12/2019 Javachat FrontDesk Major-project

    35/109

    29

    4. System DesignThe system design phase turns out to be the most difficult phase in developing an

    application, maybe notbut the most challenging phase within the designing of a

    system. It is within this phase right after conforming to the various criteria arousedfrom the system analysis that the development of specification for a candidate was

    carried out. The designing of software is an integral component of software

    engineering and it is a technical phase which must be applied to all software modules.

    4.1 PrototypeThe system is going to be divided into two separate applications running

    independently of the other but reliant on the other to form a functional system.

    The client-side and server-side applications:

    Server-side interface:

    On the server side, a custom class was created - UserObjectclass - it will containthe client detail which includes users socket and username or nickname, etc.

    Initiating the Chat Server opens the Server Socket at port a defaulted port [1436].This port is changeable to meet users specification. The Server Socket at a desired

    port listens for the clientsconnections. When client is connected to the server, it

    opens another thread to service. This is so because when the client sends a QUITcommand, it will therefore close the thread.

    To get connection from a client, the ChatCommunicationobject was created. Withthe ChatCommunicationclass, a thread is created to watch all the commandscoming in from the client and it eventually responds to the client as well.

    ClientObject.3

    run()

    Internet

    chatcomm.

    run()

    run()

    sendMessage()

    ChatServer

    main()

    new ChatClient

    main()

    Class chatcomm.

    Figure 5: Framework of the server chat system

  • 8/12/2019 Javachat FrontDesk Major-project

    36/109

    30

    The process begins with each new ChatClientmaking connection to the ChatServer;

    the chatcommunication creates a socket connect and interface for each new client. An

    instance of the ClientObjectclass is created, but it keeps details of the new clientsport socket, handle, and existing room. The ChatClientclass via the ChatServersends

    out messages from the new client to the client object. Within the chatserverclass, alist of the current user is maintained; the SendMessageToClient()method uses thislist to transmit a message tree to all connected through the ChatClientclass.

    Client-side interface:

    When the Chat Client is initiated through the web page, it will open a socket

    and connect to ChatServerby shaking hand with a HELO RFCmessagetoServer. When the client gets connected, the socket connection remains openand communication with the server is at the users commands.

    This interface is made of JPanelfrom the Abstract Window Toolkit (AWT)standard package to enhance the Grahical User Interface (GUI) of the clientside application.

    START SERVER

    STOP SERVER

    Star server button

    Stop server button

    Figure 6: Frame layout of server application window

  • 8/12/2019 Javachat FrontDesk Major-project

    37/109

    31

    Client-side Card Layout:

    Figure 7: Frame layout of client application window

    With ease-of-use being focused, the canvas has is very simple layout which allows

    users a very easy way to navigate. Users who are even more familiar without rough

    chat terrains will even find this layout extremely easy to navigate. The client module

    is in a way the most intricate part system because of the higher user interaction, and

    dependence of the server model on the client side. A sluggish design does not help the

    easy operation of the system as far as the users concerned.

    The broadest area is the general message display area where conversation between

    user(s) and administrator is not missed. Periodic notification is display about user(s)

    login status, logout status, and broadcast messages. The right panel displays

    information about already logged on or recently logged on users.

    The bottom part of the chat canvas has the text box where user(s) can make general

    inquiry or public comments. And if need be, private message can also be sent to the

    administrator or another user. The send message button and exit button or adjacent

    each other. Basically, this is the client application layout attribution which is to be

    made into an actually application.

    Login menu

    Help menu

    Scroll bars

    (horizontal and

    vertical)

    Users list tab

    Chat display area

    Exit chat

    button

    Send message

    button

    message text bar

  • 8/12/2019 Javachat FrontDesk Major-project

    38/109

    32

    4.1.1 Web Site

    The web browser is the first location to initiate the chat process. Due to the fact that

    the Liberian Government has a web page for the Executive Mansion; it also serves as

    a central web site for the various ministries. It contains link or pages to the a few

    ministries that are able to maintain the web service. A valid web address containing

    the various links to each government ministry is provided:

    www.emansion.gov.lr

    Figure 8: Executive Mansion web site

    The above page is the official web site of the Liberian Government Executive

    Mansion, and it serves as a hub to information sharing in the country. This pageprovides in addition to links to other vital resourceful contents like vacancies, RFPs,Bids, Corporate agreements, past speeches, and more.

    From left to right, tabs [Home : The President : The Vice President : Ministry of State: Speeches: MajorIssues: Links: MediaCenter: ContactUs].

    We will focus Link wherein a drop-down menu displays [Ministries: PublicCorporations: AutonomousAgencies: PRS Lift Liberia: Partners: OtherLinks].Ministries is focused for the purpose of this project.

  • 8/12/2019 Javachat FrontDesk Major-project

    39/109

    33

    The below (figure 9) page is a subset to the Liberian Executive Mansion web site, andit contains all other available web links to Ministries in Liberia. For the purpose of the

    project, we shall use Ministry of Information, Cultural Affairs and Tourism as a testcase.

    Figure 9: Web page with all Government Ministries

    The Information, Cultural and Tourism link redirects to the below(figure 8) webpage. The page contains [HOME:MICAT:MEDIA:MICATSCHOOL]. TheHOME menu contains [ About The Ministry :MICATCONTACT:E-GOVERNMENT:ABOUT LIBERIA :MICATVIDEOGALLERYANDLIVESTREAM].

  • 8/12/2019 Javachat FrontDesk Major-project

    40/109

    34

    Figure 10: A home page of the Ministry of Information, Cultural Affairs and Tourism

    The implementation of a sixth sub-menu to the Home menu is introduced toincorporate the eFrontDesk menu. This menu shall be incorporated also into other web

    pages that are of Government Ministries within Liberia.

    The next snippet is a derived web page illustrating the integration of the new added

    tab:

    Figure 11: eFrontDesk web menu

  • 8/12/2019 Javachat FrontDesk Major-project

    41/109

    35

    The eFrontDesk tab is added to the list of menus to complete partial implementationof the system. Web visitors will encounter the eFrontDesk tab at within the Homemenu. It is listed as the first sub-menu tab; indicating that front desk is the first stopfor information search at any given institution.

    Figure 12: eFrontDesk web page [top view]

    The top view of the eFrontDeskpage showing the Back button that redirects users toall ministries select home page. It has a user login tab and a help tab. User wanting tologin will have to click on Login to join the chat session.

    The eFrontDesk banner has the flag of Liberia and in the inscription eFrontDesk.Below the banner is the info tab which show the current users name, the room name

    and the number of users already logged on to the chat server.

    Figure 13: eFrontDesk web page [bottom view]

  • 8/12/2019 Javachat FrontDesk Major-project

    42/109

    36

    The bottom view of the eFrontDesk page shows the panel of the chat window. TheSend Message! is grayed out until a user is logged in to the with a user name. Afterlogging in, a welcome message is displayed.

    4.1.2 User interface

    The user interface is easy to understand, simple to manipulate, and very flexible.

    Figure 14: chat panel/frame

    The user or users is anyone who logs in to the chat room to ascertain information.Each user will have the option to select a particular bureau or government office for

    which information is needed. All ministries running a web site will have the identicalchat room interface. The banner will contain the name of the chat room (eFrontDesk)and the flag of the Country (Liberia).

    The application will be integrate into all the web pages of each ministry and will haveassigned a front desk officer or Administrator or moderator to respond to users

    queries. Java serves best the purpose for web integration and will run much smoothly.

    banner

    Login

    Info bar

    Chat log

    area

    General chat

    box

    Users pane

    Private

    message

    button

    Ignore button

    Exit chat

  • 8/12/2019 Javachat FrontDesk Major-project

    43/109

    37

    The web page will integrate the .jar file using the following codes:

    Applet failed to run. No Java plug-in was found.

    The application is loaded and the ChatClient.class file is located in the archived .jarfile and run.

    4.2 Security issuesThe Java is secureclich is sparking controversy nowadays, since the recent exploit

    of the Java SE 7. The successful vulnerability attack on the Java platform whichopened doors to numerous intrusions on many corporate and private systems has alsoraised the default setting of the security controls for Java applets to high, preventingWeb-based Java applications from executing inside browsers without userconfirmation. This situation in brings the ease-of-use and security of Java web-basedapplets a little bit of concern.

    Figure 15: chat panel/frame

    This project runs very minimal on high-level security provision based on the scope ofoperation by users. User input handles that are not in any way invasive or confidential.

    Broadcasted information irrelevant to any user at any point in time could be avoided

    by blocking user. Users flooding the chat room is booted or kicked out of the chat:

    if(m_floodFlag){

    SendMessageToClient(ClientSocket,"KICK ");messagearraylist.clear();

    }

    This helps in the reeducation of spammer loggers.

  • 8/12/2019 Javachat FrontDesk Major-project

    44/109

    38

    Administrator has the authority to boot out users who are using the chat room for the

    intended purpose of information distribution and sharing.

    4.2.1 Secure enhancement:With the latest Java 7 Update 21, enabled option we has made it impossible for

    application to forge access to data structures or to access private data in objects that

    they do not have access to. This closes the door on most activities of viruses.

    Some web browsers allow applets to read and write date only to the host that server

    the applet. With the modification, this will let the applet connect only to sockets on

    the computer from which the applet came. The write restriction prevents applets fromplanting viruses or altering important files on the local computer.

    The read restriction does not allow applets to browse files on the local computer for

    sensitive information, such as credit card numbers, open a socket connection to the

    applet host, and write the information back

  • 8/12/2019 Javachat FrontDesk Major-project

    45/109

    39

    5. Implementation and Testing

    This is the next phase right after the Design phase. In this section, the presentation of

    the implementation of this system from client side and server side were separately

    presented. The remodeling, debugging and testing of codes practically took more time

    than estimated, and it ran top-downmodeling.

    With proper planning comes a smooth implementation. For a system that was in place

    being manually traditional, it is wise to plan, but also get the culture of these offices

    which would be using the new system. Most often people tend to build an office

    culture over time in different places. And often it is proven that people in these casesbuild a kind of resistance towards change. If change should be welcomed by the

    people operating the system, they have to be educated as to what level of

    improvement the change will make, how they can become part of the change as agents

    of change, and how the change will affect their lives forever. An example of a change

    resistance could be some front desk personnel who are not computer literate. Change

    would mean joblessness. But planning to training former personnel with necessary

    skills to enhance the workability of the system would be paramount.

    After noting the above points to consider, another factor would be the implementation

    transition. Already that the workers feel a part of the new system, a healthy

    changeover would be a parallel running shift. This parallel changeover between the

    old system and new system would help desk staff take computer classes, and at the

    same time get them training on the new system. This would also be appropriate for the

    programmer to consider other issue relating to efficiency of the system, data

    collection, and resource utilization.

  • 8/12/2019 Javachat FrontDesk Major-project

    46/109

    40

    5.1 Server-client implementation

    The following paragraphs introduced the implementation on server side and client

    side. It presented an overview of the implementation on client side first, and thendescribed the implementations with emphasis on the main features of this system. It

    presented the system into disintegrated components, and units for analysis

    implementation. The server-side is also looked at in similar manner, with snippets

    (snap shots) of system implantation along with importation codes shots.

    The project will be capable of running on any standard Internet web browsers. The

    interface for the project will provide a login feature through a web interface and

    administrative capabilities which will be used by front desk a host of personnel. The

    sole intention is for administrator to provide timely feedback to chatter with inquiry

    on demand.

    Flow Chart: User/chatter

    User chatterHome Page eFrontDesk Login

    Chat with

    Admin

    Chat with

    other user(s)

    LogoutOther

    information

    User visits

    ministry

    website.

    User navigates

    to chat room

    tab in search of

    information.

    User provides a

    unique nick

    name to log on

    to chat system

    User chats with

    admin for

    information.

    User chats with

    other users for

    information.

    User logs out

    when

    necessary

    User might

    browse other

    information on

    web page.

  • 8/12/2019 Javachat FrontDesk Major-project

    47/109

    41

    Flow Chart: Administrator or Front desk officer

    5.1.1 Server-side implementation

    The server-side is implemented with the following classes:

    Class Main method

    1 ChatServer

    2 ChatObject3 ChatCommuniation4 CommonSettings

    Table 3

    The main method complete coding (chatServer) is found in appendix B.

    Administrator Main Page

    [chat server]

    Reports

    Log outBanningChat

    Administrator

    logs on admin

    portion of

    website.

    Admin can see

    a report of all

    concurrent

    users

    Admin can log

    out of admin

    section

    Admin can ban

    a user or boot

    out the user.

    Admin can

    respond to

    chatter inquiry

  • 8/12/2019 Javachat FrontDesk Major-project

    48/109

    42

    ChatServer codes

    Only partial view of code was included in this section. Full source code is located inthe appendices:

    public class ChatServer extends Frame implements Serializable,ActionListener,Runnable,CommonSettings {

    public ChatServer() {/This intializes all components for the chat server/

    this.setTitle("Chat Server");Image iconImage =

    Toolkit.getDefaultToolkit().getImage("images/icon.gif");this.setIconImage(iconImage);this.setResizable(false);this.setBackground(Color.yellow);

    this.setLayout(new BorderLayout());

    //The below snippet shows the outcome of the above coding. The Chat Serveris loaded with background color (yellow).

    Snippet 1

    / Top Panel Coding /Panel topPanel = new Panel(new BorderLayout());topPanel.setBackground(Color.black);Label lblTitle = new Label("CHAT SERVER",1);lblTitle.setForeground(Color.white);lblTitle.setFont(new Font("Helvitica",Font.BOLD,20));topPanel.add("Center",lblTitle);add("North",topPanel);

    / Center Panel Coding /Panel centerPanel = new Panel(null);cmdStart = new Button("START SERVER");cmdStart.setBounds(125,10,150,30);cmdStart.addActionListener(this);centerPanel.add(cmdStart);panel.setBackground(Color.green);

  • 8/12/2019 Javachat FrontDesk Major-project

    49/109

    43

    //The below snippet shows the outcome of the above coding. Starting theserver changes the background color (green), and initiates theactionListener. Start Server button is disabled and Stop Server buttonis enabled.

    Snippet 2

    cmdStop = new Button("STOP SERVER");cmdStop.setBounds(125,50,150,30);cmdStop.setEnabled(false);cmdStop.addActionListener(this);centerPanel.add(cmdStop);add("Center",centerPanel);panel.setBackground(Color.red);

    setSize(400,150);show();

    //The below snippet shows the outcome of the above coding. Stopping theserver changes the background color (red), and stops the actionListener.Start Server button is then enabled and Stop Server button is disabled.

    /Window Closing Event Section/addWindowListener(new WindowAdapter() {

    public void windowClosing(WindowEvent e) {

    Snippet 3

  • 8/12/2019 Javachat FrontDesk Major-project

    50/109

    44

    }});

    }/Action Listener listening to new connection requests/

    public void actionPerformed(ActionEvent evt){

    if(evt.getActionCommand().equalsIgnoreCase("Start Server")){DBProperties = GetDBProperties();/Initializes the Server Socket /

    try {

    serversocket = new ServerSocket(m_portNo);}catch(IOException _IOExc) { }

    /Initializes the Array List /userarraylist = new ArrayList();messagearraylist = new ArrayList();

    /Initialize the thread/thread = new Thread(this);thread.start();

    }

    }

    /Thread Implementation/public void run(){

    /Accepting all the client connections and create a separate thread /while(thread != null){

    try{

    /Accepting the Server Connections/socket = serversocket.accept();

    / Create a Seperate Thread for each client or user/chatcommunication = new

    ChatCommunication(this,socket);

    thread.sleep(THREAD_SLEEP_TIME);}

    }}

    /Function To Send a Message to Client/private void SendMessageToClient(Socket clientsocket,String message){

    }/Function To Get the Object Of Given User Name/private ClientObject GetClientObject(String UserName){

    ClientObject returnClientObject = null;

    ClientObject TempClientObject;int m_userListSize = userarraylist.size();

  • 8/12/2019 Javachat FrontDesk Major-project

    51/109

    45

    for(G_ILoop = 0; G_ILoop < m_userListSize; G_ILoop++){

    }return returnClientObject;

    }

    / Function To for redundant Username /private boolean IsUserExists(String UserName){

    if(GetClientObject(UserName) != null)return true;

    elsereturn false;

    }

    /Function to get the Index of specified User Name/private int GetIndexOf(String UserName){

    int m_userListSize = userarraylist.size();for(G_ILoop = 0; G_ILoop < m_userListSize; G_ILoop++){

    }return -1;

    }

    /Function To Add a New Client in to the Server List/protected void AddUser(Socket ClientSocket,String UserName){

    /If User name exists return/if(IsUserExists(UserName)){

    SendMessageToClient(ClientSocket,"EXIS");return;

    }}/Function To Send Private Message/protected void SendPrivateMessage(String Message , String ToUserName){

    clientobject = GetClientObject(ToUserName);if(clientobject != null){

    SendMessageToClient(clientobject.getSocket(),"PRIV"+Message);

    }

    }/main method

    public static void main(String[] args) {ChatServer mainFrame = new ChatServer();mainFrame.setVisible(true);

    }

  • 8/12/2019 Javachat FrontDesk Major-project

    52/109

    46

    ChatCommunication codes

    Only partial view of code was included in this section. Full source code is located in

    the appendices:

    public class ChatCommunication implements Runnable,CommonSettings{

    / Initialize the Socket to the Client /ChatCommunication(ChatServer chatserver,Socket clientsocket){

    Parent = chatserver;socket = clientsocket;try {inputstream = new DataInputStream(new

    BufferedInputStream(socket.getInputStream()));

    }catch(IOException _IOExc) { }thread = new Thread(this);thread.start();

    }

    / Implement the Thread Interface /public void run(){

    while(thread != null){

    try {

    }

    }

    private void QuitConnection(){

    thread.stop();thread = null;try {socket.close();}catch(IOException _IOExc) { }socket = null;

    }

  • 8/12/2019 Javachat FrontDesk Major-project

    53/109

  • 8/12/2019 Javachat FrontDesk Major-project

    54/109

    48

    {/Initialize the Socket/messagecanvas.ClearAll();messagecanvas.AddMessageToMessageObject("Connecting To

    Server... Please Wait...",MESSAGE_TYPE_ADMIN);

    try {

    }

    }

    private void LoginToChat(){

    / Open the Dialog /dialog = new InformationDialog(this);if (dialog.IsConnect == true){

    UserName = dialog.TxtUserName.getText();

    ServerName = dialog.TxtServerName.getText();ServerPort =Integer.parseInt(dialog.TxtServerPort.getText());

    if(dialog.IsProxyCheckBox.getState() == true){

    IsProxy = true;ProxyHost = dialog.TxtProxyHost.getText();ProxyPort =

    Integer.parseInt(dialog.TxtProxyPort.getText());}else{

    IsProxy = false;}ConnectToServer();

    }}}

    / Key Listener Event /public void keyPressed(KeyEvent evt){

    if((evt.getKeyCode() == 10) &&(!(TxtMessage.getText().trim().equals(""))))

    {SendMessage();

    }}

    public void keyTyped(KeyEvent e){}public void keyReleased(KeyEvent e){}

    / If User Name Already Exists /if (ServerData.startsWith("EXIS")){

    messagecanvas.AddMessageToMessageObject(" User Name Already Exists...

    Try Again With Some Other Name!",MESSAGE_TYPE_ADMIN);

  • 8/12/2019 Javachat FrontDesk Major-project

    55/109

    49

    thread = null;QuitConnection(QUIT_TYPE_NULL);

    }

    SplitString =

    ServerData.substring(5,ServerData.indexOf("~"));tappanel.TxtUserCount.setText("TotalUsers in "+SplitString+" :"+ServerData.substring(ServerData.indexOf("~")+1));

    }

    / Private Message RFC /if( ServerData.startsWith("PRIV")){

    SplitString =ServerData.substring(5,ServerData.indexOf(":"));

    / Function To Send Private Message To Server /protected void SentPrivateMessageToServer(String Message, String

    ToUserName){

    SendMessageToServer("PRIV "+ToUserName+"~"+UserName+":"+Message);

    }

    / Disconnect Chat /private void DisconnectChat(){

    if(socket != null){

    messagecanvas.AddMessageToMessageObject("CONNECTIONTO THE SERVER CLOSED",MESSAGE_TYPE_ADMIN);

    QuitConnection(QUIT_TYPE_DEFAULT);}

    }

    public static void main(String args[]) {ChatClient mainFrame = new ChatClient();

    }

  • 8/12/2019 Javachat FrontDesk Major-project

    56/109

  • 8/12/2019 Javachat FrontDesk Major-project

    57/109

    51

    privatemethod, but it does not give that method any extra meaning. See sample

    from ChatClient:

    private void LoginToChat(){

    / Open the Dialog /dialog = new InformationDialog(this);if (dialog.IsConnect == true){

    UserName = dialog.TxtUserName.getText();ServerName = dialog.TxtServerName.getText();ServerPort =

    Integer.parseInt(dialog.TxtServerPort.getText());if(dialog.IsProxyCheckBox.getState() == true){

    IsProxy = true;

    ProxyHost = dialog.TxtProxyHost.getText();ProxyPort =

    Integer.parseInt(dialog.TxtProxyPort.getText());}else{

    IsProxy = false;}ConnectToServer();

    }}

    One the other hand, Java JIT compiler comes with the virtual machine and is usedoptionally. It compiles the byte-code into platform-specific executable code that isimmediately executed. This kind of execution process enhances rapidity in programsduring runtime. It is suggested by Sun Microsystems that it's usually faster to selectthe JIT compiler option, especially if the method executable is repeatedly reused.

    5.1.4 Storage EfficiencyThe code is embedded with thefinallyblock to ensure that there is no resourceleakage. Not only was this block used for resource retrieval, but also to avoid cleanupcode being accidentally bypassed by a break, continueorreturncode block. Adding

    cleanup code in a finallyblock does much good as it is always a good practice, evenwhen no exceptions are anticipated. See code below:

    Properties DBProperties = new Properties();try{

    InputStream inputstream =this.getClass().getClassLoader().getResourceAsStream("server.properties");DBProperties.load(inputstream);

  • 8/12/2019 Javachat FrontDesk Major-project

    58/109

    52

    inputstream.close();}catch (IOException _IOExc){ }finally /the use of the finally block/{

    return (DBProperties);

    }}

    The project due to time limitation was not integrated a standard database collection

    function. The function if introduced would put the project in to a new planning and

    design phase where new criterion would be made. It will dive deep in to collecting

    more details from chat users at login with would be time consuming and uneasy to

    uneasy to maneuver in the fastest way possible. This enhanced database object will

    promote the ability to create the eRejoinder module of the eFrontDesk application.

    The eRejoinder module is a conceptual concept which would allow users to beforwarded queries reponses to them through email address and contact numbers

    collect during new login process.

  • 8/12/2019 Javachat FrontDesk Major-project

    59/109

    53

    5.2 Testing Approach

    The testing procedure verified each components functionality. An internal and

    external component of the programs is verified, validated for quality and consistency,and to see if the actual outcome of the test is the same as the expected. For the purpose

    of this project, a grey-box testing was used to help identify the correctness,

    completeness, security and quality of the eFrontDesk.

    According to the project description, the final product is a functional chat room

    system, embedded in an HTML page for users access. However, a gray box testing

    method is used to test the functional modules of this system. The aim of testing was tomake the system functional as possible, allowing all the specific needs as prescribed to

    be available.

    The information in figure 5a provides comments and feedback as a result of such

    testing.

    5.2.1 Unit testing:Table 5a: Testing result

    Test # Functionalities Grade Comment

    1 User login and nickname checking 5 Good. The system does not allow duplicate nicknames

    2 Chatting room display 5 The chat room display is set to the size as was declared

    3 Chatting with user(s)/Admin 5 Chatting with users/admin functions as should

    4 Blocking users 5 Blocked/ignored user(s) cannot chat with user who blocked

    5 Chat room users info/display 3 After the 5 user logs in, auto-update of all users is not displayed

    6 Exit chat 5 The chat room closes as anticipated

  • 8/12/2019 Javachat FrontDesk Major-project

    60/109

    54

    Table 6b: Testing result

    5 Chat room users info/display 3 After the 5 user logs in, auto-update of all users is not displayed

    The below piece of code is responsible to publish logged on users to the user canvas. But after 5

    total user counts, the others users after that are not published to the rest of the user logging.

    The first five previously logged on uses will have access to info on a much many users there is.

    This flow was baffling and not rectified.

    if(ServerData.startsWith("LIST"))

    {Tokenizer = new StringTokenizer(ServerData.substring(5),";");

    /Update the Information Label/TotalUserCount = Tokenizer.countTokens();UpdateInformationLabel();

    /Adds a user item into User Canvas/

    tappanel.UserCanvas.ClearAll();while(Tokenizer.hasMoreTokens()){

    tappanel.UserCanvas.AddListItemToMessageObject(Tokenizer.nextToken());

    }

    5.2.2 Integrated testing:

    Table 7: Test result

    Test

    #

    Module tested Test done Approach Result

    1 Web interface Run HTML page in web browser Unit good

    2 Server side module Run server app without connect anyclient. Server application listens for

    connection

    Unit good

    3 Client side module Run client app to check for login

    functionality workability

    unit Workable

    4 Client/Server communication Initiate both client/server app to check

    server is listening and accepting

    connection requests from clients

    Integrated good

    5 Data storing module incomplete unit bad

    6 Full system Run HTML client to connect with server Integrated unsuccessful

  • 8/12/2019 Javachat FrontDesk Major-project

    61/109

    55

    5.3 Modifications and Improvements:

    After testing with not much confusion, the following is noticed:

    The HTML client page is unable to connect to server.This is because the embedding the application into an HTML file restrict thelistening capability of the applet. The embedded code did not include a port and ipaddress of the host/local host. See code below and modifications:

    This was modified to:

    // Sending the IP address and port number of the server to the telnetapplet as a parameter

    A test was done to ensure that the 1436 was open. See figures below:

    Figure 15: Telnet port listening at 1436

    The user pane does not update users information after a 6 thusers is logged in.

  • 8/12/2019 Javachat FrontDesk Major-project

    62/109

    56

    The rest of the users will see all users even if there are more than 10 users, but the6thto X users will see only 5 or 6 users who are logged in. Due to time constrain,not much could be done to rectify the error.

    6. Results and Discussion

    6.1 Results overviewThe development of a Java platform chat room as an online front desk system wassupported by sufficient findings during the data collection phase. The study tells usmany people did agree that it is actually difficult in getting to various ministries, aswas indicated in the problem statement (See figure 16). But ambiguously, reportshowed that most of the respondents do not go to the any of the various ministries forinformation. Some of whom are already visiting the ministry and or are employees ofthe ministries.

    Figure 16:

    Quite significantly, the results from the study concurred that bringing all theinformation retrieval process to a central hub and using technology to do that would

    be very significant (See figure 17 and figure 18).

    0

    1

    23