1CGI::XMLApplication 2 3How To Install? 4 5The installation should be perlish 6 7perl Makefile.PL 8make 9make test 10make install 11 12CGI::XMLApplication requires the XML::LibXML and XML::LibXSLT module. 13Both modules are available on CPAN. 14 15What is CGI::XMLApplication? 16 17Perl modules to implement OO CGI-Scripts with XML capabilities in 18Perl similar to CGI::Application. It is not related to CGI::XML 19(than it would be CGI::XML::Application) and does share its features. 20 21CGI::XMLApplication is not a simple addon to CGI.pm! I think there 22is no simple and fast way to convert existing CGI scripts. This is 23basicly because of the gap of main concepts and paradigmata between 24CGI.pm and CGI::XMLApplication, although CGI.pm is the SUPER class of 25CGI::XMLApplication. 26 27Why is there so much broken english? 28 29The original code and documentation has been writtin in 2003/4 and 30the documentation shows my poor English back then. 31If you find the documentation offending to the English language, please 32nudge me via RT.cpan.org and ask me to improve a particular section. I 33will see to it that I will improve the documentation. An even 34better approach is to create a pull-request on github that corrects the language. 35 36Behind the scene. 37 38While most CGI-Scripts are embedded into larger web based applications 39the scripts themselves usually do not represent this fact. The 40evolutionary grown mosaic of an traditional CGI-Script assembly style 41application cannot easily be extended with certain features, relevant 42to the application in general. 43 44CGI::XMLApplication is an application framework to implement 45CGI-Scripts in Perl without the overhead of a complete Perl 46application. The framework should hide most of the important, but 47redundant code of a Perl CGI-Application shared by several 48scripts. Since CGI.pm is a very powerfull module to implement CGI 49scripts it is used as a super class of CGI::XMLApplication. This 50should make the implementation of new scripts usinge this class easy, 51since the whole Interface of CGI.pm is still available. There are some 52conceptual changes, basicly related to the response that reflect 53concepts of XML/XSLT. This has the effect, that most output functions 54of CGI.pm are not very usefull if used from this class ;) 55 56The module have especially been written to enable Perl newbees to 57write full featured CGI-Scripts and CGI applications. To make things 58more easier readable for people, the CGI:OO module forces the 59programmer to implement the application rather problem-orientated than 60programm-code-orientated. 61 62Using such concepts makes it much easier for people, who want to 63understand the code -- and usually they are forced to --, to follow 64the structure of the application. In larger software projects this is 65a very important aspect. 66 67Using the object and problem orientated application programming 68paradigma makes it possible to develop a certain (web based) 69application aloing its structure, not along the restraints of its 70primary programming language. The CGI::XMLApplication concept opens the 71possiblity to port the application to another programming language 72(like C++ or Java) more easily. This aspect is quite important if a 73port has to be done -- be it for performance or any other reasons. 74 75Why should I use it? 76 77If you are planning to implement a single script CGI application, that 78should do a very simple job, CGI::XMLApplication is probably not what 79you are looking for. More commonly Netslaves like us are forced to 80implement fully grown web based applications consisting of a set of 81more or less isolated CGI-Scripts. Each script having a default 82behaviour, for example doing something after an event like a button 83being pushed or a link beeing followed by the client. If you know a 84little about CGI-Scripts, you may already have recognized that scripts 85look amazingly similar in their principal function-set. Most of the 86scripts may have quite similar implementations of the same basic 87requirements they should fulfill. That being a potential source for 88redundancy and painful hours debugging. This is there 89CGI::XMLApplication comes in -- a problem oriented application 90framework to avoid redundancies and to facilitate easier portabilty of 91Perl based CGI applications. 92 93Where is the difference to CGI::Application? 94 95This question is quite important, since CGI::Application was discussed 96on the Web a lot at the time I wrote this module. The main difference 97I see, is that CGI::XMLApplication includes the XML paradigma of 98dispairing data and datapresentation. 99 100The second major difference is, that a perl programmer does not have 101that much freedom on the programm structure. Yes, CGI::XMLApplication 102is rather strict for perl standards. I realized in my daily work that 103this freedom causes a lot of problems in midsize or large web-based 104applications. 105 106The less obvious difference is how the data presentation is 107done. While CGI::Application uses the "propritary" perl format for 108data presentation, CGI::XMLApplication uses by default XML and XSLT, 109which are standardised. This leaves the oportunity to change the 110programm code and even the programming language, but leaves the data 111model untouched. New output formats can be added without changing 112the entire code. 113 114Old-school CGI scripts will have most allways quite a lot print calls 115(or at least some thing similar). All these calls are related to the 116field of data persentation, usually a job done by designers or HTML 117programmers. Both modules CGI.pm and CGI::Application include such 118formating functions. A perl coder using CGI::XMLApplication does not 119need to bother about the data a client will finally see. Therefore, 120formated output calls as they are used in CGI.pm and CGI::Application 121doesn't make much sense with CGI::XMLApplication. Presenting data is 122handled via XSLT Stylesheets. The script has to care only about the 123data, which should be kept in a XML-DOM. So a script programmer 124can pass data to a stylesheet and does not care about the output 125anymore. 126 127As well CGI::XMLApplication implements a stricter application 128structure, than CGI::Application. CGI::XMLApplication handles script 129initialization, functionality, cleanup and data output is strictly 130separated parts of the script. 131 132Code repository 133 134I moved the code to GITHUB with Version 1.1.4. Please, make a pull request 135if you suggest changes to the code or the documentation. 136 137The code is available here: 138 139https://github.com/phish108/CGI-XMLApplication 140 141Contributors 142 143CGI::XMLApplication includes contributions of the following developers. 144 145 * Michael Kröll 146 * Kip Hampton 147 * Gregor Herrmann 148 * Lucas Kanashiro 149