How do I set the reference language for an existing set of documents?
If you have an existing set of documents for which you want to initialize the reference language, you don't need to do this manually. You can use a document task for this.
Here is how to do it:
Make sure you are logged in as Administrator.
Choose Tools -> Document Tasks.
Select "Create a new document task".
Select "Add documents resulting for a query". Enter a query which selects the documents. The reference language is a document-level property (shared by all variants), so you only need to select one variant of each document. An example query:
select name where branch = 'main' and language = 'en' and InCollection('foo')
Click "Execute query and add results".
After verifying these are the documents you want, click Next.
For type of task, choose "Javascript" (only available when logged in as Administrator).
Enter the following script:
var document = repository.getDocument(variantKey, true);
document.setReferenceLanguage("en");
document.save();
Start the execution.




There are no comments.