How make a two direction link between documents

There are two documents with a schema's field:

<xs:element name="link" type="nxs:stringList" /> 

The field is updated by widget:

<widget name="link_path_widget" type="select_path_tree">

This works very well but there is only created one way link. What is the most elegant way to create the two direction link between two documents? It means when it is set in one document, the second is automaticaly updated.

0 votes

2 answers



Have a look at the “relation” concept in Nuxeo (you can create your own relation predicates), it looks like what you are searching for.

1 votes

Yes, you are right. It seems to be good way. Thanks

I have analized the code and it looks that it is too much complicated for this simple task.


Besides relations, another option is to use a “document suggestion” widget to point to another document in a field.

From this other document, you could display a content view performing a query to retrieve all documents where the given field value is the current document id.

0 votes