On Fri, Dec 5, 2008 at 3:37 PM, Vincent Massol <vincent(a)massol.net> wrote:
On Dec 5, 2008, at 3:19 PM, Thomas Mortagne wrote:
Hi devs,
I was looking for issue
http://jira.xwiki.org/jira/browse/XWIKI-2892
(Include Macro should support including pages matching the current
language) and i'm thinking it's not the include macro work to take
care of the language.
Include macro use the DocumentAccessBridge to acces document content
and I think unless you don't explicitly specify that you want the
default language content
DocumentAccessBridge#getDocumentContent(String documentName) should
return the content for the current language. It's more consistent with
DocumentAccessBridge#etDocumentContent(String documentName, String
language) IMO and anyway except for very specific needs I don't see
the point of manipulating the content of the document's default
language for components.
WDYT ?
Here is my +1
I think we need a solution that works for all 3 use cases:
- default language
- current language
- specified language
something like:
getDocumentContent(String) --> default
getDocumentContent(String, Language.CURRENT) --> current
getDocumentContent(String, new Language("greek") --> specified
Currently we don't have any DocumentAccessBridge user which need to
access the content for document default language, and as I said I
don't see the need right know. So I just proposed to change
getDocumentContent for a more local behavior (it's only my opinion,
that's why I'm sending this mail) and we can add a specific method to
access the default language content when needed. Since it's a bridge I
just prefer to be sure we need it, maybe we will have the new model
before anyone need to get the default language content using
DocumentAccessBridge. For the same reason we should not create a new
language identifier just for bridge if we don't really need it.
Now if we really need something now, i would prefer something like:
getDocumentContent(String) --> current
getDocumentContent(String, String) --> specified
getDocumentContentForDefaultLanguage(String) --> default
With some clear comments saying that unless the user of the api really
knows what he is doing he should not use
getDocumentContentForDefaultLanguage(String).
wdyt?
Thanks
-Vincent
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Thomas Mortagne