Skip to content

RPM - Rolf's Project Management;Example Lift application

Notifications You must be signed in to change notification settings

konopski/on-example-rpm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to RPM - Rolf's Project Management.

This project aims to demonstrate how to use The Lift-framework to implement an application with uses Domain Driven Design and technologies like Spring, Spring Security (with remember-me), JPA (Hibernate), Oval Validation, jQuery-UI and the PostgreSQL RDBMS. It also shows how one can use other frameworks with Lift, example is with JSF, and use Lift-backed AJAX-dialogs and comet on a JSF-page

Features:

  • URI-based locale selection
  • Dynamic, type-safe, form-fields with in-place validation and optional AJAX-callbacks on "field-change"
  • Type-safe i18n
  • Modern (technical, not looks) and responsive GUI for editing entities in a jQuery-dialog
  • AJAX-spinner which follows mouse on AJAX-requests
  • Execute custom JavaScript when different radio-buttons (in same group) are checked
    • In this demo it just toggles the value of a text below the radio-buttons
  • Oval integration, http://oval.sf.net
  • Modularize the code into functional domains by having a PersistenceUnit spread across multiple maven-modules and have Spring wire it up correctly
  • Uses scala-jpa
  • JPA-entities written in Scala with Scala-based Enumerations and Option-types in JPA-entities with custom Hibernate-converters
  • Spring Security with remember me and integration with Lift
  • Blog, with Wiki-markup using the OpenSource bliki-parser, nested comments and comment-votes
    • The blog-view is always in sync (using Comet), no need to refresh to see new posts, comments or updated votes
What RPM doesn't want to address and therefore does not implement:
  • Nice GUI
  • Useful functionality
  • Testing
Unresolved issues I'd like to get comments on:
  • Is it possible to run Hibernate's hibernate-jpamodelgen to generate Meta-classes for the JPA-entities on entities written in Scala?
    • It seems the plugin doesn't operate on class-files but on sources and doesn't recognize JPA-entities written in Scala.
Prerequisites:

  • PostgreSQL 9.0 or later is required to run this application.
  • A Maven-3 installation. You need the oss.sonatype.org repo in order to get lift-2.5-SNAPSHOT, like this example ~/.m2/settings.xml
<settings xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                              http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <profiles>
    <profile>
      <id>mydefaultprofile</id>
      <repositories>
        <repository>
          <id>oss-sonatype</id>
          <url>https://oss.sonatype.org/content/groups/public/</url>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
          <releases>
            <enabled>true</enabled>
          </releases>
        </repository>
      </repositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>mydefaultprofile</activeprofile>
  </activeprofiles>
</settings>

DB-configuration: Ensure these properties are set to match your DB-settings, configured in /spring/props/infrastructure.properties

infrastructure.datasource.RPM.serverName=localhost
infrastructure.datasource.RPM.port=5432
infrastructure.datasource.RPM.username=your-username
infrastructure.datasource.RPM.password=xxx

Issue the following commands to bootstrap the application:

$ cd <checked out sources>
$ createdb rpm
$ mvn install # have a cup of coffee while downloading the Internet if this is your 1st Maven-project.
$ cd web
$ MAVEN_OPTS="-XX:MaxPermSize=256m -Xmx512m -javaagent:$HOME/.m2/repository/org/springframework/spring-instrument/3.1.1.RELEASE/spring-instrument-3.1.1.RELEASE.jar" mvn tomcat7:run
$ psql -f bootstrap/sampledata.sql rpm

Notes on bootstrapping the application: It's crucial to run the sampledata.sql script *after* starting tomcat because Hibernate will generate the relevant tables upon boot. The Spring-context needs a loadtime-weaver to be able to inject Spring-beans into non-Spring-managed classes (like snippets), so ensure that spring-instrument gets added as a javaagent. Also note that when tomcat shuts down it will try to serialize all sessions and when starting it will try to load all classes in the previous sessions, including our classes which need load-time weaving. This will lead to the classes not being weaved correctly because it happens before the Spring-context is loaded, which prevents the classes to be weaved correctly. To ensure weaving is correctly performed, always delete the .SER file by issuing

rm -f `find . -name \*.SER`
before the tomcat7:run command

Open a web-browser on http://localhost:8080/rpm/en/projects or http://localhost:8080/rpm/no/projects (for Norwegian) and login with:

  username: admin
  password: Fish123

NB: Testing is completely non-existent, on purpose.

About

RPM - Rolf's Project Management;Example Lift application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published