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

Can't create XML Note document with REST API

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.1-SNAPSHOT
    • Fix Version/s: 10.1
    • Component/s: Rest API

      Description

      • Using JS Client, create an XML Note document:
        nuxeo.repository()
          .create('/path', {
            'entity-type': 'document',
            'type': 'Note',
            'name': 'note-2-xml',
            'properties': {
              'dc:title': 'Note:xml-2',
              'note:mime_type': 'text/xml',
              'note:note': '<note><to>Testers</to><from>Nuxeo</from><heading>Message</heading><body>Thank you!</body></note>'
            }
          });
        

        => The created note's content no longer contains the XML tags (see below) and is therefore not displayed correctly in the UI (see screenshot-1.png):

        ...
          "properties": {
            "note:note": "TestersNuxeoMessage   Thank you!",
            "note:mime_type": "text/xml",
        ...
        
      • For comparison, using JS Client, create an HTML Note document:
        nuxeo.repository()
          .create('/path', {
            'entity-type': 'document',
            'type': 'Note',
            'name': 'note-2-html',
            'properties': {
              'dc:title': 'Note:html-2',
              'note:mime_type': 'text/html',
              'note:note': '<h1>Heading 1</h1>\n<h2>Heading 2</h2>\n<p>Some text. <strong>Some \
                bold text.</strong> <em>Some italics.</em></p>\n<p>Some bullet points:</p>\n<ul> \
                <li>one</li><li>two</li><li>three</li></ul>'
            }
          });
        

        => The created note's content still contains HTML tags (see below) and is therefore displayed correctly in the UI (see screenshot-2.png):

        ...
          "properties": {
            "note:note": "<h1>Heading 1</h1>\n\n<h2>Heading 2</h2>\n\n<p>Some text. <strong>Some   bold text.</strong> <em>Some italics.</em></p>\n\n<p>Some bullet points:</p>\n\n<ul>   <li>one</li><li>two</li><li>three</li></ul>",
            "note:mime_type": "text/html",
        ...
        

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h