06-05-2020 04:52 AM
I want to customize the nuxeo-data-table that shows nuxeo-results in nuxeo-assets-search-results.html by adding a new column which displays a property of a parent document. I'm asking a solution to access to a parent document data in such widget. I' ve tried to get the parent data using a function that call the operation "Document.getParent" and return the property I need. In fact, I've added a new column that calls this function :
_getProperty: function(item) { this.currentItemId = item.uid; if (this.currentItemId != null && this.currentItemId != undefined) { this.$.fetchDocumentOperation .execute() .then(function(response) { this.input = response; if (this.input != null && this.input != undefined) { this.$.getParentOperation.execute().then(function(response2) { console.log(response2.properties["xpath"]); return response2.properties["xpath"]; }.bind(this)) .catch(function(error) { console.log("error:" + error); }.bind(this)); } }.bind(this)) .catch(function(error) { console.log("error:" + error); }.bind(this));
By this solution I was able to display the property I need in console but it's not displayed in interface.
06-08-2020 09:01 AM
06-09-2020 06:07 AM
Thanks for your reply, But I need to know how can I get access to a parent document data in such widget
06-09-2020 07:09 AM
I'm not sure that's the proper approach, I'd take a different one. If you need to use the parent object's metadata, you should also have it on your child objects. That metadata would be defined in a schema, which can be easily copied with an automation chain (Document.CopySchema). By doing so you will also be able to search for your documents using parent's metadata. That's covered in a University video, I believe it was "Content modeling options".
06-09-2020 08:04 AM
You should use something like
<nuxeo-data-table-column name="Parent" field="item.parentRef">
<template>
<nuxeo-document-suggestion value="[[item.parentRef]]" readonly="true"></nuxeo-document-suggestion>
</template>
</nuxeo-data-table-column>
06-11-2020 12:33 PM
I want to display an other metadata not the parentRef
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.