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

Make saveDocument and createDocument return their passed DocumentModel

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: QualifiedToSchedule
    • Component/s: Core

      Description

      Currently developers have to write:

      doc = session.createDocument(doc);
      

      or

      doc = session.saveDocument(doc);
      

      because the input DocumentModel is not modified in place, and another DocumentModel is instantiated and returned. This is a pain and very error-prone.

      We want to be able to write just:

      session.createDocument(doc);
      

      or

      session.saveDocument(doc);
      

      so that the input DocumentModel parameter is the one modified and returned to the caller.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: