RRZE – Projekte & Prozesse (P&P)

Das Blog der RRZE Stabsstelle "Projekte & Prozesse"

Content

PPSA T5 Komponenten

Während ich am FAU.ORG Projekt arbeitete, stellte ich fest, dass viele verschiedene Webkomponenten von der bereits existierenden alpha Version der WAID Applikation in dem zurzeit entwickelnden fauorg-web Teilprojekt übernommen werden müssen(für mehr Information wenden sie sich bitte an das FAU.ORG Blog). WAID ist die Web Oberfläche des IDMone Projektes und funktioniert als self-service Portal für die an der Friedrich-Alexander Universität Erlangen-Nürnberg beschäftigten Personen. Das ausgewählte Webframework für beide Anwendungen ist Tapestry 5 und es ist als ein Teil des PPSA Apllikationsstacks definiert.

Im Vergleich mit anderen Java Webframeworks bietet Tapestry eine komponentenbasierte Platform, die die Wiederverwendung des existierenden Kodes ermöglicht. Mehrere Instanzen von den vorgegebenen Komponenten können innerhalb einer Applikation eingebaut werden. Die Komponenten können auch in einzelnen Modulen extrahiert werden, die später als Bausteine verwendet werden können. Es wurde die Entscheidung getroffen, von der oben erwähnten Modularität Gebrauch zu machen, deswegen wurden manche Komponenten von WAID entfernt und in einzelnen Projekte übertragen. Zurzeit sind die folgenden Module in PPSA verfügbar:

  • ppsa-t5-commons
  • ppsa-t5-d7
  • ppsa-t5-jcaptcha
  • ppsa-t5-weather

Das wichtigste von den oben erwähnten Projekten ist ppsa-t5-commons. Dieses Projekt definiert die Platform aller Webapplikationen, die mithilfe von PPSA entwickelt wurden, weil es die Tapestry 5 Libraries beinhaltet. Auf dieser Art und Weise wird die Konsistenz innerhalb der verschiedenen Anwendungen so wie die in denen implementierten Komponenten bewahrt. Der ausgewählte Ansatz setzt die Libraryversionen fest, die von der Platform verwendet sind, und sichert die Verbreitung einer vereinheitlichten Entwicklungsbasis ab. Alle weiteren Projektkomponenten sollten das ppsa-t5-commons als Abhängigkeit beinhalten, so dass die mit der Architektur übereinstimmen. Dadurch ist im Fall einer Änderung von der Tapestry- oder Apache commons-logging- Version eine einzige Aktualisierungsschittstelle definiert.

Ppsa-t5-commons trägt nicht nur dazu bei die Platform zu definieren, sondern auch
oft genutzte Tapestry Komponenten. Aktuell sind es:

  • AlternatingClass – eine Komponente, die ungerade und gerade Tabellenzeilen rendert
  • FileUpload – eine Komponente, die auf Apache commons-upload basiert und Dateien hochladet
  • SwitchLocale – eine Komponente, die das ?Locale? innerhalb der Webapplikation verändert
  • FlotrGraph – eine Komponente, die Browser basierte Diagramme rendert, Flotr Library nutzt und die Serverauslastung reduziert
  • GoodiesTree – eine Baumkomponente, die auf XHTML Goodies basiert
  • JQueryTree – eine Baumkomponente, die auf JQuery Script Libraries basiert
  • TafelTree – eine Baumkomponente, die auf TafelTree Prototype Library basiert
  • ProgressBar – eine Progressbarkomponente , die auf die Prototype-basierende Livepipe Library beruht
  • ULAutoUpdate – ein Mixin, das die Prototype Javascript Library verwendet um eine Komponente periodisch zu aktualisieren

Das ppsa-t5-d7 Modul beinhaltet alle Seiten, Komponenten, CSS Dateien, Javascript Dateien, Bilder usw., die zu dem D7 Design des RRZE Vorlagenkatalogs gehören. Dieses Modul definiert eine Tapestry Layout Komponente, die auf verschiedenen Seiten benutzt werden kann um das Corporate Design zu wahren. Das Modul beschäftigt sich auch mit der Sessionverwaltung so wie: An- und Abmeldung, Zeitablauf usw. Die Aufgabe des ppsa-t5-jcaptcha Modules ist die Gewährleistung einer wiederverwendbaren JCaptcha Komponente und des entsprechenden Tapestry Services. Trotz nicht anerkannter Barrierefreiheit sollten diese vor Hackerangriffe schützen. Das letzte ppsa-t5-weather Modul ruft die Wettervorhersage von Yahoo!’s Feed ab und wandelt sie in reinen HTML Kode um.

Eine Dokumentation und Beispiele, wie man die verschiedenen Module und Komponenten benutzt, werden bald auf der PPSA Wiki Seite verfügbar sein. Manche Beispiele werden auch auf dieser Seite geblogt.

PPSA T5 Components

While I was working on the FAU.ORG project, I identified that various web components had to be migrated from the existing alpha version of the WAID web application into the currently developed fauorg-web subproject(see the FAU.ORG for more information). WAID is the web front-end of the IDMone project and functions as a self-service portal for people associated with Friedrich-Alexander University Erlangen-Nürnberg. The web framework of choice for both application is Tapestry 5 and is defined as a part of the PPSA application stack.

Compared with other Java web frameworks, Tapestry provides a component based platform which allows for re-usability of existing pieces of code. Multiple instances of a given component can be embedded within an application. Components can also be extracted into separate modules which can be later used as building blocks. A decision was made to take advantage of the above mentioned modularity and several important components were taken out from WAID and moved into individual projects. Currently the following modules are available under the PPSA initiative:

  • ppsa-t5-commons
  • ppsa-t5-d7
  • ppsa-t5-jcaptcha
  • ppsa-t5-weather

The most important of the above listed projects is the ppsa-t5-commons. This project defines the platform of all web applications developed under PPSA as the Tapestry 5 libraries are included in it. This provides consistency within the different applications and the components implemented as parts of them. The chosen approach fixes the version of the libraries used by the platform and ensures propagation of a unified development base. All other component projects should include ppsa-t5-commons as a dependency to conform with the architecture. Thus a single point of update is defined in case of a change of the Tapestry or of the Apache’s commons-logging version.

ppsa-t5-commons not only defines the platform but also contributes some commonly used Tapestry components. At the moment of writing these are:

  • AlternatingClass – a component used to render odd and even table rows
  • FileUpload – a component used for file uploads, based on Apache commons-upload
  • SwitchLocale – a component which changes the locale within the web application
  • FlotrGraph – a component for browser graph rendering, uses Flotr alpha library, reduces server load
  • GoodiesTree – a tree component based on XHTML Goodies
  • JQueryTree – a tree component based on the JQuery script libraries
  • TafelTree – a tree component based on the TafelTree Prototype library extension
  • ProgressBar – a progress bar component using the Prototype-based Livepipe library
  • ULAutoUpdate – a mixin which uses the Prototype javascript library to periodically update a component

The ppsa-t5-d7 module provides all the pages, components, CSS files, javascript files, images and so on that belong to the D7 design from the RRZE’s Vorlagenkatalog. The module defines a Tapestry layout component that can be used within different pages to ensure corporate design. The module also handles basic session management such as – login, logout, timeout and so on. The role of the ppsa-t5-jcapcha module is to provide a reusable JCaptcha component and a corresponding Tapestry service. These should be used to protect from intruder attacks, though are not generally considered appropriate for disabled users. The last module – ppsa-t5-weather, is a modules which fetches the weather forecast from Yahoo!’s feed and renders it as HTML code.

Documentation and examples of how to use the different modules and components will soon be available on the PPSA wiki page. Some samples will be also posted in this blog.

Leave a comment

Your email address will not be published Required fields are marked *

You can use the following HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>