With reference to an old discussion, http://discuss.orbeon.com/unique-persistence-ids-td4659101.html, our persistence implementation replaces the orbeon generated document ID with our own ID and we also do a small translation of a form when it is saved to swapout the orbeon ID in the attached image and file URLs for our own ID.
This is all working beautifully with attachments to templates and forms and with saving of drafts with and without attachments. Everything works as expected... except one.
I've recently tried using the xxf:document-id() function in a form template to get the document ID and lo and behold, it returns the original Orbeon generated one.
Where is it getting this from? I don't store it via our persistence layer, it isn't in the form data file, it can't be in the template and our search function implementations always returns our IDs.
So where is orbeon getting this from? Is there some other form of persistence built into Orbeon that I am unaware of?
I would expect it to return my form ID as specified in the URL when I opened the form for display or edit.
I can get my ID by parsing the URL but I would rather not as that is rather messy.
When a page loads, it creates a new form session, and an automatically-generated id is produced. This is stored internally in the objects which represent the running form. That's where `xxf:document-id() ` gets it from. This never appears on the URL (except for Form Runner PDF generation).
This is different from the Form Runner document id, by the way.