Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-26873

CSV ZIP Import should support ListType fields

    XMLWordPrintable

    Details

      Description

      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;
      }
      

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: