Added geolocation property check.

This commit is contained in:
Christian P. MOMON 2021-09-09 11:49:47 +02:00
parent 6288224e49
commit 63dd407749

View file

@ -47,6 +47,7 @@ public class PropertyChecker
public static final String WEEKS = "^\\d*(,\\d*){0,52}$"; public static final String WEEKS = "^\\d*(,\\d*){0,52}$";
public static final String DAYS = "^\\d*(,\\d*){0,365}$"; public static final String DAYS = "^\\d*(,\\d*){0,365}$";
public static final String COUNTRY_CODE = "^[a-zA-Z]{2}$"; public static final String COUNTRY_CODE = "^[a-zA-Z]{2}$";
public static final String DECIMAL_DEGREE = "^[+-]?\\d+[,\\.]\\d{1,8}$";
public static final String SUBS = "^subs\\.\\S+$"; public static final String SUBS = "^subs\\.\\S+$";
public static final String METRICS_NAME = "^metrics\\.\\S+\\.name$"; public static final String METRICS_NAME = "^metrics\\.\\S+\\.name$";
@ -131,8 +132,8 @@ public class PropertyChecker
this.organizationRules.add("organization.country.name", STRING, PropertyMode.WISHED); this.organizationRules.add("organization.country.name", STRING, PropertyMode.WISHED);
this.organizationRules.add("organization.country.code", COUNTRY_CODE, PropertyMode.MANDATORY); this.organizationRules.add("organization.country.code", COUNTRY_CODE, PropertyMode.MANDATORY);
this.organizationRules.add("organization.funding.*", "^organization\\.funding\\.\\S+$", STRING, PropertyMode.OPTIONAL); this.organizationRules.add("organization.funding.*", "^organization\\.funding\\.\\S+$", STRING, PropertyMode.OPTIONAL);
this.organizationRules.add("organization.geolocation.latitude", STRING, PropertyMode.OPTIONAL); this.organizationRules.add("organization.geolocation.latitude", DECIMAL_DEGREE, PropertyMode.OPTIONAL);
this.organizationRules.add("organization.geolocation.longitude", STRING, PropertyMode.OPTIONAL); this.organizationRules.add("organization.geolocation.longitude", DECIMAL_DEGREE, PropertyMode.OPTIONAL);
this.organizationRules.add("organization.geolocation.address", STRING, PropertyMode.OPTIONAL); this.organizationRules.add("organization.geolocation.address", STRING, PropertyMode.OPTIONAL);
this.organizationRules.add(SUBS, URL, PropertyMode.OPTIONAL); this.organizationRules.add(SUBS, URL, PropertyMode.OPTIONAL);