scieee AI-readable full text Open interactive document viewer

System administration, design and development of an application to register and maintain project related data

Martínez Illán, Alberto

Full text

FINAL DEGREE PROJECT TITLE TFC: System administration, design and development of an application to register and maintain project related data. DEGREE: Telecommunication Engineering with specialization in Telematics AUTHOR: Alberto Martínez Illán DIRECTOR: Pablo Royo Chic DATE: June, 18th 2009 Título: System administration, design and development of an application to register and maintain project related data. Autor: Alberto Martínez Illán Director: Pablo Royo Chic Fecha: 18 de Junio del 2009 Resumen LHS Telekommunikation GmbH & Co es una empresa que instala sistemas de tarificación de llamadas en todo el mundo. La empresa tiene una estructura divisional para cubrir los proyectos según su procedencia. Las divisiones de la empresa suelen tener en funcionamiento diversos proyectos al rededor del mundo, de los cuales han de gestionar el personal, los gastos asociados al proyecto por desplazamientos, las direcciones de contacto y muchos otros aspectos. Para ello, la empresa cuenta con una aplicación basada en Microsoft Access y una base de datos Microsoft SQL. Esta aplicación ha servido durante años a la empresa para satisfacer sus necesidades pero en la actualidad el volumen de datos acumulado ha hecho que el manejo de estos por parte de la herramienta sea excesivamente lento. De aquí nace la necesidad de crear una aplicación mas rápida y con nuevas funcionalidades. Para solucionar este problema se plantea una aplicación Web que permite la gestión de los proyectos, clientes, trabajadores, direcciones de contacto, conocimientos del personal, ficheros, gastos asociados a proyectos, peticiones de personal y otros aspectos. Usando una aplicación web logramos centralizar la información en una aplicación que no requiere instalación, rápida y ampliable. Que mediante la generación automática de e-mails de alerta podra también lograr dinamismo en los procesos de petición de personal. También será segura porque establecera permisos de usuario mediante los cuales filtrará determinadas acciones y información a estos. Y incluirá la función simple pero útil de generar resúmenes sobre los proyectos activos mediante interfaces web o mediante documentos PDF. Esta memoria explica: la administración de sistemas asociada al proyecto, los requerimientos, el contexto/historia sobre el cual se desarrollo la aplicación, tecnologías y herramientas elegidas para esta, su desarrollo , la instalación/configuración del entorno de desarrollo, la arquitectura, el diseño de la base de datos y finalmente se extraen unas conclusiones de todo el proyecto. Para ello se utilizaran diversos recursos que se irán viendo a lo largo de esta memoria. Title: System administration, design and development of an application to register and maintain project related data. Author: Alberto Martínez Illán Director: Pablo Royo Chic Date: June, 18th 2009 Overview LHS Telekommunikation GmbH & Co its a company which install billing systems around the world. The company has a divisional structure to cover the projects depending of their location. The divisions from the company usually has started several projects around the world at the same time. They have to manage resources, travel expenses, contact agendas and many other aspects of it. For that the company had one application based on Microsoft Access and a Microsoft SQL database. This tool served to cover the division requirements for years but with the time the data volume make it each time slower. From this issue comes the necessity to create a new tool, faster and with new features. To solve this requirement its proposed a Web application. This application will be able to manage their projects, costumers, employers, contact addresses, knowledge belonging employers, files, project associated expenses and other aspects. Using this architecture we have a centralized point where all the information its located in a tool that doesn't require installation, fast and easy to use. This application will be able to provide a more dynamic way of requesting employers with automatically email notifications when a request will be triggered. It will be safe because different user rights will be provided to filter actions and information. And also will include a simple but useful functionality to generate an automatically web or PDF report with an overview of the current active projects. This memory explains: the system administration associated to this project, the requirements, the context/history where the tool was made, technologies and used tools for it, it development, the installation/configuration from the development environment, the architecture, the design from the database and finally there also a conclusions. For that purpose the document uses some resources that the reader will find in all this document. Dedico este proyecto a mi hermano pequeño Sergio, para que luche siempre en la vida que tiene por delante. A todos aquellas personas que confían en mi. A Jaime Bauzá Andreu. A mi familia y amigos. A LHS-Ericsson, por darme la oportunidad de trabajar con ellos, en especial a Achim Krewer, Roger Eickhoff, Detlef Purschke y Hartmut Lademacher. Finalmente, dedico el proyecto también a todo el sistema público de enseñanza, porque hace que nuestra sociedad sea mejor. I dedicate this project to my younger brother Sergio, because he always have to fight in the live he have in front. To all the people who believe in me. To Jaime Bauzá Andreu. To my family and friends. To LHS-Ericsson, because they gave me the opportunity to work with them, specially to Achim Krewer, Roger Eickhoff, Detlef Purschke and Hartmut Lademacher. Finally, I also dedicate this project to the public school system, because it make a better society. INDEX INTRODUCTION. WHY TO CHOOSE A WEB SOLUTION................................1 1. CONTEXT WHERE THE PROJECT WAS DEVELOPED AND PROJECT HISTORY............................................................................................................3 1.1. Chapter purpose...................................................................................................................3 1.2. Project context and history.................................................................................................3 2. SCOPE AND REQUIREMENTS.....................................................................6 2.1. Chapter purpose...................................................................................................................6 2.2. Scope.....................................................................................................................................6 2.3. Requirements........................................................................................................................6 3. HIGH LEVEL TOOL DEFINITION...................................................................7 3.1. Chapter purpose...................................................................................................................7 3.2. Tool definition.......................................................................................................................7 3.2.1. Name........................................................................................................................7 3.2.2. User view of product use...........................................................................................7 3.2.3. Users definition........................................................................................................10 4. USED TECHNOLOGIES...............................................................................13 4.1. Chapter purpose ................................................................................................................13 4.2. Used technologies..............................................................................................................13 4.2.1. Development environment.......................................................................................13 4.2.2. Web application.......................................................................................................16 5. DEVELOPMENT ENVIRONMENT................................................................20 5.1. Chapter purpose ................................................................................................................20 5.2. Tools used for creating the development environment..................................................20 5.2.1. Linux server ............................................................................................................20 5.2.2. Shell scripting...........................................................................................................22 5.2.3. Apache.....................................................................................................................23 5.2.4. Exim ........................................................................................................................26 5.2.5. Named/bind..............................................................................................................25 5.2.6. Subversion...............................................................................................................26 5.2.7. ViewVC ...................................................................................................................26 5.2.8. Cron.........................................................................................................................27 5.2.9. Bugzilla................................................................................................................... 27 ACRONYMS AND ABBREVIATIONS AcronymDescription ASP Active Server Pages BIS Business Information System BSCS Business Support and Control System BTS Bug Tracking System CSS Cascading Style Sheets CVS Concurrent Versions System DBData Base DMZDe-Mitilarized Zone DNSDomain Name System EXIMEXperimental Internet Mailer) FPFix Price HTMLHyperText Markup Language HTTPHyperText Transfer Protocol HWHardware IPInternet Protocol JS JavaScript MVCModel View Controller NETNew Employee Ticket OO Object Oriented PDProject Day PDOProject Delivery Office PHPPHP Hypertext Pre-processor PINPersonal Identification Number PMOProject Management Office, Project Management Officer POProject Order RMSReporting Managing System SiSoSystem Integration Sourcing Overview SMStaff Manager SQLStructured Query Language SRS Software Requirements Specifications SSHSecure SHell SVNSubVersion SWSoftWare SWTStandard Widget Tool T&MTimes & Material UMLUnified Modelling Language URLUniform Resource Locator VPNVirtual Private Network XSS Cross Site Scripting System administration, design and development of an application to register and maintain project related data 1 INTRODUCTION. WHY TO CHOOSE A WEB SOLUTION. Any company which has/makes projects has to handle resources. A resource could be a worker, can be a fly ticket, can be a taxi or a server computer, a resource could be many things. If we add to this differences in the meaning of resources for the different companies the fact that each company has a established work flow, we have that the project management will be totally different in one company than in other. This is an appropriated environment for a customized tool. Depending on the size of these projects the way to administrate the resources or getting information can be different. For that, small companies may be have enough with excel sheets or with a Microsoft Access application, but for medium or big companies with big projects running, this is not the best option. A good choice for that purpose its a web based application. This type of tools doesn't need installation for final users, are easy to use and worldwide join able, and with the existing web servers and database servers they can support a big number of users and a big volume of data. For that and seeing the tool will be used for a medium/big company a web application its a good choice. Here we will explain the main goals of web tools and also their main issues, seeing at the end that this issues are not relevant for this project. Cross platform compatibility. Most web based applications are far more compatible across platforms than traditional installed software. Typically the minimum requirement would be a web browser of which there are many. (Internet Explorer, Firefox, etc). These web browsers are available for a multitude of operating systems and so whether you use Windows, Linux or Mac OS you can still run the web application. A Web tool doesn't require users installations. Web based systems need only be installed on the server placing minimal requirements on the end user workstation. This makes maintaining and updating the system much simpler as usually it can all be done on the server. Any client updates can be deployed via the web server. Join-able worldwide easily. Run anywhere from Internet Explorer, at the office, in a different office, at home, on-site, in a hotel, or wherever you are. Its available 24-7 round the clock, round the world. Reduced costs: Many open source frameworks that really helps the developer. Open source web/database servers developing tools and languages. Very common architecture which means many free support on the Internet. The conclusions of that its Web based applications have come a long way and now offer competitive advantages to traditional software based systems 2 allowing businesses to consolidate and streamline their systems and processes and reduce costs. But Web applications have some issues coming from security. This problems can be: Remote code execution. As the name suggests, this vulnerability allows an attacker to run arbitrary, system level code on the vulnerable server and retrieve any desired information contained therein. Improper coding errors lead to this vulnerability. SQL injection. SQL injection is a very old approach but it's still popular among attackers. This technique allows an attacker to retrieve crucial information from a Web server's database. Depending on the application's security measures, the impact of this attack can vary from basic information disclosure to remote code execution and total system compromise. Format string vulnerabilities. This vulnerability results from the use of unfiltered user input as the format string parameter in certain Perl or C functions that perform formatting, such as C's printf(). Cross Site Scripting (XSS). The success of this attack requires the victim to execute a malicious URL which may be crafted in such a manner to appear to be legitimate at first look. When visiting such a crafted URL, an attacker can effectively execute something malicious in the victim's browser. Some malicious Javascript, for example, will be run in the context of the web site which possesses the XSS bug. For that project this security issues are not that relevant. This application will be used in a DMZ so will just be able to run under the local network from LHS. This is not a problem to join it in other divisions because this ones are joining the same local network using VPNs. Employers on site have also VPN connection. It its very improvable that this tool could be attack by employers but if the tool had to be served to the Internet network this risk had to be present on the development process. Any way the development with a framework also provide security in that aspects so this are not a big issues for that project. System administration, design and development of an application to register and maintain project related data 3 1.CONTEXT WHERE THE PROJECT WAS DEVELOPED AND PROJECT HISTORY 1.1.Chapter purpose On the following lines will be described the project context to understand the decisions and tools used. Like the project its done in a company many decisions had to be taken with some departments and users. This aspects are explained here and are important to understand the project. 1.2.Project context and history LHS is a software company part of the Ericsson group. Their costumers are typically telephone companies around the world like Orange Spain or Nextel in Mexico. Client Services Department is the one which handle the installations/customizations/maintenance of the main product from the company, a billing system called BSCS. They basically have to take the generic BSCS developed by the Architecture and Development teams and install and adapt it on costumers locations. This department had the requirement to implement a new tool to have a faster and more efficient way to handle their project staffing cases. I arrived to LHS during 2008 summer. Before my arrival was triggered a message to all the departments. This message was that an inter ship student with telematics knowledge was free to work during summer months. Then one department, Client Services, after seen my CV request me to start with this idea they had. This idea was to start SiSo version 2(SiSo is the name of the tool, means System Integration Sourcing Overview) version 1 was the Access based one. They suggest me the project and I accepted. After my assignment to this project, I arrived to Frankfurt where the company has their European main location. This was when I started with this project but not with my final thesis. They didn't had to introduce me into the company because 2007 summer I also been working in another project and I known the company department structure and the work flow from then. First day, they introduce me into the Client Services Department because last year I was in LHS in other department. Then they showed me the SiSo v.1 to try to explain me how the old tool was. After that we had a meeting to decide which tools we could use to developed the new version. I purposed to use PHP to generate the dynamic HTML code. JavaScript to interact with users with alerts messages and control of errors (this is a typical error because JavaScript functions can be modified by the user and you can overpass their logic rules). CSS to set the web styles. MySQL server to handle the database. Apache Web Server to work with the PHP interpret and serve the html requests. 4 LHS suggest me to use Oracle and Java Servlets to generate the code but I thought that this wasn't a big application to justify this technologies which some are also privative (Oracle) and the other one Java Servlets container (Tomcat server) uses many computer resources to this type of application, which has to be used by 50 or 60 people in peak of users. We chosen my alternative because all was a very common technologies, also free ones, and we also had a lot of support on the Internet. The company provided like a requirements sheet a document with a high level description of their main needs. They also told me I was free to create my own application structure if the application was intuitive and easy to use. Since then, first of July from 2008 I'm involved in this project, during the summer months full time (8 hours a day 5 days a week) and later in partial time, 8 hours a week from Spain. The thesis started in November 2008 when UPC accept this project but with the requirement to base it on MVC software pattern and Object Oriented PHP. This month, I started to work in Spain in the thesis till 15 of April when I went back to Germany to focus in a full time mode on the thesis. Lets go back to the project and not to the Thesis. At the beginning, the firsts 3 or 4 months the tool was only developed by me. I had problems because before I used some time HTML and CSS but not to used in a production environments, and I was afraid to don't be at the expected level. Later on, also my boss Achim Krewer start to developed some functionalities like a calendar to introduce the dates in the inputs, and also a Gantt chars views. At the beginning I found some ways to handle the files structure searching on the Internet and also how to handle the authentications. Inside the company I had the support from a database expert to check my tables purposed structures. I asked support in PHP but the company experts where focus more in Java Solutions and I didn't had it, this was a issue for me but I could follow because Internet was full of support for this technology. After all summer developing the main structure from the tool was finish, but many details and some functionalities more had to be done. Also many bugs had to be checked and repaired. For that I purposed the company to following working with the project with part time dedication from Spain, and they accept that. During the summer months and 2 or 3 months more I used my personal laptop to allocate the web server and the PHP interpret to develop, and a company server to allocate my work backups in a typical directory structure from the company. After that I learned in the university how to work with subversion and also I listened some other useful tools like Bugzilla. This is when I really started with my final thesis. I rented a virtual machine Linux based and I had SSH access with root level. Like playing, and with out telling anything to my boss, I installed a subversion server there, and I used the Apache to served with authentication. I also installed a repository web viewer (ViewVC) to use a web System administration, design and development of an application to register and maintain project related data 5 interface to see the work was done in the repository. I set up a DNS server to generate sub-domains to then serve this different applications, I set a Bug Tracking System called Bugzilla(I known that LHS used also this one in their projects) and also I served SiSo application from this virtual machine. To serve SiSo in the virtual machine I couldn't do it serving from the repository directly, I had to run Cron (a programmed script luncher) to run a script in the virtual machine to update the web directory the Apache served for SiSo with the last repository version. I also ran a script I made with the run levels from my personal computer. I set SSH authentication based on public key and the script could log automatically into the virtual machine to make a dump from the subversion repository and copying it in my home machine. I also set a naming politic to just make this action once a day and to identify the backups by date. This was because I switched of every day my computer several times and I didn't want to download each time all the repository backup. Then the development environment was ready to start. With it we finished the web application started on July 2008 and we installed into production. After that I started with the MVC and PHP OO architectures version to use for the thesis. For that I found this very famous framework called CakePHP which provides MVC architecture pattern to develop PHP applications. I tried some examples and I found how it was working, so I decide it to use it. It was very fast to migrate the tool with this framework. After the development of the database, the framework provided a shell to connect to the database which created all the basic data models, basic controllers and basic views. I just had to rename the existent database structure with the CakePHP conventions and this shell made automatically all the folders with the views, the controllers and it models. So this was very fast(when I get how it worked, I've been some time trying to understand the framework). Then I had to create the relations between the different data models(this also took some time, I made some mistakes and then I has problems retrieving data). And after that,I had to import the HTML views from the old tool to this one and to stablish in the controllers site the PHP logic before was done in the same views or in scripts or functions. When the tool was migrated to the framework environment I started this memory. This was a bit the history and the context of this project. About the system administration tasks I made I have to tell that I had many issues and problems during the installations/configurations but at the end I could solve all of it and I think this was a very good knowledge I get from this project. I understood many common problems and tasks in projects handling and actual and common tools to handle this questions. I also learned about backups to provide security in productive environments making it automatically. And also I learned this famous framework CakePHP. 12 on it but with out defining the exactly rights for each view. This table was done after the application was finished. User rights: a - User can add d- User can delete e - User can edit i - User can index v - User can view c- User can make the action with conditions. (xx)c means xx actions are conditioned also. Components/View Group AGroup B1Group B2Group B3 Start page v-ev-ev-ev-e Main v-i vc-icvc-icvc-ic Projectsi-a-e-d-v(i-a-e-d-v)c(i-v)c(i-a-e-d-v)c Project specific information i-a-e-d-v vc vc vc Project administrative/logistic information i-a-e-d-v vc vc vc Project financial information i-a-e-d-v vc vc vc Project resource request i-a-e-d-v(i-a-e-d-v)c(i-v)c(i-a-e-d-v)c Project edit resource request i-a-e-d-v(i-a-e-d-v)c(i-v)c(i-a-e-d-v)c Resourcesi-a-e-d-v(i-a-e-d-v)c(i-v)c(i-a-e-d-v)c Resources administrative i-a-e-d-v(i-a-e-d-v)c(i-v)c(i-a-e-d-v)c Resources contract cyclei-a-e-d-v(i-a-e-d-v)c(i-v)c(i-a-e-d-v)c Resources logistic requirements i-a-e-d-v(i-a-e-d-v)c(i-v)c(i-a-e-d-v)c Reportsi-v(i-v)c(i-v)c(i-v)c Options Self Optionsi-e-d-vi-e-d-vi-e-d-vi-e-d-v Options Usersi-a-e-d-v(i-a-e-d-v)cNo rightsNo rights Options Groupsi-a-e-d-vNo rightsNo rightsNo rights Options Permissionsi-a-e-d-vNo rightsNo rightsNo rights Figure 4: User rights by views. System administration, design and development of an application to register and maintain project related data 13 4.USED TECHNOLOGIES 4.1.Chapter purpose On this chapter we justify why we where using each technology used in this project. For each one we will make a short description to introduce the reader in the uses of it. In each technology also will be explained the alternatives to evaluate why the chosen technologies are better for that project. 4.2.Used technologies 4.2.1.Development environment 4.2.1.1. Linux server To develop this project I used a virtual machine with a Linux Debian distribution. This distribution is very famous in Linux world and its known than important corporations like Google, IBM or HP use Debian internally or incorporated to their products like HP in their t5735 thin-client device. I decided to use it because I had knowledge using it like my usual operative system. It also has one of the best packaging system in the world and an incredible amounts of software with more than 25000 different pieces of free software. Debian its also very easy and fast to install. 4.2.1.2.Cron Default scheduled script launcher in Debian Linux distro. Also very common an typical in all the Linux machines. Very easy to use. For this reasons I have chosen this application. Usually its used to lunch automatically backup scripts, but its also used for many other purposes. In this project I used for this automatically backups if I would had a second Linux machine to interchange backups from one server to the other. But I had to do that with my personal computer which is not always ON, and I had to run the backup script with the run levels when the machine was booting. I used Cron to automatically make updates from the repository and to be able to serve with Apache the last SiSo application on the repository each 5 minutes (you can not serve an application directly from the subversion repository). 4.2.1.3.Named Complete DNS server which its very common and has many examples or tutorials of how to use it on the Internet. I use it also for that reasons. I used to create subdomains and serve the different applications the virtual machine was running at the same time: Subversion repository served with Apache. http://sisosvn.cerb.es ViewVC viewer of subversion repository. 14 http://sisoviewvc.cerb.es BTS Bugzilla from the project. http://sisobug.cerb.es SiSo web version 1 http://siso.cerb.es SiSo using CakePHP framework. http://sisomvcoo.cerb.es 4.2.1.4.Exim Exim its a very known email server that its considered very easy to install and to set. There is alternatives to it like Postfix. But the Postfix has a harder installation process than not Exim. For that and because Exim was enough to can send emails from this server with the PHP interpret I choose Exim. Figure 5: Exim logo. 4.2.1.5.Subversion and ViewVC Subversion its a version control system for files. A group of files can be a software projects, for that Subversion can be used to maintain a version control system to handle software projects. A common system to do the same its CVS (Concurrent Version System) but its like the father of Subversion and has some defects than Subversion doesn't have. I choose subversion because its a very common tool, its free and its better than CVS in terms of storage space(it just collect the differences between versions, CVS not, it stores the complete file). Its also helpful in order to maintain the project, and the only alternative to this its to handle manually your projects which its definitively worse because like this you don't have version control. Once you have your repository you can browse it with the Apache subversion web browser , but it is very rudimentary. A good and simple way to browse a repository its ViewVC, much more better than the Apache functionalities to do the same. System administration, design and development of an application to register and maintain project related data 15 Figure 6: View of SiSo repository viewer. Its a very fast way to see the changes in one file from one revision to other (deleted/added/modified code lines) and also the user who made the change, the hour when the revision was done, the comments, etc. And alternative to this is to use Trac, the problem was to set up this application. I read on the Internet that its not easy to install compared with ViewVC. The good thing from Track its that it is a repository viewer and also a Bug Tracking System. But I also known that the BTS Bugzilla was also a good tracking system. The company also uses Bugzilla for their projects so I decided to use Bugzilla and ViewVC. 4.2.1.6. BTS Bugzilla Standard Bug Tracking System in the company. It was created and used for the Mozilla project. Its very easy to use, easy to install and also not difficult to make backup procedures with it. 4.2.1.7.Eclipse PDT Free code editor for PHP projects. Its one of the more famous and anyone who is in software world knows about it. It has big set of plug-in to customize it to our 16 needs. It has a plug-in to connect it to a subversion server or a subversion repository served from Apache that really helps the developer to work in a very fast way if there is a local Apache serving the workspace from the Eclipse where the developed project its located. There is many editors also to develop but Eclipse its one of the more famous ones, it has many functions that really helps you: automatically formatting your code, automatically close HTML tags, and a large etcetera. 4.2.2.Web application Now, the development environment its finished. Lets go to explain the application technologies. This project its not a huge application to handle a very important data like can be the system used in a bank. It is a quite simple application. We choose free solutions always we can because they are covering our requirements. And the cost of it its free. Usually this free solutions have many free support on the Internet to learn about how they work. 4.2.2.1.HTML Marked language interpreted by a web browser and displayed to the final user. Normally HTML code its served from a server to a host with the HTTP procedures. This language will be our final step to display and interface to the final user. HTML is widely used with a centralized/star structure client-server where the server is this central part of a star. A network stablish the connection between the server and the client. There is many alternatives like use a Java client with SWT graphic libraries to provide this but not with a centralized point of logic where all the application intelligence is done for all clients, HTML yes (if you combine it with PHP, Ruby, Python ). With this technology we don't need user installations and we don't have to take care of which operating system the user has. This language its independent that the operative system because its interpreted by a HTML browser which its a need in all actual operative systems. For that reasons we chosen this technology. 4.2.2.2.PHP PHP its and interpreted language, a type of languages are not compiled. There is an interpret which reads the code and follow it instructions. This provides interdependency of the architecture where its running. The PHP code will be the same for a Unix machine, or for a Windows machine, or other ones with other operative systems, the only thing has to be changed its the interpret. This language. Runs on server side and its widely used to generate dynamic HTML code. PHP interpret its very very fast interpreting the PHP code with a low computer consume. One of its rivals its Java Servlets used widely with the same capabilities but with moderated-hight computer consume coming from its interpret, the Java Virtual Machine. I chosen PHP because its more optimal from the computer consume point of view. It is also very common and for that there is many System administration, design and development of an application to register and maintain project related data 17 frameworks done to work with it. The both languages are also very common and there are a lot of support on Internet for both. There is also the Phyton, Perl, and privative solutions like ASP, etc. But if you search a bit on the Internet you find than PHP was created to generate Web applications and Perl not, Perl its done for a wide variety of purposes. So the common functions to use in a Web application environment(our case) are usually more simple in PHP than in Perl. For that, for a small Web tool like this one, PHP its better, also in the Internet its known than the hosting companies always provides more hosting for PHP sites than not Perl ones. This is because the big number of hosting demands on the internet are coming from small/medium Web sites and people usually prefers PHP to develop that sites. PHP also can be use in the in Object Oriented developing paradigm. This increments the modularity of software. That means your code its more independent from his self and this brings re-usability. You can use many software from others because this software will run independently of your code and it will not disturb your code providing you functionalities, that will save your time. You will also be able to use your own objects and its functions in other software, saving your or others time. A language Object Oriented also has more security on the management of variables. The variables are the objective, the methods just make logical functions to arrive to one result which will be stored in one value. The data is safer in OO because you can set the transparency of it to the other software parts. For that I used also this pattern to design this project. 4.2.3. MVC and OO Framework CakePHP MVC (Model View Controller) its a software pattern for developing applications breaking in some way the relations the logic (controller), the interfaces (views) and the data structures(model) have one from the others. Its very recommended to use this way of developing in order to have a product where everything its independent. This means freedom to change the database server system you use because there is a better one which fits better to your requirements. This means that every thing its modular. Easily you can change some of the parts if its need (the views, the models or the controllers). Figure 7: MVC diagram. A framework its a software structure already defined where other project can be organised and developed. 18 But why to use a framework? You can also don't use it. A framework allow the developer to concentrate his self in the application he have to create. The framework implements many usual functionalities that all the projects needs and are common. This can be: security, data validation, files structure,... for that its always faster to develop an application with a framework than with out it. Like always has also some issues: the developer needs a period to learn how it works, the framework some times uses more resources than needed( it makes more SQL statements to the database,...) and also its not very transparent (depending on the framework its more or less), some times the developer doesn't know how the framework works and he can not understanding the way of acting of it. But this negative things are known by the developers from the framework and they also allow the users to control it. So lets say than the problems the framework can be minimized if the developer has the appropriated knowledge in the way to use it. Then, if the developer has this knowledge using the framework its extremely better to use a framework than to not use it. Figure 8: CakePHP logo. I choose CakePHP because its one of the more popular and with more support on the internet. Some of the best qualities of it are than it has a console that connects the developer to the database and from it (if the database use the framework conventions in naming) allows the developer to construct in minutes all the skeleton of his application. It creates the generic models, views and controllers. From this console you can also stablish simple data validation or relations between data models. To retrieve the data from the database its also one of the better things from it. Its extremely easy to find data. The framework also collects the related data to the one you request to it, so if you request a resource, the framework bring a result-set with the country name of this resource, the contacts information from it,... Other good point of this framework its the data validation. Its very easy to stablish data validation rules. Other alternatives to CakePHP in PHP world are CodeIgniter or with Ruby programming language RubyOnRayls. CakePHP its lighter than RubyOnRayls, its also more common and there is more support for it. With CodeIgniter we have less features but a lighter framework. Both of them have similar communities, so they have similar support on the internet. At the end I chose CakePHP because it has more functionalities already preprogrammed for the developer and this means less time if you use it. System administration, design and development of an application to register and maintain project related data 19 4.2.3.1.Apache web server The Apache web server has like rival the ISS web server from Microsoft and also many light weight web servers like Fnord or others a bit more bigger. Like we did before we choose the more common and free alternative. There is many free web servers to can use, but the more famous one its Apache. With it we will have for sure many support on the Internet. Apache its also very light weight web server and like a told before its widely used with PHP and MySQL to create small/medium web sites on Unix environments. 4.2.3.2.MySQL MySQL its a SQL database server application which listens on a port to receive SQL statements. It is widely used with PHP and other technologies, its a free solution and its very fast and famous on the database server world. Alternatives for that technologies are: in free solutions world PostgreSQL , in the privative world Oracle or MicrosoftSQL. There are more database servers but this where the main ones. We chosen MySQL because its the free solution more common. It has many applications to use with it in order to design the database structure, more than PostgreSQL. PostgreSQL its a more hight level database server, more like Oracle with functions oriented to objects. The problems has PostgreSQL are: its less popular(has less free support on the Internet), its two or tree times slower than MySQL and uses more computer resources. Its also very known on the Internet than Apache, MySQL and PHP are working very nice together and PHP has more functions to work with MySQL than with Postgres. For that reasons MySQL is better for this project. 20 5.DEVELOPMENT ENVIRONMENT 5.1.Chapter purpose On this chapter its describe in a short way the development environment. I just provide and overview in each technology because its what its need to see the basic configuration of it. I also know there are books for one of this technologies. Here I will show some configuration files and also will be explained a bit this common technologies. 5.2.Configuration of used tools 5.2.1.Linux server A Linux Debian distribution was used like server to allocate all the development environment. The chosen distribution was on release 5 under the name Debian Lenny. Log into the virtual machine its done with SSH but I block the user root to access over SSH because its the first user name an attack use to try to log in a Linux machine, by brute force or other attacks. This is show in the next configuration file from the SSH daemon. Its located in /etc/ssh/sshd_config, this part is where you can restrict the user root to having access over SSH. Figure 9: Part of the SSH daemon configuration file. I have a normal user which I use to log into the machine over SSH. I also use this non root user to make the backup procedures. For that the user can log with password authentication or with a public key stored into the server. This are the steps to provide public key authentication: Client machine: We create the same user in the machine has to get the backup (in that case my personal computer). # adduser user Create on the user home a directori called # mkdir /home/user/.ssh We provide correct permisions to the folder. # chmod 700 /home/user/.ssh We generate the RSA keys. System administration, design and development of an application to register and maintain project related data 21 # ssh-keygen -q -f ~/.ssh/id_rsa -t rsa Then a passphrase will be asked in order to encrypt the private key. We will leave it empty to don't encrypt it because other wise the backup will ask every time the passphrase to unencrypt the private key. Then we will have 2 keys id_rsa (private key) and id_rsa.pub(public key). Server machine: We create in the user home the .ssh directory. # mkdir /home/user/.ssh We copy the id_rsa(private key)= into the server .ssh directory. # scp /home/user/.ssh/id_rsa user@server_url:/home/user/.ssh/ We put the key into a file called authorized_keys. cat id_rsa.pub > authorized_keys And then we can restart the sshd. /etc/init.d/ssh restart With this configuration user can log with out password authentication and make automatically backups with public key authentication. Some more configuration on the Linux server its the installation location. For applications like Bugzilla or ViewVC I used /opt/ directory. To allocate the repositories I did it in the /home/user/svnrepos/ . 28 reported. And like its logical the user has to create the products, the versions and the parts where the application which its debugged has. I also set the Apache authentication module for this application in order to have more security but here was not need because Bugzilla also take care of that(if you configure it fine). Here its the parameters site served by the Bugzilla , the full parameters file located into /opt/bugzilla-3.2.3/data/params will be attached in the annexes: Figure 18: Bugzilla parameters. On this parameters is where the admin have to set the constrains to this Bugzilla installation. Its quite important to set and read all the parameters because they set important aspects from the Bugzilla. System administration, design and development of an application to register and maintain project related data 29 6.APPLICATION DESIGN 6.1.Chapter purpose Here will be describe the application design. Also we will describe how the framework works in a high level point of view. The intention here its to show the structures from the application and also from its data. 6.2.Framework CakePHP Each framework handle in their own way many aspects that makes the differences between the others. This aspects can be the directories and files structures or many others. In a very simple way, CakePHP can be represented with this diagram: Figure 19: CakePHP diagram. 1)If you click the link pointing to http://www.sisomvc.cerb.es/projects/edit/3, and his browser makes a request to the web server. 2)The dispatcher checks the request URL (/projects/view/3), and hands the request to the correct controller. 3)The controller performs application specific logic. For example, it may check to see if you are logged in. 4)The controller also uses models to gain access to the applications data. Models usually represent database tables, but they could also represent LDAP entries, RSS feeds, or files on the system. In this example, the controller uses a model to fetch your project information for the project with id=3 from the database. 5)Once the controller has worked its magic on the data, it hands it to a view. The view takes this data and gets it ready for presentation to the client. Views in CakePHP are usually in HTML format, but a view could just as easily be a PDF, XML document, or JSON object depending on the developer needs. 6)Once the view has used the data from the controller to build a fully rendered view, the content of that view is returned to you're browser. 30 Almost every request to the application will follow this basic pattern in CakePHP framework. 6.3.Application work-flow 1. UML use case diagram Simple use case diagram where we can simply get how the applications works in a very hight level definition of it. It really provide a fast way to understand for what its used the tool. Figure 20: Use case diagram. The normal user will have this basic options: View projects/resources/companies on detail or in a list. Create new projects/resources/companies.  Depending on the user type it will have some options to set, and admin will have all the options. System administration, design and development of an application to register and maintain project related data 31 6.4.Application work-flow 2. UML sequence diagram This diagram describes how the final user will interact with the tool to used normally and how the tool will work internally to process the actions triggered by the user. Figure 21: UML sequence diagram. What we can see here its like the controllers have all the logic from the application. The application has a controller for its selve. Its a kind of global controller to define in some way the application reactions. On it what we define its reaction to the different Users. A User with access to some controller will be able to pass and to call the controller with the global controller agreement. The blue coloured bar its the only thing the user sees in his process using the tool (in yellow). 32 6.5. Class relations. Simple UML class diagram. Here its is shown the application class diagram with out attributes and methods. Figure 22: Simple UML class diagram. System administration, design and development of an application to register and maintain project related data 33 Seeing the last UML diagram we find in an easy way all the class relations. With that, the join tables are also implicit. I couldn't set all the attributes and methods from each class because its almost impossible in a din A-4 page but all the attributes are located into the database structure in next page. The main methods of the application are this ones: Index function its always used to make a list with the records from the database belonging to the class from where its called. function index() { } The view function display the record on detail with the corresponding $id and from this class. function view($id = null) { } This introduces a new record into the database for the corresponding class. function add() { } Seen the last functions its trivial what this two functions do. The edit function retrieve the data from one class and allow the user to edit it. function edit($id = null) { } More than the same. This function deletes the record with the id=$id. Always from data belonging to his class. function delete($id = null) { } But the application is not just that. There is around 15000 lines of code. There is many business logic on the back, to send automatically emails, to generate PDF files, to stablish the security depending on the user group and permissions. But just one of this functions(view/edit/index/add/delete) have in average around 100 lines of code so a controller can have in average 500-600 hundred because there is more functions than this ones. Each data model can have 200 or more lines of code and a single view 300 lines of HTML code. This with out taking on mind the CSS style sheet with almost 700 lines of code or the JavaScript file with functions. 34 6.6. Database structure All tables from the application and their attributes. Figure 23: Database diagram. System administration, design and development of an application to register and maintain project related data 35 The database its composed by 27 tables. On this diagram we see the hole database tables and attributes. The relation between data are implicit in the UML diagram on Figure 22 which correspond to this database (its also very difficult to fit the relations on this page space ). 6.7.Folder and files structure The projects files structure its this one: After downloaded and extracted the project, these are the files and folders: app cake vendors .htaccess index.php README There are three main folders: The app folder will be where the developer work. Its where the applications files are placed. The cake folder is where the framework core its located. Finally, the vendors folder is the place for third-party libraries are need to be used by the application. CakePHPs app folder is where it is the application development. If we look a little closer at the folders inside of app. configHolds the (few) configuration files CakePHP uses. Database connection details, bootstrapping and core configuration. controllersContains the applications controllers and their components. localeStores string files for internationalization. modelsContains the applications models, behaviours, and data-sources. pluginsContains plugin packages. tmp This is where CakePHP stores temporary data. The actual data it stores depends on how you have the framework configured, but this folder is usually used to store model descriptions, logs, and sometimes session information. vendorsAny third-party classes or libraries should be placed here. viewsPresentational files are placed here: elements, error pages, helpers, layouts, and view files. webroot In a production set-up, this folder should serve as the document root for the application. Folders here are also serve as holding places for CSS style-sheets, images, and JavaScript files. 36 This is a real view from the file structure. Figure 24: File structure. In the Annex location a complete file list from the project its available for the reader. This file structure its established by the framework. All the rules and conventions established by the framework make the application a bit dependent of it but also they make it standard. Any future developer for this application will be able to search on the Internet the file structure of this framework and to know how works this application because it follows the conventions the framework stablish. System administration, design and development of an application to register and maintain project related data 37 6.8.Application views In this part we will show some representative views the user will display in his screen using the tool. Here will be visible the application and how friendly is it with the final user which will have to use it daily. Login view. First view the real user will find try to access to the application. Figure 25: Login form. On it the user will always have to introduce his login data to be able to use the tool. The admin email its automatically retrieve from the database for the user who has the master admin flag. Just one user from the application can have this flag. This is checked automatically by the users controller to avoid two users with this flag active. The year from the footer message its also maintained automatically by the function date from PHP. 44 7.CONCLUSIONS 7.1.Objectives revision and functional requirements With this application its possible to handle projects, resources and customer/companies with the application. It have functionalities like the PDF generation that was not a need but its also useful.All the data introduced by the user its validated to test if its coherent with the last customized validation rules in the market preprogrammed in the CakePHP framework . All the system administration I made was very helpful for the project and also was not a need for the company but I save their resources time by handling all the things related to the project like: the bug system we used for the already in production firs Web version, the BTS Bugzilla, SubVersion, automatic backups system for Subversion and Bugzilla database and configuration files,... I introduced an advanced framework to develop Web applications which is based on the last software design patters. For that the result its a robust, modular, flexible and extensible application. I introduced three parties software like the JavaScript options menu which really help to navigate in the application. An one of the big deals of it its than the tool is thought to be used by all LHR- Ericsson divisions around the world to manage their projects with this 4 different types of users with their respective rights. All the dependencies deleting projects/resources/companies are implemented in order to have consistent data in the database and also in the file structures related to uploads. The project its already tested with 1000 projects 1000 resources and 1000 customer with complete data in the entries emulating real projects. I created scripts to generate random data into the database in Mozilla browser its shown in the source code view the time the tool used to handle this volume of data. After that the results are positive and the tool its not slow. Retrieving data in the more time consuming ways takes: 1.3948s to index all the projects 0.607s to retrieve a view page from a project 1.1982s to index all the resources 0.2133s to see the detail view from a resource 1.345s to index all the companies 0.5235s to retrieve a company This values also can be better If the recursive level is tuned on the find methods for each data type. I think I accomplished the main requirements. Just two of then are not done and it is because I didn't hat enough time to finish them. This are: have to be done a blocking system to constrain the editing view for one project/resource/company if other users its also editing the same record. And also a log system have to be introduced to track user actions. I think this functionalities are not very difficult to implement. System administration, design and development of an application to register and maintain project related data 45 First one can be implemented using a blocking flag in the record. If in the database, the record its block with this flag, any user would be able to edit it. To set/unset the flag we can use the action of opening the view and a timer. When a user would display the record a timer can start to count, after, lets say 30 seconds of inactivity, the user would be redirected and the blocking flag inactivated in order to allow other users to use this edit view for this record. This is also a good way because if a user goes to the edit view and close his browser the record will remain blocked. A timer resolve this issue. The log system its a table on the database which collects the updates, the inserts and deletes from each user and the date of the action. In each action we want to log we have to save an new entry in this table. This two systems will be introduced also in next steps. 7.2.Conclusions This is my third real project. The first one went to production but was much more simple. The second one its possible to say than was the first version from SiSO (the one already on production) and my thesis was the third one. I can take many conclusions of it because I really made a lot of work in the thesis and also in the first SiSo project. In the thesis I think I worked more than the double of hours are expected to make for a normal thesis in my studies so I really learned a lot. 7.2.1.Technical and personal conclusions In that sense I learned many things related to systems administration in real productive environments. This was the main goal for me because this is 100% useful to work in other sites. I learned from typical issues in web applications and I learned how to develop projects with a famous framework. I learned about the the debugging process debugging the first application. Here there is a capture of it (there is some bugs also to be cover, but we wait because the company want to migrate to the new tool): Figure 32: Real Bugzilla for first web base SiSo. 46 My the technical conclusions are nice, I worked a lot, a lot, but I learned a lot also. Very positive and proud from my self about what I learned and I did. The best of all was the day I arrive to Germany on April 2009 and I saw the first SiSo on a meeting from the project managers in a room with glass walls where anyone could saw from the outside. This was very emotive for me. All my hours I made where helping at the end to LHS-Ericsson in their daily work. What was also great was to come Germany and to work in an international environment. I don't speak a word in German and this is because the language here its English and this is because people from around the world work here, so was really amazing to have the opportunity to work together with this people. 7.3.Future guide lines I will introduce some new functionalities they are into the productive tool on this new version, because this thesis finish here but the project not. This are functionalities like the automatic Gantt-Chart generation in relation to project resources. Here there is also a capture from the production environment: Figure 33: Real Gantt-Char in production from first web base SiSo System administration, design and development of an application to register and maintain project related data 47 About the main future steps for this thesis are to go into production and also to migrate the current data form the other tool to this one. For doing that I think to create some PHP script in the same way I create the others to map the data from one database to the other one. For that I will take a copy from the production environment database to doesn't affect the production data in any way. I will also have to do that during weekend in order to can block the production environment to don't have problems with data synchronization(I users introduce new data while I migrate the data to the new system this data will be lost I f they are allow to create this data). Another future step will be to introduce the tool to LHS-Ericsson other divisions (LHS-Americas, LHS-ASIA and LHS-Global). 48 BIBLIOGRAPHY [1] Debian <http://www.debian.org/> [2] CakePHP API <http://api.cakephp.org/> [3] CakePHP Documentation <http://book.cakephp.org/> [4] Predeveloped software for CakePHP <http://bakery.cakephp.org/> [5] MySQL <http://www.mysql.com/> [6] ViewVC <http://www.viewvc.org/> [7] W3schools <http://www.w3schools.com/ > [8] Support for CakePHP in Google Groups <http://groups.google.com/group/cake-php> [9] Eclipse PDT project <http://www.eclipse.org/pdt/> [10] CakePHP IRC chanel <#cakephp @ irc.freenode.net> [11] Debian manuals <http://www.debian.org/doc/user-manuals> [12] Desarrollo web <http://www.desarrolloweb.com/> [13] PHP <http://www.php.net/manual/en/> [14] Creating PDF files with CakePHP <http://bakery.cakephp.org/articles/view/creating-pdf-files-with-cakephp- and-tcpdf> [15] Sending HTML mails with CakePHP <http://bakery.cakephp.org/articles/view/sending-email-with-phpmailer> [16] Eguíluz Pérez J., Introducción a JavaScript: Libro digital. <http://www.librosweb.es/javascript/index.html> [17] Tutorial about UML diagrams. <http://atlas.kennesaw.edu/~dbraun/csis4650/A&D/UML_tutorial/diagrams.h tm> [18] Setting virtual hosts with Apache. <http://www.debuntu.org/2006/02/22/7-virtual-hosting-using-apache-2> [19] Setting a DNS server with Debian. <http://linux.justinhartman.com/DNS_Installation_and_Setup_using_BIND9> [20] Setting a Subversion repository with Debian and Apache. <http://www.debuntu.org/2006/05/20/54-how-to-subversion-svn-with- apache2-and-dav> [21] How to use Eclipse Subversion plugin. <http://www.ibm.com/developerworks/opensource/library/os-ecl- subversion/> [22] Install and configure Exim. System administration, design and development of an application to register and maintain project related data 49 <http://blog.edseek.com/~jasonb/articles/exim4_courier/exim4.html> [23] Eguíluz Pérez J., Introducción a CSS: Libro digital. <http://www.librosweb.es/css/index.html> [24] Bugzilla migration steps. <http://vijaylad1905.wordpress.com/2009/03/25/bugzilla-migration/> [25] Linux shell scripting. <http://www.freeos.com/guides/lsst/> [26] Eguíluz Pérez J.,Introduction to CSS: Digital book. <http://www.librosweb.es/css/index.html> [27] For DataBase administration from MySQL. <http://dev.mysql.com/downloads/workbench/5.1.html> 50 ANNEXES The annexes are composed by a couple of content which is relevant for the application. This content is the requirements document, configuration files and some other relevant stuff. 1.LHS requirements overview document. System administration, design and development of an application to register and maintain project related data 51 52 System administration, design and development of an application to register and maintain project related data 53 60 'sendmailnow' => 1, 'shadowdb' => '', 'shadowdbhost' => '', 'shadowdbport' => '3306', 'shadowdbsock' => '', 'showallproducts' => 0, 'shutdownhtml' => '', 'smtp_debug' => 0, 'smtp_password' => '', 'smtp_username' => '', 'smtpserver' => 'localhost', 'specific_search_allow_empty_words' => 0, 'ssl' => 'never', 'sslbase' => '', 'strict_isolation' => 0, 'supportwatchers' => 0, 'timetrackinggroup' => 'editbugs', 'timezone' => '', 'upgrade_notification' => 'latest_stable_release', 'urlbase' => 'http://sisobug.cerb.es/', 'usebugaliases' => 0, 'useclassification' => 0, 'useentrygroupdefault' => 0, 'usemenuforusers' => '0', 'useqacontact' => 0, 'user_info_class' => 'CGI', 'user_verify_class' => 'DB', 'usermatchmode' => 'off', 'usestatuswhiteboard' => 0, 'usetargetmilestone' => 0, 'usevisibilitygroups' => 0, 'usevotes' => 0, 'utf8' => 1, 'webdotbase' => 'http://www.research.att.com/~north/cgi-bin/webdot.cgi/ %urlbase%', 'whinedays' => 7 ); Figure 35: Bugzilla complete parameters file. This file contains the main configuration from the Bugzilla. All this data can be edit it here by someone which access rights in the server where the installation of the Bugzilla its done, or some one with Bugzilla rights from the same Bugzilla application. System administration, design and development of an application to register and maintain project related data 61 4.Database random data generation scripts This are 3 scripts I create to generate data to test the application. They generate 1000 records for projects, resources and companies. This is a important step in order to see the volume of data the application can handle. <?php include("connect.php"); for($i=0;$i<1000;$i++){ switch(rand(1,7)){ case 1: $project_name="BSCS installation"; $project_type="External"; break; case 2: $project_name="BSCS modification"; $project_type="External"; break; case 3: $project_name="Migration to BSCS"; $project_type="External"; break; case 4: $project_name="BSCS support"; $project_type="External"; break; case 5: $project_name="BSCS customization"; $project_type="External"; break; case 6: $project_name="Internal tool"; $project_type="Internal"; break; case 7: $project_name="Project with a partner"; $project_type="Tbb"; break; } $string="INSERT INTO projects (code,company_id, name,status_id,country_id,type) VALUES ('pc". $i."',".rand(1,200).",'". $project_name."',".rand(1,3).",".rand(1,245).",'". $project_type."');"; //echo $string; mysql_query($string); } mysql_close($db); ?> Figure 36: Script to generate 1000 projects. 62 <?php include("connect.php"); for($i=1;$i<1000;$i++){ switch(rand(1,6)){ case 1: $c_type="'Not known"; break; case 2: $c_type="Consultant"; break; case 3: $c_type="Senior consultant"; break; case 4: $c_type="Black listed"; break; case 5: $c_type="Asociate consultant"; break; case 6: $c_type="Principal consultant"; break; } $string="INSERT INTO resources (code,name,last_name,company_id,division_id,team_id, country_id,expert_level, notes) VALUES ('RC".$i."','Name ". $i."','Last_name ".$i."', ".rand(6,1000).",".rand(1,4).", ".rand(1,9).",".rand(1,245). ",'".$c_type."','Notes for company ".$i."' );"; //echo $string; mysql_query($string); } mysql_close($db); ?> Figure 37: Script to generate 1000 resources. <?php include("connect.php"); for($i=1;$i<1000;$i++){ switch(rand(1,4)){ case 1: $c_type="External"; break; case 2: $c_type="External"; break; System administration, design and development of an application to register and maintain project related data 63 case 3: $c_type="Partner"; break; case 4: $c_type="Contractor"; break; } $string="INSERT INTO companies (prefix,name,description,number_workers,type,notes, country_id) VALUES ('PC". $i."','Comapnyname ".$i."','Company description ".$i."', ".rand(1,1000).",'".$c_type."','Notes for company ". $i."',".rand(1,245)." );"; //echo $string; mysql_query($string); } mysql_close($db); ?> Figure 38: Script to generate 1000 customers. Seen the scripts we see that many data its set by random functions. Also its visible and include of a script which connects the script to the database. In this connection script there are configured the database name, the URL from the host, and the user/password to use it.