LightAdmin Spring 配置
LightAdmin Spring configuration
我正在关注 LightAdmin 网站,同时为我的网站配置管理页面。有如下代码:
<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>
我真的不知道 "package with Administration Configurations" 是什么或它应该在哪里。我在哪里可以找到它?
这是您在定义管理配置时选择的包名称。来自 Light Admin page 上的示例:
在下方 class 的顶部,您会看到如下内容:
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();
}
然后您的配置如下所示:
<context-param>
<param-name>light:administration:base-package</param-name>
<param-value>com.YOUR_APPLICATION.config</param-value>
</context-param>
我正在关注 LightAdmin 网站,同时为我的网站配置管理页面。有如下代码:
<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>
我真的不知道 "package with Administration Configurations" 是什么或它应该在哪里。我在哪里可以找到它?
这是您在定义管理配置时选择的包名称。来自 Light Admin page 上的示例:
在下方 class 的顶部,您会看到如下内容:
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();
}
然后您的配置如下所示:
<context-param>
<param-name>light:administration:base-package</param-name>
<param-value>com.YOUR_APPLICATION.config</param-value>
</context-param>