use of org.jboss.hal.client.deployment.wizard.DeploymentState in project console by hal.
the class ContentColumn method uploadContent.
private void uploadContent() {
Metadata metadata = metadataRegistry.lookup(CONTENT_TEMPLATE);
Wizard<DeploymentContext, DeploymentState> wizard = new Wizard.Builder<DeploymentContext, DeploymentState>(resources.messages().addResourceTitle(resources.constants().content()), new DeploymentContext()).addStep(UPLOAD, new UploadContentStep(resources)).addStep(NAMES, new NamesStep(environment, metadata, resources)).onBack((context, currentState) -> currentState == NAMES ? UPLOAD : null).onNext((context, currentState) -> currentState == UPLOAD ? NAMES : null).stayOpenAfterFinish().onFinish((wzd, context) -> {
String name = context.name;
String runtimeName = context.runtimeName;
wzd.showProgress(resources.constants().uploadInProgress(), resources.messages().uploadInProgress(name));
series(new FlowContext(progress.get()), new CheckDeployment(dispatcher, name), new UploadOrReplace(environment, dispatcher, name, runtimeName, context.file, false)).subscribe(new Outcome<FlowContext>() {
@Override
public void onError(FlowContext context, Throwable error) {
wzd.showError(resources.constants().uploadError(), resources.messages().uploadError(name), error.getMessage());
}
@Override
public void onSuccess(FlowContext context) {
refresh(Ids.content(name));
wzd.showSuccess(resources.constants().uploadSuccessful(), resources.messages().uploadSuccessful(name), resources.messages().view(resources.constants().content()), cxt -> {
/* nothing to do, content is already selected */
});
}
});
}).build();
wizard.show();
}
use of org.jboss.hal.client.deployment.wizard.DeploymentState in project console by hal.
the class ServerGroupDeploymentColumn method uploadAndDeploy.
private void uploadAndDeploy() {
Metadata metadata = metadataRegistry.lookup(SERVER_GROUP_DEPLOYMENT_TEMPLATE);
Wizard<DeploymentContext, DeploymentState> wizard = new Wizard.Builder<DeploymentContext, DeploymentState>(resources.messages().addResourceTitle(resources.constants().content()), new DeploymentContext()).addStep(UPLOAD, new UploadDeploymentStep(resources)).addStep(NAMES, new NamesStep(environment, metadata, resources)).onBack((context, currentState) -> currentState == NAMES ? UPLOAD : null).onNext((context, currentState) -> currentState == UPLOAD ? NAMES : null).stayOpenAfterFinish().onFinish((wzd, context) -> {
String name = context.name;
String runtimeName = context.runtimeName;
wzd.showProgress(resources.constants().deploymentInProgress(), resources.messages().deploymentInProgress(name));
series(new FlowContext(progress.get()), new CheckDeployment(dispatcher, name), new UploadOrReplace(environment, dispatcher, name, runtimeName, context.file, false), new AddServerGroupDeployment(environment, dispatcher, name, runtimeName, statementContext.selectedServerGroup())).subscribe(new Outcome<FlowContext>() {
@Override
public void onError(FlowContext context, Throwable error) {
wzd.showError(resources.constants().deploymentError(), resources.messages().deploymentError(name), error.getMessage());
}
@Override
public void onSuccess(FlowContext context) {
refresh(Ids.serverGroupDeployment(statementContext.selectedServerGroup(), name));
wzd.showSuccess(resources.constants().deploymentSuccessful(), resources.messages().deploymentSuccessful(name), resources.messages().view(Names.DEPLOYMENT), cxt -> {
/* nothing to do, content is already selected */
});
}
});
}).build();
wizard.show();
}
use of org.jboss.hal.client.deployment.wizard.DeploymentState in project console by hal.
the class StandaloneDeploymentColumn method uploadDeployment.
private void uploadDeployment() {
Metadata metadata = metadataRegistry.lookup(DEPLOYMENT_TEMPLATE);
Wizard<DeploymentContext, DeploymentState> wizard = new Wizard.Builder<DeploymentContext, DeploymentState>(resources.messages().addResourceTitle(Names.DEPLOYMENT), new DeploymentContext()).addStep(UPLOAD, new UploadDeploymentStep(resources)).addStep(NAMES, new NamesStep(environment, metadata, resources)).onBack((context, currentState) -> currentState == NAMES ? UPLOAD : null).onNext((context, currentState) -> currentState == UPLOAD ? NAMES : null).stayOpenAfterFinish().onFinish((wzd, context) -> {
String name = context.name;
String runtimeName = context.runtimeName;
wzd.showProgress(resources.constants().deploymentInProgress(), resources.messages().deploymentInProgress(name));
series(new FlowContext(progress.get()), new CheckDeployment(dispatcher, name), new UploadOrReplace(environment, dispatcher, name, runtimeName, context.file, context.enabled)).subscribe(new Outcome<FlowContext>() {
@Override
public void onError(FlowContext context, Throwable error) {
wzd.showError(resources.constants().deploymentError(), resources.messages().deploymentError(name), error.getMessage());
}
@Override
public void onSuccess(FlowContext context) {
refresh(Ids.deployment(name));
wzd.showSuccess(resources.constants().uploadSuccessful(), resources.messages().uploadSuccessful(name), resources.messages().view(Names.DEPLOYMENT), cxt -> {
/* nothing to do, deployment is already selected */
});
}
});
}).build();
wizard.show();
}
Aggregations