Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
6.1
-
None
-
Unknown
-
Description
Hello,
Documentation:
http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/XWiki.html#copyDocument%28java.lang.String,%20java.lang.String,%20java.lang.String%29
indicate
copyDocument
public boolean copyDocument(DocumentReference sourceDocumentReference,
DocumentReference targetDocumentReference,
String wikilanguage,
boolean resetHistory,
boolean overwrite)
throws XWikiExceptionAPI to copy a translation of a document to another document of the same name in another wiki additionally resetting the version and overwriting the previous document
Parameters:
sourceDocumentReference - the reference to the document to copy
targetDocumentReference - the reference to the document to create
wikilanguage - language to copy
resetHistory - true to reset versions
overwrite - true to overwrite the previous document
Returns:
true if the copy was sucessful
The problem is that the function copie only one language (the last one) even if we indicate another language to copy.
By example, I want copy all language of Sandbox.WebHome in another space.
If I use
{{velocity}} #set ($discard = $xwiki.copyDocument("Sandbox.WebHome", "Test.WebHome","fr",true,true)) $discard #set ($discard = $xwiki.copyDocument("Sandbox.WebHome", "Test.WebHome","en",true,true)) $discard {{/velocity}}
I obtain only one Test.WebHome language (the last one :en)