+0, but note that if we finally introduce Locales in reference, this new function is useless.
In my previous try to do so, it seems to me that the best way to manage the "default" document is to not introduce any Locale in its reference, which made it the default one, and ensure its reference stay stable even when its language is later changed. But this may became weird if we now have some function that provide translated version by default. Doesn't we need to further think about how we expect to work with references with Locale and prepare existing API to be consistant with that new direction ? On Fri, Dec 23, 2011 at 12:58, Thomas Mortagne <[email protected]>wrote: > +1 > > On Fri, Dec 23, 2011 at 10:57 AM, Marius Dumitru Florea > <[email protected]> wrote: > > 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 > > > > -- > Thomas Mortagne > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs > -- Denis Gervalle SOFTEC sa - CEO eGuilde sarl - CTO _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

