Upload
ottokar-gesch
View
105
Download
0
Embed Size (px)
Citation preview
Univ.-LektorDipl.-Ing. Dr. Markus Schranz
staatlich befugter und beeideter Ingenieurkonsulent für Informatik
Web Application Engineering & Content ManagementWeb Application Engineering & Content Management Übungsteil zu 184.209 VU 2.0 Übungsteil zu 184.209 VU 2.0
Übungsergänzungen zur Vorlesungan der Technischen Universität WienWintersemester 2006/2007
2ZT Schranz Informationstechnologie KEG
Web ApplikationsmanagementWeb Applikationsmanagement
Application Server– [Forrester Research:] „An application server is
a software server product that supports thin clients with an integrated suite of distributed computing capabilities. Application servers manage client sessions, host business logic, and connect to back-end computing resources, including data, transaction, and content“
Web Application Server: – Wenn die Server-Komponente (ausschließlich) per
Web-Server aufgerufen wird. Java Application Servers, z.B.: Servlet Engines Perl Application Servers, z.B.: Mason
Web Application Server
3ZT Schranz Informationstechnologie KEG
Mason: ein PERL-basierter Web Application Server
Mason Web Application Server– moderne Konzepte zum technischen
Web Service Management
– Lösungen für typische Site Development und Management Probleme
Wartbarkeit, Performance, Zuverlässigkeit caching, debugging, templating, staging,... über CGI, stand-alone, aber am besten mit
Apache::mod_perl
Web ApplikationsmanagementWeb Applikationsmanagement
4ZT Schranz Informationstechnologie KEG
Zugänge verteilen
Web Server Konfiguration
Mason Konfiguration
Aufgabe und Werkzeuge
– Session handling
– Persistente Datenbankanbindung
– WYSIWYG Editor
Keine Laufgarantie an Wochenenden(Wartungsfenster)
AgendaAgenda
5ZT Schranz Informationstechnologie KEG
Praktisches Beispiel: MasonPraktisches Beispiel: MasonPerl-basierter Web Application Server
Definition der individuellen Beispiele– mason/perl scripts, simple Beispiele,
proof of concept
– Simple Shop bzw. Simple CMS Template für Design Komponente für Formular Komponente für DB-Auslese, DB-Eintrag Tipps für DB und Aufgabe unter
http://www.infosys.tuwien.ac.at/teaching/courses/wae/PrAufgabe.html
6ZT Schranz Informationstechnologie KEG
Hello World
<%init>my $text = “dieser Text wird nie angezeigt“;</%init>
Statische Mason-Komponente
Mason HandlingMason Handling
7ZT Schranz Informationstechnologie KEG
Hello World, this page is for users that are at least <% $age %>
years old.
<%args>$name => undef$age => 18</%args><%init>my $text = “test“;</%init>
Argumente in Mason-Komponenten
Mason HandlingMason Handling
8ZT Schranz Informationstechnologie KEG
<html><head><title><% $mytitle %></title><body><& $m->call_next() &></body></html><%init>my $self = $m->request_comp;my $mytitle = $m->attr(“title“);</%init>
Template hierarchie: autohandler
Mason HandlingMason Handling
9ZT Schranz Informationstechnologie KEG
<html><head><title><% $mytitle %></title><body>$m->call_next()</body></html><%init>my $self = $m->request_comp;My $mytitle = $m->call_method(“title“,%ARGS);</%init>
Template hierarchie: autohandler
Mason HandlingMason Handling
10ZT Schranz Informationstechnologie KEG
Hello World<%attr>title => “Hello World Title“</%attr>
<%method title> <%args> </%args> <%init> return “Hello World Title“; </%init></%method>
Component attributes and methods
Mason HandlingMason Handling
11ZT Schranz Informationstechnologie KEG
Hello World<% $dbresults %><%init>my $dbresults = ““;$dbx{´test´}->select({fields=>´name,...´,...});While (my $tmp = $dbx{´test´}->fetchrow_hashref()) { push(@myresult,$tmp); $dbresults .= $tmp->{´name´};}</%init>
Mehr dazu bei der Angabe, bei DBIx::Abstract und www.masonhq.com
Persistent Database connetion
Mason HandlingMason Handling