private Map<String, Object> initPropListForUI(TableSyntaxNode tableSearch) { Map<String, Object> prop = new HashMap<String, Object>(); for(TableProperty propForSearch : propsForSearch) { String propName = propForSearch.getName(); String propDisplName = TablePropertyDefinitionUtils.getPropertyDisplayName(propName); Object propValue = tableSearch.getTableProperties().getPropertyValue(propName); if(propValue==null) { propValue = new String(EMPTY_VALUE); } prop.put(propDisplName, propValue); } return prop; }
@Override public ValidationResult validateTables(OpenL openl, TableSyntaxNode[] tableSyntaxNodes, IOpenClass openClass) { Collection<OpenLMessage> messages = new LinkedHashSet<>(); for (TableSyntaxNode tsn : tableSyntaxNodes) { if (PropertiesChecker.isPropertySuitableForTableType(propertyName, tsn.getType()) && (tsn.getTableProperties() != null && tsn.getTableProperties() .getPropertyLevelDefinedOn(propertyName) == InheritanceLevel.TABLE)) { String propertyValue = (String) tsn.getTableProperties().getPropertyValue(propertyName); if (propertyValue == null || !propertyValue.matches(constraintsStr)) { SyntaxNodeException exception = SyntaxNodeExceptionUtils .createError(String.format("Incorrect value \"%s\" for property \"%s\"", propertyValue, TablePropertyDefinitionUtils.getPropertyDisplayName(propertyName)), tsn); tsn.addError(exception); messages.add(new OpenLErrorMessage(exception)); } } } return ValidationUtils.withMessages(messages); }
private void checkVersionPropertyExistance(){ TableProperty versionProperty = super.getVersion(); if(versionProperty == null){ //property "version" is absent in base table versionProperty = new TablePropertyBuilder(VERSION_PROP_NAME, TablePropertyDefinitionUtils.getPropertyTypeByPropertyName(VERSION_PROP_NAME)) .displayName(TablePropertyDefinitionUtils.getPropertyDisplayName(VERSION_PROP_NAME)) .value(INIT_VERSION).build(); getPropertiesManager().addProperty(versionProperty); } }
private void checkPropertiesExistance() { TableProperty versionProperty = super.getVersion(); if (versionProperty == null) { // Property "version" is absent in base table versionProperty = new TablePropertyBuilder(VERSION_PROP_NAME, TablePropertyDefinitionUtils.getPropertyTypeByPropertyName(VERSION_PROP_NAME)) .displayName(TablePropertyDefinitionUtils.getPropertyDisplayName(VERSION_PROP_NAME)) .value(getOriginalVersion().toString()).build(); getPropertiesManager().addProperty(versionProperty); } }
private void checkPropertiesExistance() { TableProperty versionProperty = super.getVersion(); if (versionProperty == null) { // Property "version" is absent in base table versionProperty = new TablePropertyBuilder(VERSION_PROP_NAME, TablePropertyDefinitionUtils.getPropertyTypeByPropertyName(VERSION_PROP_NAME)) .displayName(TablePropertyDefinitionUtils.getPropertyDisplayName(VERSION_PROP_NAME)) .value(getOriginalVersion().toString()).build(); getPropertiesManager().addProperty(versionProperty); } }