Search in sources :

Example 1 with MESSAGING_SERVER

use of org.jboss.hal.resources.Ids.MESSAGING_SERVER in project console by hal.

the class ConnectionView method init.

@PostConstruct
void init() {
    Metadata metadata = mbuiContext.metadataRegistry().lookup(POOLED_CONNECTION_FACTORY_TEMPLATE);
    crForm = cr.form(Ids.MESSAGING_SERVER, metadata, CREDENTIAL_REFERENCE, PASSWORD, () -> pooledConnectionFactoryForm.<String>getFormItem(PASSWORD).getValue(), () -> presenter.pooledConnectionFactoryAddress(pooledConnectionFactoryTable.hasSelection() ? pooledConnectionFactoryTable.selectedRow().getName() : null), () -> presenter.reload());
    pooledConnectionFactoryTable = new ModelNodeTable.Builder<NamedNode>(Ids.build(MESSAGING_SERVER, POOLED_CONNECTION_FACTORY, Ids.TABLE), metadata).button(mbuiContext.resources().constants().add(), table -> presenter.addPooledConnectionFactory(ServerSubResource.POOLED_CONNECTION_FACTORY), Constraint.executable(POOLED_CONNECTION_FACTORY_TEMPLATE, ADD)).button(mbuiContext.resources().constants().remove(), table -> presenter.remove(ServerSubResource.POOLED_CONNECTION_FACTORY, table.selectedRow()), Scope.SELECTED, Constraint.executable(POOLED_CONNECTION_FACTORY_TEMPLATE, REMOVE)).column(NAME, (cell, type, row, meta) -> row.getName()).build();
    pooledConnectionFactoryForm = new ModelNodeForm.Builder<NamedNode>(Ids.build(Ids.MESSAGING_POOLED_CONNECTION_FACTORY, Ids.FORM), metadata).onSave((form, changedValues) -> presenter.save(ServerSubResource.POOLED_CONNECTION_FACTORY, form, changedValues)).prepareReset(form -> presenter.reset(ServerSubResource.POOLED_CONNECTION_FACTORY, form)).build();
    pooledConnectionFactoryForm.addFormValidation(new CredentialReference.AlternativeValidation<>(PASSWORD, () -> crForm.getModel(), mbuiContext.resources()));
    Tabs tabs = new Tabs(Ids.build(Ids.MESSAGING_SERVER, POOLED_CONNECTION_FACTORY, Ids.TAB_CONTAINER));
    tabs.add(Ids.build(Ids.MESSAGING_SERVER, POOLED_CONNECTION_FACTORY, ATTRIBUTES, Ids.TAB), mbuiContext.resources().constants().attributes(), pooledConnectionFactoryForm.element());
    tabs.add(Ids.build(Ids.MESSAGING_SERVER, POOLED_CONNECTION_FACTORY, CREDENTIAL_REFERENCE, Ids.TAB), Names.CREDENTIAL_REFERENCE, crForm.element());
    HTMLElement htmlSection = section().add(h(1).textContent(Names.POOLED_CONNECTION_FACTORY)).add(p().textContent(metadata.getDescription().getDescription())).add(pooledConnectionFactoryTable).add(tabs).element();
    registerAttachable(pooledConnectionFactoryTable, pooledConnectionFactoryForm, crForm);
    navigation.insertPrimary(Ids.build(MESSAGING_SERVER, POOLED_CONNECTION_FACTORY, Ids.ITEM), null, Names.POOLED_CONNECTION_FACTORY, "pficon pficon-replicator", htmlSection);
}
Also used : ModelNode(org.jboss.hal.dmr.ModelNode) SELECTED_SERVER_TEMPLATE(org.jboss.hal.client.configuration.subsystem.messaging.AddressTemplates.SELECTED_SERVER_TEMPLATE) Constraint(org.jboss.hal.meta.security.Constraint) POOLED_CONNECTION_FACTORY_TEMPLATE(org.jboss.hal.client.configuration.subsystem.messaging.AddressTemplates.POOLED_CONNECTION_FACTORY_TEMPLATE) ModelNodeTable(org.jboss.hal.core.mbui.table.ModelNodeTable) CredentialReference(org.jboss.hal.core.elytron.CredentialReference) MbuiViewImpl(org.jboss.hal.core.mbui.MbuiViewImpl) Tabs(org.jboss.hal.ballroom.Tabs) 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) Arrays.asList(java.util.Arrays.asList) Metadata(org.jboss.hal.meta.Metadata) Names(org.jboss.hal.resources.Names) Elements.h(org.jboss.gwt.elemento.core.Elements.h) 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.failSafeGet(org.jboss.hal.dmr.ModelNodeHelper.failSafeGet) MESSAGING_SERVER(org.jboss.hal.resources.Ids.MESSAGING_SERVER) List(java.util.List) 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) Form(org.jboss.hal.ballroom.form.Form) Scope(org.jboss.hal.ballroom.table.Scope) ModelNodeTable(org.jboss.hal.core.mbui.table.ModelNodeTable) CredentialReference(org.jboss.hal.core.elytron.CredentialReference) HTMLElement(elemental2.dom.HTMLElement) Metadata(org.jboss.hal.meta.Metadata) NamedNode(org.jboss.hal.dmr.NamedNode) Tabs(org.jboss.hal.ballroom.Tabs) PostConstruct(javax.annotation.PostConstruct)

Example 2 with MESSAGING_SERVER

use of org.jboss.hal.resources.Ids.MESSAGING_SERVER in project console by hal.

the class ClusteringView method init.

@PostConstruct
void init() {
    Metadata metadata = mbuiContext.metadataRegistry().lookup(BRIDGE_TEMPLATE);
    crForm = cr.form(MESSAGING_SERVER, metadata, CREDENTIAL_REFERENCE, PASSWORD, () -> bridgeForm.<String>getFormItem(PASSWORD).getValue(), () -> presenter.bridgeAddress(bridgeTable.hasSelection() ? bridgeTable.selectedRow().getName() : null), () -> presenter.reload());
    bridgeTable = new ModelNodeTable.Builder<NamedNode>(Ids.build(MESSAGING_SERVER, BRIDGE, Ids.TABLE), metadata).button(mbuiContext.resources().constants().add(), table -> presenter.addBridge(ServerSubResource.BRIDGE), Constraint.executable(BRIDGE_TEMPLATE, ADD)).button(mbuiContext.resources().constants().remove(), table -> presenter.remove(ServerSubResource.BRIDGE, table.selectedRow()), Scope.SELECTED, Constraint.executable(BRIDGE_TEMPLATE, REMOVE)).column(NAME, (cell, type, row, meta) -> row.getName()).build();
    bridgeForm = new ModelNodeForm.Builder<NamedNode>(Ids.build(Ids.MESSAGING_BRIDGE, Ids.FORM), metadata).onSave((form, changedValues) -> presenter.save(ServerSubResource.BRIDGE, form, changedValues)).prepareReset(form -> presenter.reset(ServerSubResource.BRIDGE, form)).build();
    bridgeForm.addFormValidation(new CredentialReference.AlternativeValidation<>(PASSWORD, () -> crForm.getModel(), mbuiContext.resources()));
    Tabs tabs = new Tabs(Ids.build(MESSAGING_SERVER, BRIDGE, Ids.TAB_CONTAINER));
    tabs.add(Ids.build(MESSAGING_SERVER, BRIDGE, ATTRIBUTES, Ids.TAB), mbuiContext.resources().constants().attributes(), bridgeForm.element());
    tabs.add(Ids.build(MESSAGING_SERVER, BRIDGE, CREDENTIAL_REFERENCE, Ids.TAB), Names.CREDENTIAL_REFERENCE, crForm.element());
    HTMLElement bridgeSection = section().add(h(1).textContent(Names.BRIDGE)).add(p().textContent(metadata.getDescription().getDescription())).add(bridgeTable).add(tabs).element();
    registerAttachable(bridgeTable, bridgeForm, crForm);
    navigation.insertPrimary(Ids.build(MESSAGING_SERVER, BRIDGE, Ids.ITEM), null, Names.BRIDGE, "fa fa-road", bridgeSection);
}
Also used : ModelNode(org.jboss.hal.dmr.ModelNode) SELECTED_SERVER_TEMPLATE(org.jboss.hal.client.configuration.subsystem.messaging.AddressTemplates.SELECTED_SERVER_TEMPLATE) Constraint(org.jboss.hal.meta.security.Constraint) ModelNodeTable(org.jboss.hal.core.mbui.table.ModelNodeTable) CredentialReference(org.jboss.hal.core.elytron.CredentialReference) MbuiViewImpl(org.jboss.hal.core.mbui.MbuiViewImpl) Tabs(org.jboss.hal.ballroom.Tabs) 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) Arrays.asList(java.util.Arrays.asList) Metadata(org.jboss.hal.meta.Metadata) Names(org.jboss.hal.resources.Names) Elements.h(org.jboss.gwt.elemento.core.Elements.h) BRIDGE_TEMPLATE(org.jboss.hal.client.configuration.subsystem.messaging.AddressTemplates.BRIDGE_TEMPLATE) 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.failSafeGet(org.jboss.hal.dmr.ModelNodeHelper.failSafeGet) MESSAGING_SERVER(org.jboss.hal.resources.Ids.MESSAGING_SERVER) List(java.util.List) 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) Form(org.jboss.hal.ballroom.form.Form) Scope(org.jboss.hal.ballroom.table.Scope) ModelNodeTable(org.jboss.hal.core.mbui.table.ModelNodeTable) CredentialReference(org.jboss.hal.core.elytron.CredentialReference) HTMLElement(elemental2.dom.HTMLElement) Metadata(org.jboss.hal.meta.Metadata) NamedNode(org.jboss.hal.dmr.NamedNode) Tabs(org.jboss.hal.ballroom.Tabs) PostConstruct(javax.annotation.PostConstruct)

Aggregations

HTMLElement (elemental2.dom.HTMLElement)2 Arrays.asList (java.util.Arrays.asList)2 List (java.util.List)2 PostConstruct (javax.annotation.PostConstruct)2 Elements.h (org.jboss.gwt.elemento.core.Elements.h)2 Elements.p (org.jboss.gwt.elemento.core.Elements.p)2 Elements.section (org.jboss.gwt.elemento.core.Elements.section)2 Tabs (org.jboss.hal.ballroom.Tabs)2 VerticalNavigation (org.jboss.hal.ballroom.VerticalNavigation)2 ReadChildrenAutoComplete (org.jboss.hal.ballroom.autocomplete.ReadChildrenAutoComplete)2 Form (org.jboss.hal.ballroom.form.Form)2 Scope (org.jboss.hal.ballroom.table.Scope)2 Table (org.jboss.hal.ballroom.table.Table)2 SELECTED_SERVER_TEMPLATE (org.jboss.hal.client.configuration.subsystem.messaging.AddressTemplates.SELECTED_SERVER_TEMPLATE)2 CredentialReference (org.jboss.hal.core.elytron.CredentialReference)2 MbuiContext (org.jboss.hal.core.mbui.MbuiContext)2 MbuiViewImpl (org.jboss.hal.core.mbui.MbuiViewImpl)2 ModelNodeForm (org.jboss.hal.core.mbui.form.ModelNodeForm)2 ModelNodeTable (org.jboss.hal.core.mbui.table.ModelNodeTable)2 ModelDescriptionConstants (org.jboss.hal.dmr.ModelDescriptionConstants)2