Opage Framework for Web Based Content Management Systems
Total Page:16
File Type:pdf, Size:1020Kb
Die approbierte Originalversion dieser Diplom-/Masterarbeit ist an der Hauptbibliothek der Technischen Universität Wien aufgestellt (http://www.ub.tuwien.ac.at). The approved original version of this diploma or master thesis is available at the main library of the Vienna University of Technology (http://www.ub.tuwien.ac.at/englweb/). Master’s Thesis oPage Framework for Web based Content Management Systems carried out at the Information Systems Institute Distributed Systems Group Technical University of Vienna under the guidance of Priv.-Doz. Dipl.-Ing. Dr.techn. Engin Kirda by Johannes Dorn Weintraubengasse 7/4, A-1020 Vienna Matr.Nr. 9326012 Vienna, 28th of February, 2008 Acknowledgements I like to thank my advisor Priv.-Doz. Dipl.-Ing. Dr.techn. Engin Kirda, who has been a great help for me to improve my thesis, and was very generous every time I missed my deadline. I owe a great deal to Gernot Ihrybauer for his creative input in the design process of oPage and for the lasting friendship. I still remember our tempered discussions at the Extone. I have to thank my customers and the users of the oPage framework for their feedback and support. Special thanks also go to Dr. Eva Ptak for her wise and humorous advocacies. If you have troubles writing, visit the writers’ studio of Mag. Judith Wolfsberger or one of her courses. Her advices made writing my thesis less complicated. I am deeply grateful to my beloved girlfriend Christine, who encouraged and pushed me to complete this master thesis and finish my studies. I am sure, I would not have accomplished it without her sympathy and her support. And I would have a lot more misspellings in my thesis. A big “hello, I did it” goes out to my parents and all my former school mates and university colleagues. Yes, I did it. Yes! Yes! Yes! Hannes Dorn Vienna, Austria, February 2008 Abstract oPage is a framework for developing Web based content management systems. It is more specific than a general purpose framework like ASP.NET, but more flexible than content management systems like TYPO3 or Joomla!. Web sites using oPage can run on every platform, where both PHP and MySQL are available, and are divided into the core system, the backend and the frontend. The core system contains the framework base classes and can be shared among different projects. The backend provides the user interface for administering the Web site and managing the content. The frontend is individually created for each Web site and can be customized and extended as needed. oPage uses a database access layer and modules to store the content. For each type of structured content, a module class is used. Modules can be combined to represent the database structure and provide operations to create, retrieve, update and delete records and also operate as a report generator. The user interface can be extended by navigation, pager and form controls. In the controller script, the module and control objects are tied together. The content is queried with the module and merged with the template engine, which renders the output using page and content layout templates. The robust infrastructure, the versatile template engine, the structured backend and the provided modules and controls make oPage a good foundation for Web sites. BibTeX @mastersthesis { opage, author="Hannes Dorn", title="oPage- Framework for Web based Content Management Systems", school="Technical University of Vienna", year = "2008", month="February", address="Vienna, Austria" } i ii Zusammenfassung oPage ist ein Basissystem (Framework) für die Entwicklung von Web-basierten Content Management Systemen. Es ist spezifischer als ein allgemeines Framework wie ASP.NET, aber flexibler als Content Management Systeme wie TYPO3 oder Joomla!. Websites, die oPage verwenden, können auf allen Betriebssystemen laufen, für die PHP und MySQL verfügbar ist, und sind unterteilt in einen System-Kern, das Backend und das Frontend. Der System-Kern enthält die Basisystemklassen und kann in beliebigen Projekten verwendet werden. Das Backend stellt die Benutzeroberfläche für die Verwaltung der Website und die Bearbeitung des Inhalts zur Verfügung. Das Frontend wird für jede Website individuell erstellt und kann entsprechend angepaßt und erweitert werden. oPage verwendet eine Datenbank-Abstraktions-Schicht und Module zum Speichern des Inhalts. Für jeden Inhaltstyp wird eine eigene Modulklasse verwendet. Um die Datenbankstruktur abzubilden, können Mod- ule auch verschachtelt werden. Die Modul-Basisklasse stellt Methoden zum Erzeugen, Lesen, Aktualisieren und Löschen von Datensätzen bereit und arbeitet auch als Report-Generator. Die Benutzeroberfläche kann mit Navigations–, Pager- und Formular-Elementen (Controls) erweitert werden. Im Ausgabeprogramm (Controller) werden die Modul- und Control-Objekte zusammengefügt. Der Datenbankinhalt wird mit den Modulen gelesen und an die Vorlagen-Verarbeitung (Template Engine) übergeben, die eine Webseite basierend auf Seiten- und Inhaltsvorlagen erstellt. Die robuste Infrastruktur, die flexible Template Engine, das strukturierte Backend und die zur Verfügung gestellten Module und Controls machen oPage zu einer guten Basis für Websites. BibTeX @mastersthesis { opage, author="Hannes Dorn", title="oPage- Framework for Web based Content Management Systems", school="Technische Universität Wien", year = "2008", month="Februar", address="Wien, Österreich" } iii iv Contents 1 Introduction 1 1.1 Internet Services.......................................1 1.2 Web Terminology.......................................2 1.3 Motivation...........................................4 1.4 Problem Definition......................................6 1.5 Organisation of this thesis...................................7 2 Web Content Management Systems9 2.1 Content Management.....................................9 2.2 What is a WCMS....................................... 10 2.3 WCMS roles......................................... 13 2.4 WCMS functions....................................... 13 2.5 Web Content management systems.............................. 20 2.6 Goals for oPage........................................ 32 2.7 Summary........................................... 33 3 oPage Framework 35 3.1 Structure............................................ 35 3.2 Website............................................ 36 3.3 oPage Core.......................................... 39 3.4 The factory class....................................... 50 3.5 The template engine...................................... 53 3.6 CContent, a generic content module............................. 60 3.7 CApp............................................. 63 3.8 CModul............................................ 64 3.9 CPage............................................. 73 3.10 CWebpage........................................... 73 3.11 CControl........................................... 75 3.12 CNavigation.......................................... 75 3.13 CMail............................................. 78 3.14 CForm............................................. 80 3.15 CPager............................................. 83 3.16 Administration........................................ 85 3.17 Advanced topics........................................ 96 3.18 Summary........................................... 107 4 Evaluation 109 4.1 Operating system....................................... 109 4.2 Installation.......................................... 109 4.3 Web compatibility....................................... 109 4.4 Search engine optimization.................................. 109 4.5 User interface......................................... 110 4.6 User management....................................... 110 4.7 Security............................................ 110 4.8 Software architecture..................................... 111 4.9 Application programming interface.............................. 111 4.10 Performance.......................................... 111 4.11 Lessons learned........................................ 112 5 Future Work 113 5.1 Installation.......................................... 113 5.2 Template Engine....................................... 113 5.3 Multilanguage resources................................... 114 5.4 Automatic checking of external links............................. 114 5.5 Access statistics........................................ 114 v 5.6 Plugin System......................................... 114 5.7 Workflow........................................... 115 5.8 Backend homepage...................................... 115 5.9 Summery........................................... 115 6 Conclusion 117 References 119 List of Tables 121 List of Figures 123 Listings 125 A Appendix 127 A.1 PHP.............................................. 127 A.2 Coding Standards....................................... 127 A.3 Directory structure...................................... 131 A.4 Administration interface templates.............................. 133 A.5 CMS feature comparison................................... 137 B About the Author 151 B.1 Education........................................... 151 B.2 Professional career...................................... 151 vi 1 Introduction Since the first Web site has been written by Tim Berners-Lee1 on November 13th in 1989 at the European Organisation for Nuclear Research (CERN) and the development of the browser “Mosaic for X” by Marc Andreessen and Eric Bina2 in 1993 the popularity of the Web rised tremendously. At the time of writing, Netcraft3 reports 155,230,051