Hi,
I need to create custom properties when I upload file :
const opts = {
name: media.name,
nodeType: 'cm:content',
include: ['allowableOperations'],
renditions: 'doclib'
};
const nodeBody = {
properties: {
'cm:title': media.name,
'mj:custom1': 'value1',
'mj:custom2': 'value2'
}
};
return this.uploadsApi.uploadFile(file, '', this.documentLibraryNode, nodeBody, opts);
But I get this error:
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
Does-it mean I need to add xml file to tomcat/webapp/alfresco or share repository or something like this ?
Or can I resolve it with alfresco-js-api (adf) ?
How does-it-work ?
Thank you a lot in advance
Hi,
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.
https://docs.alfresco.com/community/concepts/content-model-deploy.html
https://docs.alfresco.com/community/concepts/admintools-cmm-intro.html
If you already have a custom model then please add it here with any additional boostrap config files (if you're loading statically).
Regards,
Jan
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. https://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html
Full series:
https://ecmarchitect.com/alfresco-developer-series
https://docs.alfresco.com/6.1/references/dev-extension-points-content-model.html
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.