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

FileManagerDocumentModelFactory should use proper document type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9.1
    • Component/s: Importer

      Description

      Note: Not sure if it's a bug or a feature request. But since the importer implements the FileManagerDocumentModelFactory class, one expects it to be usable

      So the problem is: I need to import files and have Nuxeo create the correct document types. The default importer creates a "File" for every file imported. The FileManagerDocumentModelFactory is supposed to create the correct type: A "Picture" for a .jpg, a "Video" for a .mov, etc.

      The problem is in the DefaultImporterServiceImpl class (nuxeo-importer-core). Basically, this service is ready to handle only {{DefaultDocumentModelFactory{{, not anything else:

      // . . .
      protected DefaultDocumentModelFactory getDocumentModelFactory() {
        // . . .
        && (DefaultDocumentModelFactory.class.isAssignableFrom(docModelFactoryClass))
      }
      // . . .
      

      => The FileManagerDocumentModelFactory extends AbstractDocumentModelFactory, not DefaultDocumentModelFactory, so isAssignableFrom is always false, and the importer falls back to DefaultDocumentModelFactory.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: