LightAdmin Spring configuration

396 views Asked by At

I'm following the LightAdmin site while configuring admin page for my site. There is the following code:

<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>

I really don't know what "package with Administration Configurations" is or where it is supposed to be. Where can I find it?

1

There are 1 answers

0
Michael Kowalski On BEST ANSWER

This is the package name you choose when you define your Adminstration Configuration. From the example on the Light Admin page:

At the top of the class below you would have something like:

package com.YOUR_APPLICATION.config;

public class UserAdministration extends AdministrationConfiguration<User> {

public EntityMetadataConfigurationUnit configuration( EntityMetadataConfigurationUnitBuilder configurationBuilder ) {
 return configurationBuilder.nameField( "firstname" ).build();
 }

public ScreenContextConfigurationUnit screenContext( ScreenContextConfigurationUnitBuilder screenContextBuilder ) {
 return screenContextBuilder
 .screenName( "Users Administration" ).build();
 }

public static FieldSetConfigurationUnit listView( final FieldSetConfigurationUnitBuilder fragmentBuilder ) {
 return fragmentBuilder
 .field( "firstname" ).caption( "First Name" )
 .field( "lastname" ).caption( "Last Name" )
 .build();
 }

And then you config looks like this:

<context-param>
 <param-name>light:administration:base-package</param-name>
  <param-value>com.YOUR_APPLICATION.config</param-value>
</context-param>