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

Cannot create document with the REST API if the name contains '/'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.9.2
    • Component/s: Rest API

      Description

      Creating a document with the name my/document leads to the following exception:

      org.nuxeo.ecm.core.api.ClientException: Failed to create document: document
      ...
      Caused by: org.nuxeo.ecm.core.model.NoSuchDocumentException: No such document: No such document: /default-domain/workspaces/ws/my
      	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.resolvePath(SQLSession.java:268)
      	at org.nuxeo.ecm.core.api.DocumentResolver.resolveReference(DocumentResolver.java:63)
      	at org.nuxeo.ecm.core.api.AbstractSession.resolveReference(AbstractSession.java:509)
      	at org.nuxeo.ecm.core.api.AbstractSession.fillCreateOptions(AbstractSession.java:953)
      	at org.nuxeo.ecm.core.api.AbstractSession.createDocument(AbstractSession.java:884)
      	... 112 more
      

      name is required when creating a document: we need to use the PathSegmentService on it to be consistent with what's done when creating a document through the UI / drag'n'drop / ...

      Current implementation of the PathSegmentService only generate a path segment from a document using its title. In the case of the REST API, we do not always have a title.
      => add a new method generating a path segment from a given string.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: