As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
/** * Sets the default property values * * @param classDefinition the model type definition for which to get defaults * @param properties the properties of the node */ protected void addDefaultPropertyValues(ClassDefinition classDefinition, Map<QName, Serializable> properties) { for (Map.Entry<QName, Serializable> entry : classDefinition.getDefaultValues().entrySet()) { if (properties.containsKey(entry.getKey())) { // property is present continue; } Serializable value = entry.getValue(); // Check the type of the default property PropertyDefinition prop = this.dictionaryService.getProperty(entry.getKey()); if (prop == null) { // dictionary doesn't have a default value present continue; } // TODO: what other conversions are necessary here for other types of default values ? // ensure that we deliver the property in the correct form if (DataTypeDefinition.BOOLEAN.equals(prop.getDataType().getName()) == true) { if (value instanceof String) { if (((String)value).toUpperCase().equals("TRUE") == true) { value = Boolean.TRUE; } else if (((String)value).toUpperCase().equals("FALSE") == true) { value = Boolean.FALSE; } } } // Set the default value of the property properties.put(entry.getKey(), value); } }