-
Type: Bug
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: QualifiedToSchedule
-
Component/s: CSV Importer
ZIP CSV importer does not support ListType fields
I have done this for other projects already however the issue I have encountered is that ListType.getObjectResolver is always going to be null, therefore if the ListType field is for a directory field, empty values are going to cause an error. I would hope we could improve ListType so that the inner type (not superType) can be retrieved, in order to validate the object resolver. Maybe there is a better way.
work around for projects, which is dependent on a static list of fields:
else if (type.isListType()) { String[] items = stringValue.split("\\|"); List<String> fieldListValue = new ArrayList<String>(); for (String item : items) { /** * Return null when empty value for a directory field * Have to check via field name because ListType.getObjectResolver returns null * and ListType.getType() does not exist */ if (multivalueDirectoryFields.contains(field.getName().getLocalName())) { if (stringValue.isEmpty()) { break; } else { fieldListValue.add(item.trim()); } } else { fieldListValue.add(item.trim()); } } fieldValue = (Serializable) fieldListValue; }