Code Monkey home page Code Monkey logo

on-example-rpm's Introduction

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
  • Automatic lazy-load lazy-associations without using custom AOP-trickery (new in Hibernate-4.1.7)
  • Automatic registering JodaTime types in Hibernate (note: Doesn't work on Option[DateTime] type where custom user-type is needed)
  • Use Option in (JPA) domain-object's properties *and* associations to completely avoid _null_
  • Spring Security with remember me and integration with Lift
  • Blog, with 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
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.2.RELEASE/spring-instrument-3.1.2.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.

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.

on-example-rpm's People

Contributors

andreak avatar

Watchers

James Cloos avatar Guxiangguo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.