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

Fix CSV export from page provider returning all schemas

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 10.10
    • Fix Version/s: None
    • Component/s: Automation, Bulk, CSV

      Description

      Launching CSV Export from the results view of a Page Provider configured with schemas="*" results in an IllegalArgumentException when validating the query. There should be a check to ensure that the wildcard character is not validated as an individual schema name and is handled accordingly.

      Steps to Reproduce:

      1. Install nuxeo-csv addon
      2. Configure a simple Page Provider setup bound to a drawer item in Web UI. In the custom bundle .html, ensure the schemas property of the corresponding <nuxeo-results-view> element is set to ""* (see attached for reference).
      3. Navigate to the drawer and execute the Page Provider to view its results.
      4. Click the Export CSV button in the top right of the results.

      Expected behavior: CSV export downloads successfully

      Actual behavior: CSV export fails with following error in console:

      2022-07-07T14:38:10,302 ERROR [AsyncOperationAdapter] org.nuxeo.ecm.core.api.NuxeoException: Failed to invoke operation Bulk.RunAction, Unknown schema * in command: org.nuxeo.ecm.core.bulk.message.BulkCommand@4350ee75[id=1310d616-2521-462f-801f-d6807edeb10b,action=csvExport,query=SELECT * FROM Document WHERE ecm:fulltext = 'wow' AND (ecm:mixinType != 'HiddenInNavigation' AND ecm:isVersion = 0 AND ecm:isTrashed = 0),queryLimit=<null>,username=Administrator,repository=default,bucketSize=0,batchSize=0,scroller=elastic,genericScroller=false,params={schemas=[*]}]
      

      When ran in LTS 2021, following stack trace is also reported:

      Caused by: java.lang.IllegalArgumentException: Unknown schema * in command: org.nuxeo.ecm.core.bulk.message.BulkCommand@24017e69[action=csvExport,batchSize=0,batchTransactionTimeout=<null>,bucketSize=0,externalScroller=false,genericScroller=false,id=1a310230-d8be-4af1-a770-123faae3c623,params={schemas=[*]},query=SELECT * FROM Document WHERE ecm:fulltext = 'wow' AND (ecm:mixinType != 'HiddenInNavigation' AND ecm:isVersion = 0 AND ecm:isTrashed = 0),queryLimit=<null>,repository=default,scroller=elastic,username=Administrator]
              at org.nuxeo.ecm.core.bulk.AbstractBulkActionValidation.validateSchema(AbstractBulkActionValidation.java:94) ~[nuxeo-core-bulk-2021.20.4.jar:?]
              at org.nuxeo.ecm.platform.csv.export.validation.CSVExportValidation.validateCommand(CSVExportValidation.java:65) ~[nuxeo-platform-csv-export-2021.17.14.jar:?]
              at org.nuxeo.ecm.core.bulk.AbstractBulkActionValidation.validate(AbstractBulkActionValidation.java:47) ~[nuxeo-core-bulk-2021.20.4.jar:?]
              at org.nuxeo.ecm.core.bulk.BulkServiceImpl.submit(BulkServiceImpl.java:142) ~[nuxeo-core-bulk-2021.20.4.jar:?]
              at org.nuxeo.ecm.automation.core.operations.services.bulk.BulkRunAction.run(BulkRunAction.java:184) ~[nuxeo-automation-features-2021.18.6.jar:?]
              ... 23 more
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: