Definition of relation in schema

Hello,

I'm trying to define a document schema for a document type that should have a relation with another type of document. Is this possible? Or maybe I am trying to do this the wrong way…

To make it more clear, I want the user to be able to create the document “Meeting” that will have a link to:

  • a user
  • a previously created document, let's call it “Agenda”
  • there will be some other fields that the user will input data in. I was thinking that since I am declaring these fields in the schema, I could be able to also define a relationship to that previously created document.

Thanks in advance for your time. I am open to any kind of suggestion on how I could to this. Cheers!

0 votes

1 answers

1182 views

ANSWER



For the user field, you just have to create the schema that stores a string (if you want attach only one user) or a string list (for several). After you can use the same suggestion box widget we use for Right Management.

For two next fields, in fact we have the notion of relations into Nuxeo (see the “relation” tab on leaf document, like File, Note, …).

http://doc.nuxeo.com/x/NoEk

Default predicates can be extended to add yours into the “predicates” directory and “inverse_predicates”.

I think your problem, next, will be to include the relation field into the creation form. For that I suggest to use a template widget and add it to your layout. You can have a look how we create the the relation tab:

/nuxeo-platform-relations-web/src/main/resources/web/nuxeo.war/incl/tabs/document_relations.xhtml

Hope this will helps

0 votes