Hi all,
there is possibly a litte bug I stumbled upon while writing multi-
lingual support in XMLRPC API.
Actually I am not sure if it's a bug or it is due to the fact that I
am not doing things properly.
Anyway what happens is the following: after that I successfully store
a new translation for a page in a "random" language X (where X is a 4-
character string) the subsequent calls to getDocument(pageId) return a
document that has the content of the "default" language page but,
instead of having the language field set to "", it has this field set
to "X".
So basically XWiki returns a document that appears to be in language
"X" but it is actually the document in the default language.
Other strange things happened while playing with that support, for
example using the web interface at a given time new pages started to
be created by using one of the "random" languages X as the default one
(I am trying to reproduce this but I cannot :( )
Basically this is the code I am using for storing a new translation
(i.e., a translation that didn't exist before):
com.xpn.xwiki.XWiki baseXWiki = xwikiXmlRpcContext.getBaseXWiki();
XWikiDocument xwikiDocument = baseXWiki.getDocument(pageId,
xwikiXmlRpcContext.getXWikiContext());
xwikiDocument.setLanguage(lanuage);
doc = new Document(xwikiDocument, xwikiXmlRpcContext.getXWikiContext());
doc.setContent(content);
doc.save();
Do you see anything wrong here so far?
Thanks.
Cheers,
Fabio