private void copyUnspecifiedFields(FieldType userFieldType, FieldType latestFieldType) throws FieldTypeUpdateException { if (userFieldType.getScope() == null) { userFieldType.setScope(latestFieldType.getScope()); } if (userFieldType.getValueType() == null) { userFieldType.setValueType(latestFieldType.getValueType()); } }
@Override public FieldType create() throws RepositoryException, InterruptedException { FieldType fieldType = buildFieldType(); // Apply defaults if (fieldType.getValueType() == null) { fieldType.setValueType(typeManager.getValueType("STRING")); } if (fieldType.getScope() == null) { fieldType.setScope(Scope.NON_VERSIONED); } return typeManager.createFieldType(fieldType); }