|
NuSphere PhpDock case study
|
Youthpass case study
by Matthias Pigulla, Webfactory GmBH
This case study describes webfactory's development and implementation of a software tool, Youthpass, that generates PDF (Portable Document Format) documents from structured data gathered in a wizard-like input process. What make this procedure and application unique, are that the software is written entirely in PHP and it is not only used online as a web application, but can also easily be installed on any Windows computer for offline use. The tool features a user interface similar to traditional Windows applications, which is achieved through the employment of AJAX (Asynchronous JavaScript and XML) techniques.
The case study first summarizes the requirements for the software. Next the design is described and based on that, the following section highlights several implementation aspects. The last section gives a brief conclusion about the project.
Requirements
A tool was needed to create "Achievement Reports", a document for volunteers taking part in the European Voluntary Service (EVS). These reports are part of a suite of recognition and certification procedures called "Youthpass" currently being developed by SALTO-YOUTH on behalf of the European Commission. Youthpass aims at fostering the recognition of non-formal learning within the European Commission's YOUTH programme by formally recognising and certifying the results participants achieve. Youthpass will be used in 31 programme countries and the partner countries of the European Union.
SALTO-YOUTH wanted to have the Achievement Reports completed by the volunteers together with their host organisations in a dialogue process that would also serve as a starting point for discussing the volunteers' achievements. Another requirement was the ability to split the process into several sessions and save the intermediate and final results for a later use.
It had to be ensured that the documents adhere to the officially defined structure and that they can be created easily by host organisations throughout Europe. Guidance and detailed instructions are important to assure a fair reviewing process and comparable results.
Design
In general, Youthpass employs web applications that generate documents; in this case all documents are PDF. This type of generation ensures traceability of the documents created and PDF upholds the document content as PDF documents are difficult to edit. The Youthpass web applications are part of the SALTO-YOUTH website (http://www.salto-youth.net) built on a LAMP (Linux, Apache, MySQL, PHP) platform.
For the particular requirements of Achievement Reports, however, a web application would not have been sufficient: Due to the interactive creation process, review sessions can take several hours. Since many of the host organisations have very limited resources and cannot afford prolonged online sessions, providing only an online solution would have seriously reduced the acceptance of the tool. On the other hand, the tool should not be limited to offline use; in other host organisations the local installation of software is only done by administrators, which complicates the installation process thus limiting the acceptance for the opposite reason.
Hence, a solution was sought that could be run online as well as offline without leading to redundant development efforts.
Webfactory suggested to use PHP5 as the programming language and to choose NuSphere's PhpDock as the offline runtime environment. PhpDock facilitates offline deployment of PHP applications in Windows environments. Utilizing PhpDock was especially convenient because it lead to the deployment of a single code base to online web servers and offline computers. Moreover, with many different online applications already written in PHP at SALTO-YOUTH, using PHP for this application allowed PHP to be retained as the single programming language.
Basically, PhpDock combines a web server, PHP and an Internet Explorer component in a single, yet small executable file. PhpDock, which can be started like an arbitrary .exe file, renders web applications in a single window, as the user would expect from a "normal" application. In the background, PHP is used to generate the pages. The PhpDock approach provides PHP developers with the same environment and the request/response paradigm they are familiar with. If done correctly, the same application code can be deployed online or offline without modifications.
Implementation
Via PhpDock, the software could essentially be implemented as an HTML form that is submitted to a PHP script generating the PDF file.
The wizard-like user interface with context-sensitive help for every input field was implemented using AJAX and the Prototype framework (http://prototype.conio.net). AJAX was also used to save or retrieve user inputs. This setup allows for creating automatic backup copies; while the user/s continue filling out forms, snapshots of the work are saved in the background. Should the user accidentally close the browser (in case of online deployment) or the PhpDock (offline deployment) window, almost the same state of the document would be presented to him/her upon signing in again.
In this project careful encapsulation of data persistence had to be taken care of. When the user wishes to save the work and resume the session later on, the offline version saves this information locally on the hard disk. The online version, however, is integrated with the SALTO extranet and needs to handle several users concurrently, isolating one from another. To manage these issues, persistence was implemented using a MySQL database.
Another task was to find a portable way of creating the PDF documents. The Youthpass web applications in place at SALTO-YOUTH rely on Java and Apache FOP (Formatting Objects Processor) for this purpose. This solution, however, would have been too complex to configure and it would have induced too many additional requirements for offline installations. webfactory chose FPDF (http://www.fpdf.org) instead because it is entirely written in PHP and does not depend on any other external libraries. Writing a simple templating system to create uniformly stuctured PDF documents was quite straightforward.
The software was also prepared for localized deployments in all European languages using the gettext library integrated with PHP.
In order to distribute the offline version, all necessary elements were packed up using the InnoSetup installer (http://www.jrsoftware.org/isinfo.php). This way, users choosing to install the offline version must only download a single .exe file - approximately 1MB in size - from the SALTO-YOUTH extranet. The installer unpacks PhpDock, PHP, FPDF and the application itself into a target directory and sets up a link in the user's start menu.
Conclusion
PhpDock proved to be a very good platform for the given requirements. However, it should be noted that PhpDock is currently available only for Windows environments, so Macintosh and Linux users will not be able to use offline applications based on PhpDock. For the given task though - providing an online and offline version that can be used arbitrarily - this was not a problem, as Macintosh and Linux users can still resort to using the online version.
The software is currently being tested in selected EVS projects throughout Europe. Initial feedback shows that the solution is very easy to install and to use and that the generated documents are of high quality. In Fall 2006, the software will be extended to generate additional types of documents.
About webfactory
Webfactory GmbH (http://www.webfactory.de) is a software development company founded in 1997 and located in Bonn, Germany.
Based on their own web application framework, wfDynamic, webfactory implements high-quality software solutions for both the professional and the public sector. Clients include Lufthansa AG, Revios Life Reinsurance, the German National Agency of EU's YOUTH Programme, the SALTO-YOUTH European network of Resource Centres, and the German Federal Centre for Health Education (BZgA).
About SALTO-YOUTH.net
SALTO-YOUTH is a network of eight resource centres throughout Europe. It provides youth work and training resources like a training calendar and a tool box and organises training and contact-making activities on behalf of the European Commission to support the implementation of the European Commission's YOUTH programme. SALTO-YOUTH's services are used by the 31 YOUTH programme countries and the partner countries of the European Union.
The SALTO-YOUTH website (http://www.salto-youth.net) as well as the extranet functionality and additional internal coordination tools are based on webfactory's wfDynamic framework on top of PHP5 and MySQL 4.1. wfDynamic provides content management and related back-end functionality (e. g. user and permissions management) together with an website (front-end) engine that allows for building individual, yet integrated, online applications.
|
|
Download NuSphere PhpDock
Download a free trial of the unique Php Deployment Solution from NuSphere.
|
Buy NuSphere PhpDock now
PhpDock - unique solution for php deployment - is available from our online store front.
If you're PhpEd user your price is $86 - discounted automatically during the checkout
|
Spotlight
|
People say
"Utilizing PHPDock was especially convenient because it lead to the deployment of a single code base to online web servers and offline computers. Moreover, with many different online applications already written in PHP at SALTO-YOUTH, using PHP for this application allowed PHP to be retained as the single programming language."
|
|