The primary goal of the project is to speed up application development by bringing pluggable fully operational data management back-end for JPA based applications and to relieve your codebase for more important stuff.
Light Admin makes it possible to focus on the stuff that matters instead of spending time on auxiliary functionality.
- DSL configurations: Allows developers to easily configure their administration user interface
- Displaying persistent entities: Customizable Listing & Quick Views with paging & sorting capabilities
- CRUD operations: Complete entities manipulation support (including their associations)
- Automatic Validation: JSR-303 annotation-based validation rules support
- Search: Allows users to search entities by text fields, dates, numeric values & associations
- Filtering Scopes: Use scopes to filter data by predefined criteria
- Pluggable Security: Authentication based on Spring Security
- REST API: Enriching your application with REST API based on Spring Data REST
- Easy integration: Servlet 3.0 web applications supported
- Web site: lightadmin.org
- Documentation & Guides: lightadmin.org/documentation
- Wiki: github.com/max-dev/light-admin/wiki
- Live demo: lightadmin.org/demo/admin
- CI Server: lightadmin.org/jenkins
- For more detailed questions: groups.google.com/group/lightadmin
- Bug Reports: github.com/max-dev/light-admin/issues
- LightAdmin is released under version 2.0 of the Apache License.
Declare repository in your POM
<repositories>
<repository>
<id>lightadmin-nexus-snapshots</id>
<url>http://lightadmin.org/nexus/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
Define maven dependency
<dependency>
<groupId>org.lightadmin</groupId>
<artifactId>lightadmin</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<context-param>
<param-name>light:administration:base-url</param-name>
<param-value>/admin</param-value>
</context-param>
<context-param>
<param-name>light:administration:security</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>light:administration:base-package</param-name>
<param-value>[package with @Administration configurations, ex.: org.lightadmin.demo.config]</param-value>
</context-param>
Include your JPA persistence provider of choice (Hibernate, EclipseLink, OpenJpa) and setup basic Spring JPA configuration.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="http://www.springframework.org/schema/jdbc
http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schema/data/jpa/spring-jpa.xsd">
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter" />
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
</beans>
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
private String firstname;
private String lastname;
// Getters and setters
}
@Administration( User.class )
public class UserAdministration {
public static EntityMetadataConfigurationUnit configuration( EntityMetadataConfigurationUnitBuilder configurationBuilder ) {
return configurationBuilder.nameField( "firstname" ).build();
}
public static ScreenContextConfigurationUnit screenContext( ScreenContextConfigurationUnitBuilder screenContextBuilder ) {
return screenContextBuilder
.screenName( "Users Administration" )
.menuName( "Users" )
.build();
}
public static FieldSetConfigurationUnit listView( final FieldSetConfigurationUnitBuilder fragmentBuilder ) {
return fragmentBuilder
.field( "firstname" ).caption( "First Name" )
.field( "lastname" ).caption( "Last Name" )
.build();
}
Voila! You have a brand new LightAdmin back-end configured.
-
Clone the repository from GitHub:
$ git clone git://github.com/max-dev/light-admin.git
-
Navigate into the cloned repository directory:
$ cd light-admin
-
The project uses Maven to build:
$ mvn clean install
By default, the app will run in 'embedded' mode which does not require any external setup. The Tomcat 7 Maven plugin is configured for you in the POM file.
-
Navigate into demo application directory:
$ cd lightadmin-demo
-
Launch Tomcat from the command line:
$ mvn tomcat7:run
-
Access the deployed webapp at
http://localhost:8080/lightadmin-demo
We prepared an example how easily you can integrate LightAdmin back-end to existing web application.
It's based on Spring Travel reference application.
-
Clone the repository from GitHub:
$ git clone git://github.com/max-dev/lightadmin-spring-travel.git
-
Navigate into the cloned repository directory:
$ cd lightadmin-spring-travel
-
The project uses Maven to build:
$ mvn clean install
-
Launch Tomcat from the command line:
$ mvn tomcat7:run
-
Access the deployed webapp at
http://localhost:8080/booking-mvc
Login to LightAdmin:
Dashboard:
List of persistent entities configured:
Search entities by criteria:
Quick view for particular entity:
Editing entity:
Show entity with all fields: