Search in sources :

Example 1 with SECURITY_DOMAIN_TEMPLATE

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));
}
Also used : AddressTemplate(org.jboss.hal.meta.AddressTemplate) ModelNode(org.jboss.hal.dmr.ModelNode) Environment(org.jboss.hal.config.Environment) StatementContext(org.jboss.hal.meta.StatementContext) ModelNodeTable(org.jboss.hal.core.mbui.table.ModelNodeTable) SECURITY_DOMAIN_TEMPLATE(org.jboss.hal.client.configuration.subsystem.security.AddressTemplates.SECURITY_DOMAIN_TEMPLATE) MbuiViewImpl(org.jboss.hal.core.mbui.MbuiViewImpl) ManagementModel(org.jboss.hal.meta.ManagementModel) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm) Elements.section(org.jboss.gwt.elemento.core.Elements.section) AddressTemplate(org.jboss.hal.meta.AddressTemplate) MbuiElement(org.jboss.hal.spi.MbuiElement) Elements.p(org.jboss.gwt.elemento.core.Elements.p) HTMLElement(elemental2.dom.HTMLElement) Metadata(org.jboss.hal.meta.Metadata) Names(org.jboss.hal.resources.Names) Elements.h(org.jboss.gwt.elemento.core.Elements.h) ModelNodeHelper.asNamedNodes(org.jboss.hal.dmr.ModelNodeHelper.asNamedNodes) Table(org.jboss.hal.ballroom.table.Table) Ids(org.jboss.hal.resources.Ids) ReadChildrenAutoComplete(org.jboss.hal.ballroom.autocomplete.ReadChildrenAutoComplete) VerticalNavigation(org.jboss.hal.ballroom.VerticalNavigation) ModelNodeHelper.failSafePropertyList(org.jboss.hal.dmr.ModelNodeHelper.failSafePropertyList) Dispatcher(org.jboss.hal.dmr.dispatch.Dispatcher) MbuiContext(org.jboss.hal.core.mbui.MbuiContext) ModelDescriptionConstants(org.jboss.hal.dmr.ModelDescriptionConstants) PostConstruct(javax.annotation.PostConstruct) MbuiView(org.jboss.hal.spi.MbuiView) NamedNode(org.jboss.hal.dmr.NamedNode) AddressTemplates(org.jboss.hal.client.configuration.subsystem.ejb.AddressTemplates) CSS.fontAwesome(org.jboss.hal.resources.CSS.fontAwesome) Form(org.jboss.hal.ballroom.form.Form) ModelNodeTable(org.jboss.hal.core.mbui.table.ModelNodeTable) HTMLElement(elemental2.dom.HTMLElement) Metadata(org.jboss.hal.meta.Metadata) NamedNode(org.jboss.hal.dmr.NamedNode) Dispatcher(org.jboss.hal.dmr.dispatch.Dispatcher) ReadChildrenAutoComplete(org.jboss.hal.ballroom.autocomplete.ReadChildrenAutoComplete) StatementContext(org.jboss.hal.meta.StatementContext) PostConstruct(javax.annotation.PostConstruct)

Aggregations

HTMLElement (elemental2.dom.HTMLElement)1 PostConstruct (javax.annotation.PostConstruct)1 Elements.h (org.jboss.gwt.elemento.core.Elements.h)1 Elements.p (org.jboss.gwt.elemento.core.Elements.p)1 Elements.section (org.jboss.gwt.elemento.core.Elements.section)1 VerticalNavigation (org.jboss.hal.ballroom.VerticalNavigation)1 ReadChildrenAutoComplete (org.jboss.hal.ballroom.autocomplete.ReadChildrenAutoComplete)1 Form (org.jboss.hal.ballroom.form.Form)1 Table (org.jboss.hal.ballroom.table.Table)1 AddressTemplates (org.jboss.hal.client.configuration.subsystem.ejb.AddressTemplates)1 SECURITY_DOMAIN_TEMPLATE (org.jboss.hal.client.configuration.subsystem.security.AddressTemplates.SECURITY_DOMAIN_TEMPLATE)1 Environment (org.jboss.hal.config.Environment)1 MbuiContext (org.jboss.hal.core.mbui.MbuiContext)1 MbuiViewImpl (org.jboss.hal.core.mbui.MbuiViewImpl)1 ModelNodeForm (org.jboss.hal.core.mbui.form.ModelNodeForm)1 ModelNodeTable (org.jboss.hal.core.mbui.table.ModelNodeTable)1 ModelDescriptionConstants (org.jboss.hal.dmr.ModelDescriptionConstants)1 ModelNode (org.jboss.hal.dmr.ModelNode)1 ModelNodeHelper.asNamedNodes (org.jboss.hal.dmr.ModelNodeHelper.asNamedNodes)1 ModelNodeHelper.failSafePropertyList (org.jboss.hal.dmr.ModelNodeHelper.failSafePropertyList)1