logger.trace("campaign: " + campaign);
}
catch(ObjectCreationException e) {
logger.error("Unable to create campaign: " + e.getLocalizedMessage(), e);
alertService.addAlert(new Alert(Alert.Type.INFO, this.getClass().getSimpleName(), Messages
.getString("campaign.srd4.ui.action.campaign.create.error.factory.text")));
return;
}
try {
// create a dialog to get information from the user
ICampaignBuilderDialog dialog = (ICampaignBuilderDialog)appContext.getBean("srd4CampaignBuilderDialog",
new Object[] { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell() });
campaignBuilder.setDialog(dialog);
if(!campaignBuilder.buildCampaign(campaign)) {
logger.info("Campaign build was incomplete; see previous log entries for details.");
alertService.addAlert(new Alert(Alert.Type.INFO, this.getClass().getSimpleName(), Messages
.getString("campaign.srd4.ui.action.campaign.create.error.build_incomplete.text")));
return;
}
}
catch(ObjectBuilderException e) {
logger.error("Exception while trying to build campaign: " + e.getLocalizedMessage(), e);
alertService
.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e.getLocalizedMessage()));
return;
}
try {
campaignManager.registerCampaign(campaign);
campaign.save();
}
catch(Exception e) {
logger.error("Exception while trying to register/save campaign: " + e.getLocalizedMessage(), e);
alertService
.addAlert(new Alert(Alert.Type.ERROR, this.getClass().getSimpleName(), e.getLocalizedMessage()));
}
}