Portofino#

Portofino ist ein Anwendungs- und Content-Management-Framework in Java und Groovy. Die italienische Firma Manydesigns S.r.l. in Genua beschreibt es mit dem Slogan "Create a webapp from an existing database in 30 seconds".

Erste Schritte#

Die Anwendung gibt es zum Download auf Sourceforge. Die 70 MB grosse ZIP-Datei enthält einen Tomcat 8 mit der "leeren" Portofino-Anwendung im /webapps/-Verzeichnis.

Zum Probieren lege ich eine Postgres-Datenbank "portodb" an.

Portofino unterstütz die Pflege des Datenmodells mit LiquiBase. Ich lege also eine Datei "portodb-public-changelog.xml" im "WEB-INF/dbs/" der Anwendung an. Das Namensschema ist "<datenbank>-<dbschema>-changelog.xml".

Erstes Beispiel:

 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog 
     http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">

    <changeSet id="porto-20160216-01" author="Peter">
        <createTable tableName="customer">
            <column name="id" autoIncrement="true" type="int">
                <constraints nullable="false" primaryKey="true"/>
            </column>
            <column name="company" type="varchar(255)">
                <constraints nullable="false"/>
            </column>
            <column name="section" type="varchar(255)"></column>
            <column name="streetaddress" type="varchar(255)">
                <constraints nullable="false"/>
            </column>
            <column name="zipcode" type="varchar(8)">
                <constraints nullable="false"/>
            </column>
            <column name="city" type="varchar(100)">
                <constraints nullable="false"/>
            </column>
            <column name="contact" type="varchar(255)">
                <constraints nullable="false"/>
            </column>
            <column name="email" type="varchar(255)">
                <constraints nullable="false"/>
            </column>
            <column name="created" type="date">
                <constraints nullable="false"/>
            </column>
        </createTable>
   </changeSet>
 </databaseChangeLog>   

Nach dem Starten des Tomcat kann man sich auf http://localhost:8080/ mit User "admin" und Passwort "admin" anmelden.

Dann lässt sich mit "Administration / Connection Providers" die Datenbank konfigurieren.

Mit "Administration / Reload Model" wird das Liquibase-Datenmodell in PostgreSQL geladen. Dann wird das Model mit "Administration / Connection Providers / portodb" und "Synchronize" in Portofino geladen.

Über "Run wizard", Schema "public", in "Users and groups tables" nur "Next" klicken, "Manual (choose which pages will be created)" und Tabelle "customer" anklicken. "Next" und "Finish" erzeugt schliesslich die Seite "customer" im Hauptmenü".


Tags:  Java, Groovy, Web

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-6) was last changed on 16-Feb-2016 18:35 by Peter Hormanns