cancel
Showing results for 
Search instead for 
Did you mean: 

(Nuxeo 5.8) Document ID generation - why cannot provide a custom ID instead of using additional schema like UID?

promanov_
Star Contributor
Star Contributor

The documentation suggests using uid:uid attribute to store custom doc ids.

I wonder why it is not possible to provide the main ID attribute value on document creation?

Let's say I have an document created in an external system and that needs to be synchronized with its' projection in nuxeo.

1 ACCEPTED ANSWER

Florent_Guillau
World-Class Innovator
World-Class Innovator

The only way to have a Nuxeo document whose main id (uuid) is user-defined is to use the CoreSession.importDocuments API.

Note that for some Nuxeo configuration (see Id Column Type in the VCS Configuration doc), the id needs to be an integer and database-generated to ensure unicity.

View answer in original post

6 REPLIES 6

Florent_Guillau
World-Class Innovator
World-Class Innovator

The only way to have a Nuxeo document whose main id (uuid) is user-defined is to use the CoreSession.importDocuments API.

Note that for some Nuxeo configuration (see Id Column Type in the VCS Configuration doc), the id needs to be an integer and database-generated to ensure unicity.

thank you!

I try this function before and after creating document but it doesn't work.

It doesn't seem to work for me either, I'm testing on Nuxeo 5.8 (added the version in the question title).

@Florent is it up-to-date for nuxeo 5.8? A code sample of calling importDocuments() API? I could not find an example to set Id.

You must create a DocumentModelImpl with the proper id. You have to use the constructor with many args for that. Note that CoreSession.createDocumentModel has a 3-arg signature where the second arg is named "id" but it's a mislabeling, it's actually the "name" here ([NXP-14913](https

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.