- 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", ...