Add visibility rules checkup on dataset finalize checkup
This commit is contained in:
parent
5483847754
commit
be311f238b
|
@ -673,9 +673,18 @@ public class DatasetManager {
|
|||
datasetProfileValidators.add(node.getNodeValue());
|
||||
}
|
||||
|
||||
|
||||
JSONObject obj = new JSONObject(dataset.getProperties());
|
||||
VisibilityRuleService visibilityRuleService = this.apiContext.getUtilitiesService().getVisibilityRuleService();
|
||||
visibilityRuleService.setProperties(obj.toMap());
|
||||
|
||||
dataset.setProfile(profile);
|
||||
PagedDatasetProfile pagedDatasetProfile = this.getPagedProfile(new DatasetWizardModel(), dataset);
|
||||
visibilityRuleService.buildVisibilityContext(pagedDatasetProfile.getRules());
|
||||
|
||||
|
||||
for (String validator : datasetProfileValidators) {
|
||||
if (obj.getString(validator) == null || obj.getString(validator).trim().isEmpty()) {
|
||||
if ((obj.getString(validator) == null || obj.getString(validator).trim().isEmpty()) && visibilityRuleService.isElementVisible(validator)) {
|
||||
throw new Exception("Field value of " + validator + " must be filled.");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue