use of org.jboss.hal.client.configuration.subsystem.security.AddressTemplates.SECURITY_DOMAIN_TEMPLATE in project console by hal.
the class EjbView method init.
@PostConstruct
void init() {
StatementContext statementContext = mbuiContext.statementContext();
if (ManagementModel.supportsEjbApplicationSecurityDomain(environment().getManagementVersion())) {
AddressTemplate template = AddressTemplate.of("/{selected.profile}/subsystem=ejb3/application-security-domain=*");
Metadata metadata = mbuiContext.metadataRegistry().lookup(template);
appSecurityDomainTable = new ModelNodeTable.Builder<NamedNode>(Ids.EJB3_APPLICATION_SECURITY_DOMAIN_TABLE, metadata).button(mbuiContext.tableButtonFactory().add(Ids.EJB3_APPLICATION_SECURITY_DOMAIN_ADD, Names.APPLICATION_SECURITY_DOMAIN, template, (name, address) -> presenter.reload())).button(mbuiContext.tableButtonFactory().remove(Names.APPLICATION_SECURITY_DOMAIN, template, (api) -> api.selectedRow().getName(), () -> presenter.reload())).column(NAME, (cell, type, row, meta) -> row.getName()).build();
appSecurityDomainForm = new ModelNodeForm.Builder<NamedNode>(Ids.EJB3_APPLICATION_SECURITY_DOMAIN_FORM, metadata).onSave((form, changedValues) -> {
String name = form.getModel().getName();
saveForm(Names.APPLICATION_SECURITY_DOMAIN, name, template.resolve(statementContext, name), changedValues, metadata);
}).prepareReset(form -> {
String name = form.getModel().getName();
resetForm(Names.APPLICATION_SECURITY_DOMAIN, name, template.resolve(statementContext, name), form, metadata);
}).build();
HTMLElement section = section().add(h(1).textContent(Names.APPLICATION_SECURITY_DOMAIN)).add(p().textContent(metadata.getDescription().getDescription())).add(appSecurityDomainTable).add(appSecurityDomainForm).element();
navigation.insertPrimary(Ids.EJB3_APPLICATION_SECURITY_DOMAIN_ITEM, null, Names.SECURITY_DOMAIN, fontAwesome("link"), section);
}
Dispatcher dispatcher = mbuiContext.dispatcher();
configurationForm.getFormItem(DEFAULT_SFSB_CACHE).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, CACHE_TEMPLATE));
configurationForm.getFormItem(DEFAULT_SFSB_PASSIVATION_DISABLED_CACHE).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, CACHE_TEMPLATE));
configurationForm.getFormItem(DEFAULT_SLSB_INSTANCE_POOL).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, BEAN_POOL_TEMPLATE));
configurationForm.getFormItem(DEFAULT_SECURITY_DOMAIN).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, SECURITY_DOMAIN_TEMPLATE));
cacheForm.getFormItem(PASSIVATION_STORE).registerSuggestHandler(new ReadChildrenAutoComplete(dispatcher, statementContext, PASSIVATION_TEMPLATE));
}
Aggregations