On Fri, Dec 9, 2011 at 10:17 AM, Denis Gervalle <dgl(a)softec.lu> wrote:
Hi Devs,
I am looking at now using the new Locale added in DocumentReference into
the implementation of XWikiDocument.
I have already deprecated language related stuff in XWikiDocument, and I
have introduce a XWikiDocument#getLocale and an XWikiDocument#isTranslation
helper since the deprecation of defaultLanguage will increase the need of
it. I have also added XWikiDocument#getTranslatedDocument() with Locale in
place of language. All the changes are almost backward compatible, which is
nice (there is some subtleties with default, "" and null that is now more
equivalent, but should not have consequences).
The is however one change that is not backward compatible, which is the
change of the document reference. Therefore,
XWikiDocument#getDocumentReference does not return the same reference than
it does before, because this reference now contains the Locale. This cause
breakage in several places. I see some option to fix this:
A. Fix all places broken. This may be too long for me, and not trivial.
B. Introduce a new XWikiDocument#getDocumentReferenceWithLocale() and
have XWikiDocument#getDocumentRefence() returns without Locale. Very easy,
but not nice.
C. Introduce a new XWikiDocument#getDocumentReferenceWithoutLocale() and
change all existing calls to XWikiDocument#getDocumentRefence() in platform
to use this one. Nicer, but this is not fully backward compatible.
Since I am on it right now, I would appreciate your opinion quickly.
WDYT ?
I am undecided between B and C
+1 for C
--
Denis Gervalle
SOFTEC sa - CEO
eGuilde sarl - CTO
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne