Customize nuxeo-assets-search-result.html
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 :
<template>
[[_getProperty(item)]]
</template>
</nuxeo-data-table-column>
function I used :
_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.
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>
Hello,
The simplest way to edit the default dam search is to import the Studio External Template called “Default Nuxeo DAM Configuration” in your project and edit the configuration (see screenshot)
Regards