Search in sources :

Example 1 with AddUnmanagedDialog

use of org.jboss.hal.client.deployment.dialog.AddUnmanagedDialog in project console by hal.

the class StandaloneDeploymentColumn method addUnmanaged.

private void addUnmanaged() {
    Metadata metadata = metadataRegistry.lookup(DEPLOYMENT_TEMPLATE);
    AddUnmanagedDialog dialog = new AddUnmanagedDialog(metadata, resources, (name, model) -> series(new FlowContext(progress.get()), new AddUnmanagedDeployment(dispatcher, name, model)).subscribe(new SuccessfulOutcome<FlowContext>(eventBus, resources) {

        @Override
        public void onSuccess(FlowContext context) {
            refresh(Ids.deployment(name));
            MessageEvent.fire(eventBus, Message.success(resources.messages().addResourceSuccess(Names.UNMANAGED_DEPLOYMENT, name)));
        }
    }));
    dialog.getForm().<String>getFormItem(NAME).addValidationHandler(createUniqueValidation());
    dialog.show();
}
Also used : Metadata(org.jboss.hal.meta.Metadata) AddUnmanagedDialog(org.jboss.hal.client.deployment.dialog.AddUnmanagedDialog) SuccessfulOutcome(org.jboss.hal.core.SuccessfulOutcome) FlowContext(org.jboss.hal.flow.FlowContext) AddUnmanagedDeployment(org.jboss.hal.client.deployment.DeploymentTasks.AddUnmanagedDeployment)

Example 2 with AddUnmanagedDialog

use of org.jboss.hal.client.deployment.dialog.AddUnmanagedDialog in project console by hal.

the class ContentColumn method addUnmanaged.

private void addUnmanaged() {
    Metadata metadata = metadataRegistry.lookup(CONTENT_TEMPLATE);
    AddUnmanagedDialog dialog = new AddUnmanagedDialog(metadata, resources, (name, model) -> series(new FlowContext(progress.get()), new AddUnmanagedDeployment(dispatcher, name, model)).subscribe(new org.jboss.hal.core.SuccessfulOutcome<FlowContext>(eventBus, resources) {

        @Override
        public void onSuccess(FlowContext context) {
            refresh(Ids.content(name));
            MessageEvent.fire(eventBus, Message.success(resources.messages().addResourceSuccess(Names.UNMANAGED_DEPLOYMENT, name)));
        }
    }));
    dialog.getForm().<String>getFormItem(NAME).addValidationHandler(createUniqueValidation());
    dialog.show();
}
Also used : Metadata(org.jboss.hal.meta.Metadata) AddUnmanagedDialog(org.jboss.hal.client.deployment.dialog.AddUnmanagedDialog) FlowContext(org.jboss.hal.flow.FlowContext) AddUnmanagedDeployment(org.jboss.hal.client.deployment.DeploymentTasks.AddUnmanagedDeployment)

Example 3 with AddUnmanagedDialog

use of org.jboss.hal.client.deployment.dialog.AddUnmanagedDialog in project console by hal.

the class ServerGroupDeploymentColumn method addUnmanaged.

private void addUnmanaged() {
    Metadata metadata = metadataRegistry.lookup(CONTENT_TEMPLATE);
    AddUnmanagedDialog dialog = new AddUnmanagedDialog(metadata, resources, (name, model) -> {
        if (model != null) {
            String serverGroup = statementContext.selectedServerGroup();
            String runtimeName = model.get(RUNTIME_NAME).asString();
            series(new FlowContext(progress.get()), new AddUnmanagedDeployment(dispatcher, name, model), new AddServerGroupDeployment(environment, dispatcher, name, runtimeName, serverGroup)).subscribe(new SuccessfulOutcome<FlowContext>(eventBus, resources) {

                @Override
                public void onSuccess(FlowContext context) {
                    refresh(Ids.serverGroupDeployment(serverGroup, name));
                    MessageEvent.fire(eventBus, Message.success(resources.messages().addResourceSuccess(Names.UNMANAGED_DEPLOYMENT, name)));
                }
            });
        }
    });
    dialog.getForm().<String>getFormItem(NAME).addValidationHandler(createUniqueValidation());
    dialog.show();
}
Also used : AddServerGroupDeployment(org.jboss.hal.client.deployment.DeploymentTasks.AddServerGroupDeployment) Metadata(org.jboss.hal.meta.Metadata) AddUnmanagedDialog(org.jboss.hal.client.deployment.dialog.AddUnmanagedDialog) FlowContext(org.jboss.hal.flow.FlowContext) AddUnmanagedDeployment(org.jboss.hal.client.deployment.DeploymentTasks.AddUnmanagedDeployment)

Aggregations

AddUnmanagedDeployment (org.jboss.hal.client.deployment.DeploymentTasks.AddUnmanagedDeployment)3 AddUnmanagedDialog (org.jboss.hal.client.deployment.dialog.AddUnmanagedDialog)3 FlowContext (org.jboss.hal.flow.FlowContext)3 Metadata (org.jboss.hal.meta.Metadata)3 AddServerGroupDeployment (org.jboss.hal.client.deployment.DeploymentTasks.AddServerGroupDeployment)1 SuccessfulOutcome (org.jboss.hal.core.SuccessfulOutcome)1