cancel
Showing results for 
Search instead for 
Did you mean: 

Customize nuxeo-assets-search-result.html

Mariem_Ben_Maal
Confirmed Champ
Confirmed Champ

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 :

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.

5 REPLIES 5

Gregory_Carlin
Elite Collaborator
Elite Collaborator

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

Thanks for your reply, But I need to know how can I get access to a parent document data in such widget

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

Gregory_Carlin
Elite Collaborator
Elite Collaborator

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>

I want to display an other metadata not the parentRef

Getting started

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.