Tuesday, 5 May 2009

Daisy CMS - Notes on updating Links as part of a Document Task

This needs to be expanded upon, but:



Works in Java... -1, -1 args seem to work for ensuring proper linkage between variant and branch ids


But if you're creating a Document Task using Javascript, get your document using:



This updates a load of link fields with the id of the specified linked Document (by Id).

Ref: http://www.nabble.com/Programmatically-create-a-link-%28VariantKey%29-td7687320.html#a7687320

2 comments:

Karel Vervaeke said...

Related info: recently (in the upcoming Daisy 2.3) a method was added to resolve the -1 values:

var relativeKey = document.getField('MyLinkField');

// resolve -1 values
var absoluteKey = document.contextualizeVariantKey(relativeKey);

// note:
repository.getDocument(documentId, false);
is the same as
repository.getDocument(documentId, 1, 1, false);

Alex Bleasdale said...

Thanks a lot for the response, Karel. Looking forward to using Daisy 2.3 some time soon :)