minor improvement for NIHVIVO-205 ontology upgrade
This commit is contained in:
parent
f5627b74a6
commit
4a3ef8d03d
2 changed files with 12 additions and 4 deletions
|
@ -59,9 +59,12 @@ public class OntologyUpdater {
|
||||||
settings.getAddedDataFile(), settings.getRemovedDataFile());
|
settings.getAddedDataFile(), settings.getRemovedDataFile());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update() throws IOException {
|
public boolean update() throws IOException {
|
||||||
|
|
||||||
// Check to see if the update is necessary.
|
// Check to see if the update is necessary.
|
||||||
if (updateRequired()) {
|
|
||||||
|
boolean updateRequired = updateRequired();
|
||||||
|
if (updateRequired) {
|
||||||
performUpdate();
|
performUpdate();
|
||||||
|
|
||||||
if (!logger.errorsWritten()) {
|
if (!logger.errorsWritten()) {
|
||||||
|
@ -74,6 +77,9 @@ public class OntologyUpdater {
|
||||||
record.writeChanges();
|
record.writeChanges();
|
||||||
logger.closeLogs();
|
logger.closeLogs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return updateRequired;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void performUpdate() throws IOException {
|
private void performUpdate() throws IOException {
|
||||||
|
|
|
@ -100,8 +100,10 @@ public class UpdateKnowledgeBase implements ServletContextListener {
|
||||||
settings.setNewTBoxAnnotationsModel(newTBoxAnnotationsModel);
|
settings.setNewTBoxAnnotationsModel(newTBoxAnnotationsModel);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
boolean updateRequired = (new OntologyUpdater(settings)).update();
|
||||||
|
if (updateRequired) {
|
||||||
doMiscAppMetadataReplacements(ctx.getRealPath(MISC_REPLACEMENTS_FILE), oms);
|
doMiscAppMetadataReplacements(ctx.getRealPath(MISC_REPLACEMENTS_FILE), oms);
|
||||||
(new OntologyUpdater(settings)).update();
|
}
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
String errMsg = "IOException updating knowledge base " +
|
String errMsg = "IOException updating knowledge base " +
|
||||||
"for ontology changes: ";
|
"for ontology changes: ";
|
||||||
|
|
Loading…
Add table
Reference in a new issue