Revision 41e2f693
Added by Cherian Mathew over 9 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/CdmStore.java | ||
---|---|---|
44 | 44 |
import eu.etaxonomy.taxeditor.io.ExportManager; |
45 | 45 |
import eu.etaxonomy.taxeditor.io.ImportManager; |
46 | 46 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
47 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
47 | 48 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
48 | 49 |
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin; |
49 | 50 |
import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart; |
... | ... | |
101 | 102 |
return instance; |
102 | 103 |
} else if (instance == null || !instance.isConnected) { |
103 | 104 |
|
104 |
AbstractUtility
|
|
105 |
MessagingUtils
|
|
105 | 106 |
.warningDialog( |
106 | 107 |
"Application is not connected to a datastore", |
107 | 108 |
instance, |
... | ... | |
125 | 126 |
cdmSource = CdmDataSourceRepository.getCurrentCdmSource(); |
126 | 127 |
connect(cdmSource); |
127 | 128 |
} catch (CdmRemoteSourceException e) { |
128 |
StoreUtil.errorDialog("Connection to CDM Source Failed", CdmStore.class, "Could not connect to target CDM Source", e);
|
|
129 |
MessagingUtils.messageDialog("Connection to CDM Source Failed", CdmStore.class, "Could not connect to target CDM Source", e);
|
|
129 | 130 |
} |
130 | 131 |
|
131 | 132 |
|
... | ... | |
152 | 153 |
private static void connect(final ICdmSource cdmSource, |
153 | 154 |
final DbSchemaValidation dbSchemaValidation, |
154 | 155 |
final Resource applicationContextBean) { |
155 |
StoreUtil.info("Connecting to datasource: " + cdmSource);
|
|
156 |
MessagingUtils.info("Connecting to datasource: " + cdmSource);
|
|
156 | 157 |
|
157 | 158 |
job = new CdmStoreConnector(Display.getDefault(), cdmSource, |
158 | 159 |
dbSchemaValidation, applicationContextBean); |
... | ... | |
216 | 217 |
try { |
217 | 218 |
return applicationConfiguration; |
218 | 219 |
} catch (Exception e) { |
219 |
StoreUtil.error(CdmStore.class, e);
|
|
220 |
MessagingUtils.error(CdmStore.class, e);
|
|
220 | 221 |
} |
221 | 222 |
return null; |
222 | 223 |
} |
... | ... | |
254 | 255 |
try{ |
255 | 256 |
conversation.startTransaction(); |
256 | 257 |
}catch(Exception e){ |
257 |
StoreUtil.errorDialog("No database connection", CdmStore.class, "No database connection available", e);
|
|
258 |
MessagingUtils.messageDialog("No database connection", CdmStore.class, "No database connection available", e);
|
|
258 | 259 |
} |
259 | 260 |
return conversation; |
260 | 261 |
} |
... | ... | |
283 | 284 |
service = (T) method.invoke(configuration, null); |
284 | 285 |
break; |
285 | 286 |
} catch (IllegalArgumentException e) { |
286 |
StoreUtil.error(CdmStore.class, e);
|
|
287 |
MessagingUtils.error(CdmStore.class, e);
|
|
287 | 288 |
} catch (IllegalAccessException e) { |
288 |
StoreUtil.error(CdmStore.class, e);
|
|
289 |
MessagingUtils.error(CdmStore.class, e);
|
|
289 | 290 |
} catch (InvocationTargetException e) { |
290 |
StoreUtil.error(CdmStore.class, e);
|
|
291 |
MessagingUtils.error(CdmStore.class, e);
|
|
291 | 292 |
} |
292 | 293 |
} |
293 | 294 |
} |
Also available in: Unified diff
Moved all logging and dialog functionality to the new class MessagingUtils.
Refactoring code to adapt to above change.
Added new custom error dialog - CdmErrorDialog
Added runtime exception handling to the ApplicationWorkbenchAdvisor by adding a custom status handler