XPage get documentcontext

I am integrating Xpages on an existing web application.I want to launch a lotusscript agent triggered on postopen document event.

How can I retrieve the values on the current document ?

The documentcontext doesn’t work.

NB: it must also work on a new document, getting computed field values