Revision 8c54ac7b
Added by Patrick Plitzner almost 8 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStoreConnector.java | ||
---|---|---|
35 | 35 |
import eu.etaxonomy.cdm.model.metadata.CdmMetaData; |
36 | 36 |
import eu.etaxonomy.cdm.model.name.NomenclaturalStatusType; |
37 | 37 |
import eu.etaxonomy.cdm.model.name.Rank; |
38 |
import eu.etaxonomy.taxeditor.Messages; |
|
38 | 39 |
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter; |
39 | 40 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
40 | 41 |
import eu.etaxonomy.taxeditor.remoting.source.ICdmRemoteSource; |
... | ... | |
64 | 65 |
ICdmSource cdmSource, |
65 | 66 |
DbSchemaValidation dbSchemaValidation, |
66 | 67 |
Resource applicationContextBean) { |
67 |
super(String.format("Creating data model for %s", cdmSource));
|
|
68 |
super(String.format(Messages.CdmStoreConnector_CREATING_DATAMODEL, cdmSource));
|
|
68 | 69 |
this.display = display; |
69 | 70 |
this.cdmSource = cdmSource; |
70 | 71 |
this.dbSchemaValidation = dbSchemaValidation; |
... | ... | |
113 | 114 |
return Status.OK_STATUS; |
114 | 115 |
} catch (Exception e) { |
115 | 116 |
if(! causeIsCancelationExceptionRecursive(e)){ |
116 |
MessagingUtils.errorDialog("Could not create data model", CdmStoreConnector.class, "An error occurred while trying to create "
|
|
117 |
+ "data model for data source: " + cdmSource.getName()+"\n Please clear the data base and retry. ", TaxeditorStorePlugin.PLUGIN_ID, e, true);
|
|
117 |
MessagingUtils.errorDialog(Messages.CdmStoreConnector_COULD_NOT_CREATE_DATAMODEL, CdmStoreConnector.class,
|
|
118 |
String.format(Messages.CdmStoreConnector_ERROR_DURING_DATAMODEL_CREATION, cdmSource.getName()), TaxeditorStorePlugin.PLUGIN_ID, e, true);
|
|
118 | 119 |
return Status.CANCEL_STATUS; |
119 | 120 |
} |
120 | 121 |
} finally { |
... | ... | |
182 | 183 |
|
183 | 184 |
if (!monitor.isCanceled()) { |
184 | 185 |
CdmStore.setInstance(applicationController, cdmSource); |
185 |
monitor.subTask("Authenticating user");
|
|
186 |
monitor.subTask(Messages.CdmStoreConnector_AUTHENTICATING_USER);
|
|
186 | 187 |
display.syncExec(new Runnable() { |
187 | 188 |
/* |
188 | 189 |
* (non-Javadoc) |
... | ... | |
280 | 281 |
* @throws SQLException |
281 | 282 |
*/ |
282 | 283 |
private void checkDbSchemaVersionCompatibility(IProgressMonitor monitor) { |
283 |
monitor.subTask("Checking if datasource is compatible with this editor.");
|
|
284 |
monitor.subTask(Messages.CdmStoreConnector_CHECK_IF_EDITOR_IS_COMPATIBLE);
|
|
284 | 285 |
String dbSchemaVersion; |
285 | 286 |
|
286 | 287 |
String message = null; |
... | ... | |
294 | 295 |
// if the datasource version is greater than the taxeditor compatible version then the taxeditor needs to |
295 | 296 |
// be updated else the datasource needs to be updated |
296 | 297 |
if(compareVersion > 0) { |
297 |
message = "Please update the Taxonomic Editor (Help->Check for Updates) or choose a compatible datasource";
|
|
298 |
message = Messages.CdmStoreConnector_UPDATE_EDITOR_OR_CHOOSE_COMPATIBLE_DATASOURCE;
|
|
298 | 299 |
} else if (compareVersion < 0) { |
299 |
message = "Please update the chosen datasource or choose a new data source to connect to in the Datasource View.";
|
|
300 |
message = Messages.CdmStoreConnector_UPDATE_DATASOUREC_OR_CHOOSE_NEW_DATASOURCE;
|
|
300 | 301 |
} |
301 | 302 |
} |
302 | 303 |
monitor.worked(1); |
... | ... | |
308 | 309 |
// Show an error message |
309 | 310 |
MessagingUtils |
310 | 311 |
.messageDialog( |
311 |
"Datasource Compatibility Check failed",
|
|
312 |
Messages.CdmStoreConnector_COMPATIBILITY_CHECK_FAILED,
|
|
312 | 313 |
this, |
313 |
"The database schema for the chosen " |
|
314 |
+ "datasource '" |
|
315 |
+ cdmSource |
|
316 |
+ "' \n is not compatible for this version of the taxonomic editor. \n\n" |
|
317 |
+ message, |
|
314 |
String.format(Messages.CdmStoreConnector_SCHEME_NOT_COMPATIBLE, cdmSource, message), |
|
318 | 315 |
null); |
319 | 316 |
|
320 | 317 |
monitor.setCanceled(true); |
... | ... | |
323 | 320 |
} |
324 | 321 |
|
325 | 322 |
private void checkIsNonEmptyCdmDatabase(IProgressMonitor monitor) { |
326 |
monitor.subTask("Checking if datasource is a non empty CDM database.");
|
|
323 |
monitor.subTask(Messages.CdmStoreConnector_CHECK_IF_NON_EMPTY);
|
|
327 | 324 |
boolean isDbEmpty = false; |
328 | 325 |
try { |
329 | 326 |
isDbEmpty = cdmSource.isDbEmpty(); |
... | ... | |
347 | 344 |
|
348 | 345 |
private void checkDatabaseReachable(IProgressMonitor monitor) { |
349 | 346 |
try { |
350 |
monitor.subTask("Checking if datasource is reachable.");
|
|
347 |
monitor.subTask(Messages.CdmStoreConnector_CHECK_IF_REACHABLE);
|
|
351 | 348 |
cdmSource.checkConnection(); |
352 | 349 |
monitor.worked(1); |
353 | 350 |
} catch (CdmSourceException e) { |
354 |
MessagingUtils.messageDialog("Could not connect to chosen datasource",
|
|
355 |
this, "Reason: " + e.getMessage(), e);
|
|
351 |
MessagingUtils.messageDialog(Messages.CdmStoreConnector_COULD_NOT_CONNECT_TO_CHOSEN_DATASOURCE,
|
|
352 |
this, Messages.CdmStoreConnector_REASON + e.getMessage(), e);
|
|
356 | 353 |
monitor.setCanceled(true); |
357 | 354 |
} |
358 | 355 |
} |
Also available in: Unified diff
More i18n for #5758