<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Create Node with custom properties in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/create-node-with-custom-properties/m-p/115930#M32152</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to create custom properties when I upload file :&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;const &lt;/SPAN&gt;&lt;SPAN&gt;opts &lt;/SPAN&gt;= {&lt;BR /&gt;    &lt;SPAN&gt;name&lt;/SPAN&gt;: media.&lt;SPAN&gt;name&lt;/SPAN&gt;,&lt;BR /&gt;    &lt;SPAN&gt;nodeType&lt;/SPAN&gt;: &lt;SPAN&gt;'cm:content'&lt;/SPAN&gt;,&lt;BR /&gt;    &lt;SPAN&gt;include&lt;/SPAN&gt;: [&lt;SPAN&gt;'allowableOperations'&lt;/SPAN&gt;],&lt;BR /&gt;    &lt;SPAN&gt;renditions&lt;/SPAN&gt;: &lt;SPAN&gt;'doclib'&lt;BR /&gt;&lt;/SPAN&gt;};&lt;BR /&gt;&lt;SPAN&gt;const &lt;/SPAN&gt;&lt;SPAN&gt;nodeBody &lt;/SPAN&gt;= {&lt;BR /&gt;    &lt;SPAN&gt;properties&lt;/SPAN&gt;: {&lt;BR /&gt;        &lt;SPAN&gt;'cm:title'&lt;/SPAN&gt;: media.&lt;SPAN&gt;name,&lt;BR /&gt;        'mj:custom1': 'value1',&lt;BR /&gt;        'mj:custom2': 'value2'&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;};&lt;BR /&gt;&lt;SPAN&gt;return this&lt;/SPAN&gt;.&lt;SPAN&gt;uploadsApi&lt;/SPAN&gt;.&lt;SPAN&gt;uploadFile&lt;/SPAN&gt;(file, &lt;SPAN&gt;''&lt;/SPAN&gt;, &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;documentLibraryNode&lt;/SPAN&gt;, &lt;SPAN&gt;nodeBody&lt;/SPAN&gt;, &lt;SPAN&gt;opts&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;But I get this error:&lt;/P&gt;&lt;P&gt;Error: {"error":{"errorKey":"mj:custom1 isn't a valid QName. Namespace prefix mj is not mapped to a namespace URI","statusCode":400,"briefSummary":"10200018 mj:custom1 isn't a valid QName. Namespace prefix mj is not mapped to a namespace&lt;/P&gt;&lt;P&gt;Does-it mean I need to add xml file to tomcat/webapp/alfresco or share repository or something like this ?&lt;/P&gt;&lt;P&gt;Or can I resolve it with alfresco-js-api (adf) ?&lt;/P&gt;&lt;P&gt;How does-it-work ?&lt;/P&gt;&lt;P&gt;Thank you a lot in advance&lt;/P&gt;</description>
    <pubDate>Wed, 20 Nov 2019 10:07:05 GMT</pubDate>
    <dc:creator>anakin59490</dc:creator>
    <dc:date>2019-11-20T10:07:05Z</dc:date>
    <item>
      <title>Create Node with custom properties</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/create-node-with-custom-properties/m-p/115930#M32152</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to create custom properties when I upload file :&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;const &lt;/SPAN&gt;&lt;SPAN&gt;opts &lt;/SPAN&gt;= {&lt;BR /&gt;    &lt;SPAN&gt;name&lt;/SPAN&gt;: media.&lt;SPAN&gt;name&lt;/SPAN&gt;,&lt;BR /&gt;    &lt;SPAN&gt;nodeType&lt;/SPAN&gt;: &lt;SPAN&gt;'cm:content'&lt;/SPAN&gt;,&lt;BR /&gt;    &lt;SPAN&gt;include&lt;/SPAN&gt;: [&lt;SPAN&gt;'allowableOperations'&lt;/SPAN&gt;],&lt;BR /&gt;    &lt;SPAN&gt;renditions&lt;/SPAN&gt;: &lt;SPAN&gt;'doclib'&lt;BR /&gt;&lt;/SPAN&gt;};&lt;BR /&gt;&lt;SPAN&gt;const &lt;/SPAN&gt;&lt;SPAN&gt;nodeBody &lt;/SPAN&gt;= {&lt;BR /&gt;    &lt;SPAN&gt;properties&lt;/SPAN&gt;: {&lt;BR /&gt;        &lt;SPAN&gt;'cm:title'&lt;/SPAN&gt;: media.&lt;SPAN&gt;name,&lt;BR /&gt;        'mj:custom1': 'value1',&lt;BR /&gt;        'mj:custom2': 'value2'&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;};&lt;BR /&gt;&lt;SPAN&gt;return this&lt;/SPAN&gt;.&lt;SPAN&gt;uploadsApi&lt;/SPAN&gt;.&lt;SPAN&gt;uploadFile&lt;/SPAN&gt;(file, &lt;SPAN&gt;''&lt;/SPAN&gt;, &lt;SPAN&gt;this&lt;/SPAN&gt;.&lt;SPAN&gt;documentLibraryNode&lt;/SPAN&gt;, &lt;SPAN&gt;nodeBody&lt;/SPAN&gt;, &lt;SPAN&gt;opts&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;But I get this error:&lt;/P&gt;&lt;P&gt;Error: {"error":{"errorKey":"mj:custom1 isn't a valid QName. Namespace prefix mj is not mapped to a namespace URI","statusCode":400,"briefSummary":"10200018 mj:custom1 isn't a valid QName. Namespace prefix mj is not mapped to a namespace&lt;/P&gt;&lt;P&gt;Does-it mean I need to add xml file to tomcat/webapp/alfresco or share repository or something like this ?&lt;/P&gt;&lt;P&gt;Or can I resolve it with alfresco-js-api (adf) ?&lt;/P&gt;&lt;P&gt;How does-it-work ?&lt;/P&gt;&lt;P&gt;Thank you a lot in advance&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2019 10:07:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/create-node-with-custom-properties/m-p/115930#M32152</guid>
      <dc:creator>anakin59490</dc:creator>
      <dc:date>2019-11-20T10:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create Node with custom properties</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/create-node-with-custom-properties/m-p/115931#M32153</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If not already done, then you need to define a custom content model in XML and then bootstrap / load into the Content Repository, either statically or dynamically.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/community/concepts/content-model-deploy.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/community/concepts/content-model-deploy.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/community/concepts/admintools-cmm-intro.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/community/concepts/admintools-cmm-intro.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you already have a custom model then please add it here with any additional boostrap config files (if you're loading statically).&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 08:59:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/create-node-with-custom-properties/m-p/115931#M32153</guid>
      <dc:creator>janv</dc:creator>
      <dc:date>2020-01-31T08:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create Node with custom properties</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/create-node-with-custom-properties/m-p/115932#M32154</link>
      <description>&lt;P&gt;In addition, i would also recommend you to go through these tutorials. This turotial would provide you a better understanding on working with custom models.&amp;nbsp;&lt;A href="https://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Full series:&amp;nbsp;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://ecmarchitect.com/alfresco-developer-series" target="_blank" rel="nofollow noopener noreferrer"&gt;https://ecmarchitect.com/alfresco-developer-series&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/6.1/references/dev-extension-points-content-model.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/6.1/references/dev-extension-points-content-model.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 13:24:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/create-node-with-custom-properties/m-p/115932#M32154</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2020-01-31T13:24:37Z</dc:date>
    </item>
  </channel>
</rss>

