// load the model
if (editor.getModel() == null) {
try {
editor.setModel(CamelContextIOUtils.loadModelFromFile(camelContextFile));
editor.setCamelContextFile(camelContextFile);
ValidationHandler status = CamelContextIOUtils.validateModel(editor.getModel());
if (status.hasErrors()) {
Activator.getLogger().error("Unable to validate the model. Invalid input!");
return false;
}
} catch (PartInitException pe) {
Activator.getLogger().error("Unable to load the model. Invalid input!", pe);
return false;
}
}
return true;
} else {
IRemoteCamelEditorInput remoteEditorInput = editor.asRemoteCamelEditorInput(input);
if (remoteEditorInput != null) {
camelContextFile = null;
container = null;
// load the model
if (editor.getModel() == null) {
try {
String text = remoteEditorInput.getXml();
try {
editor.setModel(CamelContextIOUtils.loadModelFromText(text));
ValidationHandler status = CamelContextIOUtils.validateModel(editor.getModel());
if (status.hasErrors()) {
Activator.getLogger().error("Unable to validate the model. Invalid input!");
return false;
}
} catch (PartInitException pe) {
Activator.getLogger().error("Unable to load the model. Invalid input!", pe);