The  'Get The Root' section in the code is fetching an
existing document from the repository.  (/ is the root of
the repository)
A reference to this document (the root) is used as the input
of the next operation which create a new document (inside
the input doc.).
To work with document operations you will usually have to
specify an input (the input document). In the case of a
create operation the input is the parent document were the
document will be created.
To specify an input to an operation you can either use a
Document object that you fetched before from the repository
like in the example - or a document reference.
For example if you know the path of an existing document you
can use

setInput(new PathRef("/templates/folder1")) 

you don't need to fetch the document first if you don't want
this.
Or you can use new IdRef("DOC_ID") to create a reference to
a document given its UID.
Or in a more generic way:
DocRef.newRef("the_doc_ref")  where the doc_ref is either
the absolute path or the UID of the document.

---
Mailing list: [email protected]
Forum: http://forum.nuxeo.org/f/1/

Reply via email to