Search in sources :

Example 21 with NameItem

use of org.jboss.hal.core.mbui.dialog.NameItem in project console by hal.

the class ProfileColumn method cloneProfile.

private void cloneProfile(String from) {
    ModelNodeForm<ModelNode> form = new ModelNodeForm.Builder<>(Ids.PROFILE_CLONE, Metadata.empty()).unboundFormItem(new NameItem()).build();
    AddResourceDialog dialog = new AddResourceDialog(resources.constants().cloneProfile(), form, (to, model) -> {
        Operation operation = new Operation.Builder(new ResourceAddress().add(PROFILE, from), CLONE).param(TO_PROFILE, to).build();
        dispatcher.execute(operation, result -> {
            MessageEvent.fire(eventBus, Message.success(resources.messages().cloneProfileSuccess(from, to)));
            refresh(to);
        });
    });
    dialog.show();
}
Also used : AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) NameItem(org.jboss.hal.core.mbui.dialog.NameItem) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) Operation(org.jboss.hal.dmr.Operation) ModelNode(org.jboss.hal.dmr.ModelNode)

Example 22 with NameItem

use of org.jboss.hal.core.mbui.dialog.NameItem in project console by hal.

the class ServerColumn method addServer.

private void addServer(boolean browseByHost) {
    if (browseByHost) {
        AddressTemplate template = serverConfigTemplate(statementContext.selectedHost());
        String id = Ids.build(HOST, statementContext.selectedHost(), SERVER, Ids.ADD);
        List<String> attributes = asList(AUTO_START, GROUP, SOCKET_BINDING_DEFAULT_INTERFACE, SOCKET_BINDING_GROUP, SOCKET_BINDING_PORT_OFFSET, UPDATE_AUTO_START_WITH_SERVER_STATUS);
        crud.add(id, Names.SERVER, template, attributes, createUniqueValidation(), (name, address) -> refresh(RESTORE_SELECTION));
    } else {
        // load all available hosts to show in the copy dialog
        Operation operation = new Operation.Builder(ResourceAddress.root(), READ_CHILDREN_NAMES_OPERATION).param(CHILD_TYPE, HOST).build();
        dispatcher.execute(operation, result -> {
            List<String> hosts = new ArrayList<>();
            result.asList().forEach(m -> hosts.add(m.asString()));
            // get the first host, only to retrieve the r-r-d for server-config
            // as /host=*/server-config=*:read-operation-description(name=add) does not work
            AddressTemplate template = serverConfigTemplate(hosts.get(0));
            metadataProcessor.lookup(template, progress.get(), new SuccessfulMetadataCallback(eventBus, resources) {

                @Override
                public void onMetadata(Metadata metadata) {
                    String id = Ids.build(SERVER_GROUP, statementContext.selectedServerGroup(), SERVER, FORM);
                    SingleSelectBoxItem hostFormItem = new SingleSelectBoxItem(HOST, Names.HOST, hosts, false);
                    hostFormItem.setRequired(true);
                    NameItem nameItem = new NameItem();
                    ModelNodeForm<ModelNode> form = new ModelNodeForm.Builder<>(id, metadata).unboundFormItem(nameItem, 0).unboundFormItem(hostFormItem, 1, resources.messages().addServerHostHelp()).customFormItem(GROUP, attributeDescription -> {
                        TextBoxItem groupItem = new TextBoxItem(GROUP, resources.constants().group());
                        groupItem.setEnabled(false);
                        return groupItem;
                    }).fromRequestProperties().build();
                    AddResourceDialog dialog = new AddResourceDialog(resources.messages().addServerTitle(), form, (resource, payload) -> {
                        payload.get(GROUP).set(statementContext.selectedServerGroup());
                        String serverName = nameItem.getValue();
                        ResourceAddress address = serverConfigTemplate(hostFormItem.getValue()).resolve(statementContext, serverName);
                        crud.add(serverName, address, payload, resources.messages().addResourceSuccess(Names.SERVER, serverName), (name, address1) -> refresh(RESTORE_SELECTION));
                    });
                    dialog.getForm().<String>getFormItem(NAME).addValidationHandler(createUniqueValidation());
                    dialog.show();
                    form.<String>getFormItem(GROUP).setValue(statementContext.selectedServerGroup());
                }
            });
        });
    }
}
Also used : AddressTemplate(org.jboss.hal.meta.AddressTemplate) Provider(javax.inject.Provider) Environment(org.jboss.hal.config.Environment) ServerSelectionEvent(org.jboss.hal.core.runtime.server.ServerSelectionEvent) Constraint(org.jboss.hal.meta.security.Constraint) ItemActionFactory(org.jboss.hal.core.finder.ItemActionFactory) StatementContext(org.jboss.hal.meta.StatementContext) ItemDisplay(org.jboss.hal.core.finder.ItemDisplay) AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) FinderSegment(org.jboss.hal.core.finder.FinderSegment) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) ManagementModel(org.jboss.hal.meta.ManagementModel) TextBoxItem(org.jboss.hal.ballroom.form.TextBoxItem) TopologyTasks(org.jboss.hal.core.runtime.TopologyTasks) AuthorisationDecision(org.jboss.hal.meta.security.AuthorisationDecision) Column(org.jboss.hal.spi.Column) HTMLElement(elemental2.dom.HTMLElement) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) PlaceManager(com.gwtplatform.mvp.client.proxy.PlaceManager) Server(org.jboss.hal.core.runtime.server.Server) Metadata(org.jboss.hal.meta.Metadata) Places(org.jboss.hal.core.mvp.Places) Names(org.jboss.hal.resources.Names) ServerActions(org.jboss.hal.core.runtime.server.ServerActions) CrudOperations(org.jboss.hal.core.CrudOperations) Collections.emptyList(java.util.Collections.emptyList) SingleSelectBoxItem(org.jboss.hal.ballroom.form.SingleSelectBoxItem) FinderPath(org.jboss.hal.core.finder.FinderPath) FORM(org.jboss.hal.resources.Ids.FORM) List(java.util.List) ServerActionHandler(org.jboss.hal.core.runtime.server.ServerActionEvent.ServerActionHandler) MetadataRegistry(org.jboss.hal.meta.MetadataRegistry) MetadataProcessor(org.jboss.hal.meta.processing.MetadataProcessor) ServerResultEvent(org.jboss.hal.core.runtime.server.ServerResultEvent) ModelDescriptionConstants(org.jboss.hal.dmr.ModelDescriptionConstants) SecurityContextRegistry(org.jboss.hal.meta.security.SecurityContextRegistry) Flow.series(org.jboss.hal.flow.Flow.series) Optional(java.util.Optional) Finder(org.jboss.hal.core.finder.Finder) Footer(org.jboss.hal.spi.Footer) ModelNodeHelper(org.jboss.hal.dmr.ModelNodeHelper) ModelNode(org.jboss.hal.dmr.ModelNode) Iterables(com.google.common.collect.Iterables) ColumnAction(org.jboss.hal.core.finder.ColumnAction) ItemAction(org.jboss.hal.core.finder.ItemAction) SuccessfulMetadataCallback(org.jboss.hal.meta.processing.SuccessfulMetadataCallback) ElementGuard(org.jboss.hal.meta.security.ElementGuard) ServerActionEvent(org.jboss.hal.core.runtime.server.ServerActionEvent) ServerResultHandler(org.jboss.hal.core.runtime.server.ServerResultEvent.ServerResultHandler) HashMap(java.util.HashMap) FlowContext(org.jboss.hal.flow.FlowContext) Outcome(org.jboss.hal.flow.Outcome) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm) TopologyTasks.serversOfHost(org.jboss.hal.core.runtime.TopologyTasks.serversOfHost) Task(org.jboss.hal.flow.Task) AsyncCallback(com.google.gwt.user.client.rpc.AsyncCallback) Progress(org.jboss.hal.flow.Progress) AddressTemplate(org.jboss.hal.meta.AddressTemplate) HostSelectionEvent(org.jboss.hal.core.runtime.host.HostSelectionEvent) RESTORE_SELECTION(org.jboss.hal.core.finder.FinderColumn.RefreshMode.RESTORE_SELECTION) FinderColumn(org.jboss.hal.core.finder.FinderColumn) NameItem(org.jboss.hal.core.mbui.dialog.NameItem) Comparator.comparing(java.util.Comparator.comparing) ItemsProvider(org.jboss.hal.core.finder.ItemsProvider) ColumnActionFactory(org.jboss.hal.core.finder.ColumnActionFactory) Requires(org.jboss.hal.spi.Requires) BrowseByColumn(org.jboss.hal.client.runtime.BrowseByColumn) DomGlobal.document(elemental2.dom.DomGlobal.document) TopologyTasks.serversOfServerGroup(org.jboss.hal.core.runtime.TopologyTasks.serversOfServerGroup) Operation(org.jboss.hal.dmr.Operation) Ids(org.jboss.hal.resources.Ids) CONFIGURATION_CHANGES_ADDRESS(org.jboss.hal.client.runtime.configurationchanges.ConfigurationChangesPresenter.CONFIGURATION_CHANGES_ADDRESS) ServerGroupSelectionEvent(org.jboss.hal.core.runtime.group.ServerGroupSelectionEvent) FinderPathFactory(org.jboss.hal.core.finder.FinderPathFactory) EventBus(com.google.web.bindery.event.shared.EventBus) PlaceRequest(com.gwtplatform.mvp.shared.proxy.PlaceRequest) ItemMonitor(org.jboss.hal.core.finder.ItemMonitor) Dispatcher(org.jboss.hal.dmr.dispatch.Dispatcher) Collectors.toList(java.util.stream.Collectors.toList) NameTokens(org.jboss.hal.meta.token.NameTokens) Resources(org.jboss.hal.resources.Resources) ProfileSelectionEvent(org.jboss.hal.core.configuration.ProfileSelectionEvent) AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) SingleSelectBoxItem(org.jboss.hal.ballroom.form.SingleSelectBoxItem) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) ArrayList(java.util.ArrayList) Metadata(org.jboss.hal.meta.Metadata) SuccessfulMetadataCallback(org.jboss.hal.meta.processing.SuccessfulMetadataCallback) Operation(org.jboss.hal.dmr.Operation) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm) TextBoxItem(org.jboss.hal.ballroom.form.TextBoxItem) NameItem(org.jboss.hal.core.mbui.dialog.NameItem)

Example 23 with NameItem

use of org.jboss.hal.core.mbui.dialog.NameItem in project console by hal.

the class RealmsPresenter method addLdapRealm.

void addLdapRealm() {
    Metadata metadata = metadataRegistry.lookup(LDAP_REALM_TEMPLATE);
    Metadata imMetadata = metadata.forComplexAttribute(IDENTITY_MAPPING, true);
    imMetadata.copyComplexAttributeAttributes(asList(RDN_IDENTIFIER, SEARCH_BASE_DN, USE_RECURSIVE_SEARCH), metadata);
    NameItem nameItem = new NameItem();
    String id = Ids.build(Ids.ELYTRON_LDAP_REALM, Ids.ADD);
    Form<ModelNode> form = new ModelNodeForm.Builder<>(id, metadata).addOnly().unboundFormItem(nameItem, 0).include(DIR_CONTEXT, DIRECT_VERIFICATION, ALLOW_BLANK_PASSWORD, RDN_IDENTIFIER, SEARCH_BASE_DN, USE_RECURSIVE_SEARCH).build();
    new AddResourceDialog(resources.messages().addResourceTitle(Names.LDAP_REALM), form, (name, model) -> {
        if (model != null) {
            move(model, RDN_IDENTIFIER, IDENTITY_MAPPING + "/" + RDN_IDENTIFIER);
            move(model, SEARCH_BASE_DN, IDENTITY_MAPPING + "/" + SEARCH_BASE_DN);
            // only pass USE_RECURSIVE_SEARCH if true (not default-value)
            if (failSafeBoolean(model, USE_RECURSIVE_SEARCH)) {
                move(model, USE_RECURSIVE_SEARCH, IDENTITY_MAPPING + "/" + USE_RECURSIVE_SEARCH);
            } else {
                model.remove(USE_RECURSIVE_SEARCH);
            }
        }
        ResourceAddress address = LDAP_REALM_TEMPLATE.resolve(statementContext, nameItem.getValue());
        crud.add(Names.IDENTITY_ATTRIBUTE_MAPPING, name, address, model, (n, a) -> reloadLdapRealms());
    }).show();
}
Also used : AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) SupportsExpertMode(org.jboss.hal.core.mvp.SupportsExpertMode) ModelNode(org.jboss.hal.dmr.ModelNode) StatementContext(org.jboss.hal.meta.StatementContext) MessageEvent(org.jboss.hal.spi.MessageEvent) ProxyPlace(com.gwtplatform.mvp.client.proxy.ProxyPlace) AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) Inject(javax.inject.Inject) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) Message(org.jboss.hal.spi.Message) RequireAtLeastOneAttributeValidation(org.jboss.hal.core.mbui.form.RequireAtLeastOneAttributeValidation) NameItem(org.jboss.hal.core.mbui.dialog.NameItem) Metadata(org.jboss.hal.meta.Metadata) Names(org.jboss.hal.resources.Names) ModelNodeHelper.asNamedNodes(org.jboss.hal.dmr.ModelNodeHelper.asNamedNodes) Requires(org.jboss.hal.spi.Requires) CrudOperations(org.jboss.hal.core.CrudOperations) ProxyCodeSplit(com.gwtplatform.mvp.client.annotations.ProxyCodeSplit) ModelNodeHelper.move(org.jboss.hal.dmr.ModelNodeHelper.move) ModelNodeHelper.failSafeBoolean(org.jboss.hal.dmr.ModelNodeHelper.failSafeBoolean) Operation(org.jboss.hal.dmr.Operation) NameToken(com.gwtplatform.mvp.client.annotations.NameToken) Ids(org.jboss.hal.resources.Ids) AddressTemplates(org.jboss.hal.client.configuration.subsystem.elytron.AddressTemplates) FinderPathFactory(org.jboss.hal.core.finder.FinderPathFactory) ComplexAttributeOperations(org.jboss.hal.core.ComplexAttributeOperations) EventBus(com.google.web.bindery.event.shared.EventBus) FinderPath(org.jboss.hal.core.finder.FinderPath) PathsAutoComplete(org.jboss.hal.core.configuration.PathsAutoComplete) Consumer(java.util.function.Consumer) ModelNodeHelper.failSafeGet(org.jboss.hal.dmr.ModelNodeHelper.failSafeGet) List(java.util.List) LabelBuilder(org.jboss.hal.ballroom.LabelBuilder) MetadataRegistry(org.jboss.hal.meta.MetadataRegistry) NameTokens(org.jboss.hal.meta.token.NameTokens) MbuiPresenter(org.jboss.hal.core.mbui.MbuiPresenter) ModelDescriptionConstants(org.jboss.hal.dmr.ModelDescriptionConstants) Resources(org.jboss.hal.resources.Resources) MbuiView(org.jboss.hal.core.mbui.MbuiView) Finder(org.jboss.hal.core.finder.Finder) NamedNode(org.jboss.hal.dmr.NamedNode) Form(org.jboss.hal.ballroom.form.Form) NameItem(org.jboss.hal.core.mbui.dialog.NameItem) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) LabelBuilder(org.jboss.hal.ballroom.LabelBuilder) Metadata(org.jboss.hal.meta.Metadata) ModelNode(org.jboss.hal.dmr.ModelNode)

Example 24 with NameItem

use of org.jboss.hal.core.mbui.dialog.NameItem in project console by hal.

the class OtherSettingsPresenter method addJaspiConfiguration.

// -------------------------------------------- JASPI Configuration
void addJaspiConfiguration() {
    Metadata metadata = metadataRegistry.lookup(AddressTemplates.JASPI_CONFIGURATION_TEMPLATE);
    Metadata metaServerAuth = metadata.forComplexAttribute(SERVER_AUTH_MODULES, true);
    metaServerAuth.copyComplexAttributeAttributes(asList(CLASS_NAME, MODULE, FLAG), metadata);
    String id = Ids.build(Ids.ELYTRON_JASPI, Ids.ADD);
    Form<ModelNode> form = new ModelNodeForm.Builder<>(id, metadata).unboundFormItem(new NameItem(), 0).unsorted().addOnly().build();
    String type = new LabelBuilder().label(JASPI_CONFIGURATION);
    form.getFormItem(CLASS_NAME).setRequired(true);
    new AddResourceDialog(resources.messages().addResourceTitle(type), form, (name, model) -> {
        ModelNode serverAuthModule = new ModelNode();
        serverAuthModule.get(CLASS_NAME).set(model.remove(CLASS_NAME));
        if (model.hasDefined(MODULE)) {
            serverAuthModule.get(MODULE).set(model.remove(MODULE));
        }
        if (model.hasDefined(FLAG)) {
            serverAuthModule.get(FLAG).set(model.remove(FLAG));
        }
        model.get(SERVER_AUTH_MODULES).add(serverAuthModule);
        crud.add(type, name, AddressTemplates.JASPI_CONFIGURATION_TEMPLATE, model, (name1, address) -> {
            reload(JASPI_CONFIGURATION, nodes -> getView().updateResourceElement(JASPI_CONFIGURATION, nodes));
        });
    }).show();
}
Also used : AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) FinishRemove(org.jboss.hal.ballroom.form.Form.FinishRemove) StatementContext(org.jboss.hal.meta.StatementContext) AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) TextBoxItem(org.jboss.hal.ballroom.form.TextBoxItem) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) FinishReset(org.jboss.hal.ballroom.form.Form.FinishReset) RequireAtLeastOneAttributeValidation(org.jboss.hal.core.mbui.form.RequireAtLeastOneAttributeValidation) Metadata(org.jboss.hal.meta.Metadata) Names(org.jboss.hal.resources.Names) ModelNodeHelper.asNamedNodes(org.jboss.hal.dmr.ModelNodeHelper.asNamedNodes) CrudOperations(org.jboss.hal.core.CrudOperations) ModelNodeHelper.move(org.jboss.hal.dmr.ModelNodeHelper.move) NameToken(com.gwtplatform.mvp.client.annotations.NameToken) ComplexAttributeOperations(org.jboss.hal.core.ComplexAttributeOperations) FinderPath(org.jboss.hal.core.finder.FinderPath) PathsAutoComplete(org.jboss.hal.core.configuration.PathsAutoComplete) List(java.util.List) LabelBuilder(org.jboss.hal.ballroom.LabelBuilder) MetadataRegistry(org.jboss.hal.meta.MetadataRegistry) ModelDescriptionConstants(org.jboss.hal.dmr.ModelDescriptionConstants) Finder(org.jboss.hal.core.finder.Finder) ValidationResult(org.jboss.hal.ballroom.form.ValidationResult) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) SupportsExpertMode(org.jboss.hal.core.mvp.SupportsExpertMode) ModelNode(org.jboss.hal.dmr.ModelNode) ProxyPlace(com.gwtplatform.mvp.client.proxy.ProxyPlace) Inject(javax.inject.Inject) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm) NameItem(org.jboss.hal.core.mbui.dialog.NameItem) SafeHtmlUtils(com.google.gwt.safehtml.shared.SafeHtmlUtils) Requires(org.jboss.hal.spi.Requires) ProxyCodeSplit(com.gwtplatform.mvp.client.annotations.ProxyCodeSplit) Operation(org.jboss.hal.dmr.Operation) Ids(org.jboss.hal.resources.Ids) AddressTemplates(org.jboss.hal.client.configuration.subsystem.elytron.AddressTemplates) FinderPathFactory(org.jboss.hal.core.finder.FinderPathFactory) EventBus(com.google.web.bindery.event.shared.EventBus) Consumer(java.util.function.Consumer) Dispatcher(org.jboss.hal.dmr.dispatch.Dispatcher) FormItem(org.jboss.hal.ballroom.form.FormItem) NameTokens(org.jboss.hal.meta.token.NameTokens) MbuiPresenter(org.jboss.hal.core.mbui.MbuiPresenter) Resources(org.jboss.hal.resources.Resources) SuggestCapabilitiesAutoComplete(org.jboss.hal.ballroom.autocomplete.SuggestCapabilitiesAutoComplete) MbuiView(org.jboss.hal.core.mbui.MbuiView) NamedNode(org.jboss.hal.dmr.NamedNode) Collections(java.util.Collections) Form(org.jboss.hal.ballroom.form.Form) NameItem(org.jboss.hal.core.mbui.dialog.NameItem) LabelBuilder(org.jboss.hal.ballroom.LabelBuilder) Metadata(org.jboss.hal.meta.Metadata) LabelBuilder(org.jboss.hal.ballroom.LabelBuilder) ModelNode(org.jboss.hal.dmr.ModelNode)

Example 25 with NameItem

use of org.jboss.hal.core.mbui.dialog.NameItem in project console by hal.

the class OtherSettingsPresenter method addCredentialStore.

// -------------------------------------------- Credential Store
void addCredentialStore() {
    Metadata metadata = metadataRegistry.lookup(CREDENTIAL_STORE_TEMPLATE);
    SafeHtml typeHelp = SafeHtmlUtils.fromString(metadata.getDescription().get(ATTRIBUTES).get(TYPE).get(DESCRIPTION).asString());
    Metadata crMetadata = metadata.forComplexAttribute(CREDENTIAL_REFERENCE, true);
    crMetadata.copyComplexAttributeAttributes(asList(STORE, ALIAS, TYPE, CLEAR_TEXT), metadata);
    TextBoxItem typeItem = new TextBoxItem("type-", resources.constants().type());
    String id = Ids.build(Ids.ELYTRON_CREDENTIAL_STORE, Ids.ADD);
    NameItem nameItem = new NameItem();
    ModelNodeForm<ModelNode> form = new ModelNodeForm.Builder<>(id, metadata).addOnly().unboundFormItem(nameItem, 0).include(CREATE, PATH, RELATIVE_TO, STORE, ALIAS, TYPE, CLEAR_TEXT).unboundFormItem(typeItem, 3, typeHelp).unsorted().build();
    form.getFormItem(RELATIVE_TO).registerSuggestHandler(new PathsAutoComplete());
    form.addFormValidation(new RequireAtLeastOneAttributeValidation<>(asList(STORE, CLEAR_TEXT), resources));
    form.addFormValidation(form1 -> {
        ValidationResult result = ValidationResult.OK;
        String typeValue = typeItem.getValue();
        FormItem<String> locationAttr = form1.getFormItem(PATH);
        boolean invalidLocation = locationAttr.isEmpty() && (typeItem.isEmpty() || Collections.binarySearch(FILE_BASED_CS, typeValue) > -1);
        if (invalidLocation) {
            form1.getFormItem(PATH).showError(resources.constants().requiredField());
            result = ValidationResult.invalid(resources.messages().pathRequired());
        }
        return result;
    });
    new AddResourceDialog(resources.messages().addResourceTitle(Names.CREDENTIAL_STORE), form, (name, model) -> {
        if (model != null) {
            move(model, STORE, CREDENTIAL_REFERENCE + "/" + STORE);
            move(model, ALIAS, CREDENTIAL_REFERENCE + "/" + ALIAS);
            move(model, TYPE, CREDENTIAL_REFERENCE + "/" + TYPE);
            move(model, CLEAR_TEXT, CREDENTIAL_REFERENCE + "/" + CLEAR_TEXT);
        }
        if (!typeItem.isEmpty()) {
            model.get(TYPE).set(typeItem.getValue());
        }
        ResourceAddress address = CREDENTIAL_STORE_TEMPLATE.resolve(statementContext, nameItem.getValue());
        crud.add(Names.CREDENTIAL_STORE, name, address, model, (n, a) -> reload(CREDENTIAL_STORE, nodes -> getView().updateResourceElement(CREDENTIAL_STORE, nodes)));
    }).show();
}
Also used : AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) FinishRemove(org.jboss.hal.ballroom.form.Form.FinishRemove) StatementContext(org.jboss.hal.meta.StatementContext) AddResourceDialog(org.jboss.hal.core.mbui.dialog.AddResourceDialog) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) TextBoxItem(org.jboss.hal.ballroom.form.TextBoxItem) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) FinishReset(org.jboss.hal.ballroom.form.Form.FinishReset) RequireAtLeastOneAttributeValidation(org.jboss.hal.core.mbui.form.RequireAtLeastOneAttributeValidation) Metadata(org.jboss.hal.meta.Metadata) Names(org.jboss.hal.resources.Names) ModelNodeHelper.asNamedNodes(org.jboss.hal.dmr.ModelNodeHelper.asNamedNodes) CrudOperations(org.jboss.hal.core.CrudOperations) ModelNodeHelper.move(org.jboss.hal.dmr.ModelNodeHelper.move) NameToken(com.gwtplatform.mvp.client.annotations.NameToken) ComplexAttributeOperations(org.jboss.hal.core.ComplexAttributeOperations) FinderPath(org.jboss.hal.core.finder.FinderPath) PathsAutoComplete(org.jboss.hal.core.configuration.PathsAutoComplete) List(java.util.List) LabelBuilder(org.jboss.hal.ballroom.LabelBuilder) MetadataRegistry(org.jboss.hal.meta.MetadataRegistry) ModelDescriptionConstants(org.jboss.hal.dmr.ModelDescriptionConstants) Finder(org.jboss.hal.core.finder.Finder) ValidationResult(org.jboss.hal.ballroom.form.ValidationResult) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) SupportsExpertMode(org.jboss.hal.core.mvp.SupportsExpertMode) ModelNode(org.jboss.hal.dmr.ModelNode) ProxyPlace(com.gwtplatform.mvp.client.proxy.ProxyPlace) Inject(javax.inject.Inject) ModelNodeForm(org.jboss.hal.core.mbui.form.ModelNodeForm) NameItem(org.jboss.hal.core.mbui.dialog.NameItem) SafeHtmlUtils(com.google.gwt.safehtml.shared.SafeHtmlUtils) Requires(org.jboss.hal.spi.Requires) ProxyCodeSplit(com.gwtplatform.mvp.client.annotations.ProxyCodeSplit) Operation(org.jboss.hal.dmr.Operation) Ids(org.jboss.hal.resources.Ids) AddressTemplates(org.jboss.hal.client.configuration.subsystem.elytron.AddressTemplates) FinderPathFactory(org.jboss.hal.core.finder.FinderPathFactory) EventBus(com.google.web.bindery.event.shared.EventBus) Consumer(java.util.function.Consumer) Dispatcher(org.jboss.hal.dmr.dispatch.Dispatcher) FormItem(org.jboss.hal.ballroom.form.FormItem) NameTokens(org.jboss.hal.meta.token.NameTokens) MbuiPresenter(org.jboss.hal.core.mbui.MbuiPresenter) Resources(org.jboss.hal.resources.Resources) SuggestCapabilitiesAutoComplete(org.jboss.hal.ballroom.autocomplete.SuggestCapabilitiesAutoComplete) MbuiView(org.jboss.hal.core.mbui.MbuiView) NamedNode(org.jboss.hal.dmr.NamedNode) Collections(java.util.Collections) Form(org.jboss.hal.ballroom.form.Form) ResourceAddress(org.jboss.hal.dmr.ResourceAddress) SafeHtml(com.google.gwt.safehtml.shared.SafeHtml) PathsAutoComplete(org.jboss.hal.core.configuration.PathsAutoComplete) LabelBuilder(org.jboss.hal.ballroom.LabelBuilder) Metadata(org.jboss.hal.meta.Metadata) ValidationResult(org.jboss.hal.ballroom.form.ValidationResult) TextBoxItem(org.jboss.hal.ballroom.form.TextBoxItem) NameItem(org.jboss.hal.core.mbui.dialog.NameItem) ModelNode(org.jboss.hal.dmr.ModelNode)

Aggregations

AddResourceDialog (org.jboss.hal.core.mbui.dialog.AddResourceDialog)37 NameItem (org.jboss.hal.core.mbui.dialog.NameItem)37 ModelNode (org.jboss.hal.dmr.ModelNode)37 Metadata (org.jboss.hal.meta.Metadata)35 ModelNodeForm (org.jboss.hal.core.mbui.form.ModelNodeForm)34 ResourceAddress (org.jboss.hal.dmr.ResourceAddress)32 List (java.util.List)28 Ids (org.jboss.hal.resources.Ids)28 EventBus (com.google.web.bindery.event.shared.EventBus)27 Inject (javax.inject.Inject)27 Form (org.jboss.hal.ballroom.form.Form)27 ModelDescriptionConstants (org.jboss.hal.dmr.ModelDescriptionConstants)27 StatementContext (org.jboss.hal.meta.StatementContext)27 Resources (org.jboss.hal.resources.Resources)27 Names (org.jboss.hal.resources.Names)26 Arrays.asList (java.util.Arrays.asList)25 CrudOperations (org.jboss.hal.core.CrudOperations)25 Finder (org.jboss.hal.core.finder.Finder)25 Dispatcher (org.jboss.hal.dmr.dispatch.Dispatcher)25 MetadataRegistry (org.jboss.hal.meta.MetadataRegistry)25