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

Improve the FileManageActionsBean

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 5.1.3
    • Fix Version/s: 5.1.6, 5.2 M3
    • Component/s: None

      Description

      Currently, when a file is uploaded, the FileManageActionsBean:

      • calls createDocumentFromBlob() with the flag overwrite always true
      • it doesn't always check the returned value (in the case of null returned there are cases in which should appear a NPE)
      • it doesn't properly check all the cases of failures. For instance, if the overwrite wouldn't be required, the case of couldn't update the document because already exists falls in the situation "wrong_document_type"
        Moreover, the logic in default implementation (defaultCreate() in FileManagerService) is somehow wrong: there are only 2 branches
        if (overwrite && docModel != null) {
        }else{
        }
        so the case: "do not overwrite and the document existing" is falling in the second case, and a "new" document is created.

      This fix could be dangerous, having impacts in other plugins, because until now they were never been called with flag overwrite on false.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified