Prevent storing Tags if the elastic service is unavailable
This commit is contained in:
parent
4a9c589636
commit
a8015064a8
|
@ -1427,11 +1427,11 @@ public class DataManagementPlanManager {
|
||||||
eu.eudat.elastic.entities.Dataset elastic = apiContext.getOperationsContext().getElasticRepository().getDatasetRepository().findDocument(dataset.getId().toString());
|
eu.eudat.elastic.entities.Dataset elastic = apiContext.getOperationsContext().getElasticRepository().getDatasetRepository().findDocument(dataset.getId().toString());
|
||||||
if (elastic != null) {
|
if (elastic != null) {
|
||||||
tags = elastic.getTags();
|
tags = elastic.getTags();
|
||||||
|
DatasetWizardModel datasetWizardModel = new DatasetWizardModel().fromDataModel(dataset);
|
||||||
|
datasetWizardModel.setTags(tags);
|
||||||
|
datasetManager.getTagsFromProfile(datasetWizardModel, dataset);
|
||||||
|
datasetManager.updateTags(dataset, datasetWizardModel.getTags());
|
||||||
}
|
}
|
||||||
DatasetWizardModel datasetWizardModel = new DatasetWizardModel().fromDataModel(dataset);
|
|
||||||
datasetWizardModel.setTags(tags);
|
|
||||||
datasetManager.getTagsFromProfile(datasetWizardModel, dataset);
|
|
||||||
datasetManager.updateTags(dataset, datasetWizardModel.getTags());
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e.getMessage(), e);
|
logger.error(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -567,7 +567,9 @@ public class DatasetManager {
|
||||||
eu.eudat.data.entities.Dataset dataset = datasetWizardModel.toDataModel();
|
eu.eudat.data.entities.Dataset dataset = datasetWizardModel.toDataModel();
|
||||||
dataset.setDmp(dmp);
|
dataset.setDmp(dmp);
|
||||||
dataset.setProperties(propertiesModelToString(datasetWizardModel.getDatasetProfileDefinition()));
|
dataset.setProperties(propertiesModelToString(datasetWizardModel.getDatasetProfileDefinition()));
|
||||||
this.getTagsFromProfile(datasetWizardModel, dataset);
|
if (this.apiContext.getOperationsContext().getElasticRepository().getDatasetRepository().getClient() != null) {
|
||||||
|
this.getTagsFromProfile(datasetWizardModel, dataset);
|
||||||
|
}
|
||||||
if (datasetWizardModel.getStatus() == (int) Dataset.Status.FINALISED.getValue())
|
if (datasetWizardModel.getStatus() == (int) Dataset.Status.FINALISED.getValue())
|
||||||
checkDatasetValidation(dataset);
|
checkDatasetValidation(dataset);
|
||||||
UserInfo userInfo = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
UserInfo userInfo = apiContext.getOperationsContext().getBuilderFactory().getBuilder(UserInfoBuilder.class).id(principal.getId()).build();
|
||||||
|
|
Loading…
Reference in New Issue