Hi devs,

The default implementation of
DocumentAccessBridge#getDocument(DocumentReference) has been modified
a few months ago [1] to return the translated document. As a
consequence, currently there's no way to access the default
translation of a document from a component without depending on the
old core (i.e. without using XWiki.getDocument()). Thus I'm proposing
to add:

/**
 * Retrieves the default translation of a document specified by its reference.
 *
 * @param documentReference a document reference
 * @return the default translation of the specified document
 * @throws Exception when the storage cannot be accessed
 * @since 3.4M1
 */
DocumentModelBridge getDefaultDocument(DocumentReference
documentReference) throws Exception;

to DocumentAccessBridge. The default implementation will do exactly
what DocumentAccessBridge#getDocument(DocumentReference) was doing
before [1].

Note that the default translation of a document is important because
it is the only one that provides the document objects. So if you want
to access the objects of a document you have to do it through the
default translation.

Thanks,
Marius

[1] 
https://github.com/xwiki/xwiki-platform/commit/f1188a7be56600aa975d7ccc747a203893b71f2d
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to