Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JBIDE-17205] storing cartridge type for ICartridgeAppTemplate #395

Merged
merged 1 commit into from
Apr 28, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ public CreateApplicationJob(final String name, final ApplicationScale scale,
OpenShiftExpressUIMessages.CREATING_APPLICATION
: OpenShiftExpressUIMessages.CREATING_APPLICATION_WITH_EMBEDDED)
, name));
Assert.isLegal(!StringUtils.isEmpty(name), "No application name provided.");
this.name = name;
this.scale = scale;
this.gear = gear;
this.initialGitUrl = initialGitUrl;
Assert.isLegal(domain != null, "No domain provided.");
this.domain = domain;
this.environmentVariables = environmentVariables;
Assert.isLegal(cartridges != null
&& cartridges.size() >= 1, "No application type provided.");
this.cartridges = cartridges;
}

@Override
protected IStatus doRun(IProgressMonitor monitor) {
try {
Assert.isLegal(!StringUtils.isEmpty(name), "No application name provided.");
Assert.isLegal(domain != null, "No domain provided.");
Assert.isLegal(cartridges != null
&& cartridges.size() >= 1, "No application type provided.");
try {
this.application = new ApplicationBuilder(domain)
.setName(name)
Expand All @@ -103,7 +103,7 @@ protected IStatus doRun(IProgressMonitor monitor) {
} catch (Exception e) {
safeRefreshDomain();
return OpenShiftUIActivator.createErrorStatus(
OpenShiftExpressUIMessages.COULD_NOT_CREATE_APPLICATION, e, name);
OpenShiftExpressUIMessages.COULD_NOT_CREATE_APPLICATION, e, StringUtils.nullToEmptyString(name));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CANNOT_CREATE_NO_USER=Could not create application, have no valid user credentials
CREATING_APPLICATION=Creating application "{0}"...
CREATING_APPLICATION_WITH_EMBEDDED=Creating application "{0}" with embedded cartridges...
COULD_NOT_CREATE_APPLICATION=Could not create application "{0}"
CREATING_APPLICATION_WITH_EMBEDDED=Creating application {0} with embedded cartridges...
COULD_NOT_CREATE_APPLICATION=Could not create application {0}
DESTROYING_DOMAIN=Destroying domain {0}...
OPERATION_CANCELLED=Operation was cancelled by user.
WAITING_FOR_REACHABLE=Waiting for application "{0}" to become reachable...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ private IStatus createApplication() {
} catch (Exception e) {
return OpenShiftUIActivator.createErrorStatus(
NLS.bind("Could not create application {0}", model.getApplicationName()), e);

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@ public IApplicationTemplate setSelectedApplicationTemplate(IApplicationTemplate
private void setSelectedCartridges(IApplicationTemplate template) {
if (template instanceof IQuickstartApplicationTemplate) {
setCartridges(getFirstAlternatives((IQuickstartApplicationTemplate) template));
} else if (template instanceof ICartridgeApplicationTemplate) {
setCartridges(Collections.<ICartridge> singleton(((ICartridgeApplicationTemplate) template).getCartridge()));
} else {
setCartridges(new HashSet<ICartridge>());
}
Expand Down