@Configuration
public class BrandMetadataAutoConfiguration {
@Bean
public ComponentSource brandMetadataComponents() {
return registry -> registry
.add("brands:browse", getBrandsBrowse());
}
private EntityBrowseView<?> getBrandsBrowse() {
return Views.entityBrowseView()
.label("Brands")
.defaultGrid(brandsGrid -> brandsGrid
.label("Brands")
.readUrl("/brands")
.addColumn("name", Columns.string().label("Name"))
.addColumn("url", Columns.string().label("Url")))
.grid("specialBrands", specialBrandsGrid -> specialBrandsGrid
.label("Special Brands")
.readUrl("/special-brands")
.addColumn("name", Columns.string().label("Name"))
.addColumn("url", Columns.string().label("Url")));
}
}