Spring/Hibernate Entity Management Web Interface/UI

后端 未结 5 1997
北海茫月
北海茫月 2021-02-09 10:31

We have a server application that exposes a certain model, and set of services built on that model, to a particular client UI through a number of protocols. This is the kind of

5条回答
  •  被撕碎了的回忆
    2021-02-09 11:21

    Looks like LightAdmin pluggable administration interface for Spring/JPA based applications would be a good choice for you. It has a built-in Java DSL for interface configuration and the only thing you need to do is to download a jar or declare Maven dependency, enable your domain administration through web.xml (point to package containing your JPA entities) and create @Administration configuration for the entity.

    Here is an example of configuration:

    @Administration( User.class )
    public class UserAdministration {
    
      public static EntityMetadata configuration(EntityMetadataBuilder configurationBuilder ) {
        return configurationBuilder.nameField( "firstname" ).build();
      }
    
      public static ScreenContext screenContext( ScreenContextBuilder screenContextBuilder ) {
        return screenContextBuilder
               .screenName( "Users Administration" )
               .menuName( "Users" ).build();
      }
    
      public static FieldSet listView( final FieldSetBuilder fragmentBuilder ) {
        return fragmentBuilder
               .field( "firstname" ).caption( "First Name" )
               .field( "lastname" ).caption( "Last Name" ).build();
      }
    

提交回复
热议问题