Automation chain with unique dc:title

Hello

I would like to only allow the creation of documents with a single dc title, but the user to enter metadata.I've tried to do a query, and then, delete the docuemnt, but I have a lot problems. What would be the best option?

0 votes

1 answers

2143 views

ANSWER

rg1
Please clarify…Is your requirement to define a new folder type, say 'Unicity Folder', that ensures the names of its child documents (based on their titles) are unique?
03/26/2015



Hello,

I'll try to explain better…

First, the user put his documents with their dc:title, whatever he wants, for instance A1. But, I want unique documents in my system , I mean documents that not have repited their dc:title.

So, I made automation chain which searching the same dc:title (with a Fetch Query) and…. if This.size()=0, create document; if not erase the document. But I had a lot of problems when I erased the document…

Any advice?

Thank you very much

0 votes



rg1
You cannot reliably enforce uniqueness of child titles within a folder using an automation chain. This must be done at a much lower level in the system which includes adding a unique conditional database constraint on the hierarchy table parentid and name columns for VCS-based Nuxeo deployments. A DBS-based deployment has a dependency on a Nuxeo Shared State Manager being implemented.

I am looking to contribute to the Nuxeo community a nuxeo-unicity-folder marketplace add-on that defines a new document type, 'Unicity Folder', that prevents its children from having duplicate dc:titles. This type of folder is intended to mimic the behavior of a directory in a traditional file system. A user that wants all folders in the domain to have this behavior could customize the Document Type configuration for the Domain accordingly.

Let me know if the nuxeo-unicity-folder add-on described above would be of interest to you.

03/28/2015