[xwiki-users] copyDocument method: copy without attachments?
Hello, I use the copyDocument method: http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/XWiki... but file attached on my source page is not copied on target space... Is it normal? Thxs. Pascal BASTIEN
On Mon, Jul 21, 2014 at 3:41 PM, Pascal BASTIEN <[email protected]> wrote:
Hello, I use the copyDocument method: http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/XWiki... but file attached on my source page is not copied on target space...
Is it normal?
No. But XWiki 4.1.x is a bit old. Note that I've recently used this method on the File Manager Application, see https://github.com/xwiki-contrib/application-filemanager/blob/master/api/src... , and it worked fine on XWiki 5.4.5. The attachments were copied. Yes, I used the private API, but the public API (api.XWIki#copyDocument) is calling the private API. So I'm pretty sure the copyDocument method works fine, at least with the parameters I've used. Hope this helps, Marius
Thxs.
Pascal BASTIEN _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
I use Xwiki 6.1 and copyDocument method doesn't copy document attachments: #set ($items = $xwiki.search("select doc.fullName from XWikiDocument as doc where doc.space='SandBoxTemplate' and doc.name != 'WebPreferences' and doc.name != 'ReinitSandboxMacro'")) #foreach($item in $items) #set($itemDoc = $xwiki.getDocument($item)) #if ($request.debug != 'true') #set ($discard = $xwiki.copyDocument("$item", "BacASable.$itemDoc.name","fr",true,true)) ((I will try to replace "fr" by $NULL as you suggest) Cf.: http://extensions.xwiki.org/xwiki/bin/view/Extension/Reinit_Sandbox I will recheck with your parameter thank you. ________________________________ De : Marius Dumitru Florea <[email protected]> À : Pascal BASTIEN <[email protected]>; XWiki Users <[email protected]> Envoyé le : Lundi 21 juillet 2014 15h51 Objet : Re: [xwiki-users] copyDocument method: copy without attachments? On Mon, Jul 21, 2014 at 3:41 PM, Pascal BASTIEN <[email protected]> wrote:
Hello, I use the copyDocument method: http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/XWiki... but file attached on my source page is not copied on target space...
Is it normal?
No. But XWiki 4.1.x is a bit old. Note that I've recently used this method on the File Manager Application, see https://github.com/xwiki-contrib/application-filemanager/blob/master/api/src... , and it worked fine on XWiki 5.4.5. The attachments were copied. Yes, I used the private API, but the public API (api.XWIki#copyDocument) is calling the private API. So I'm pretty sure the copyDocument method works fine, at least with the parameters I've used. Hope this helps, Marius
Thxs.
Pascal BASTIEN _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Maybe you copied a translation. The attachments/objects are associated to the default language only. On Mon, Jul 21, 2014 at 3:51 PM, Marius Dumitru Florea <[email protected]> wrote:
On Mon, Jul 21, 2014 at 3:41 PM, Pascal BASTIEN <[email protected]> wrote:
Hello, I use the copyDocument method: http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/XWiki... but file attached on my source page is not copied on target space...
Is it normal?
No. But XWiki 4.1.x is a bit old. Note that I've recently used this method on the File Manager Application, see https://github.com/xwiki-contrib/application-filemanager/blob/master/api/src... , and it worked fine on XWiki 5.4.5. The attachments were copied. Yes, I used the private API, but the public API (api.XWIki#copyDocument) is calling the private API. So I'm pretty sure the copyDocument method works fine, at least with the parameters I've used.
Hope this helps, Marius
Thxs.
Pascal BASTIEN _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Yes I think you are right (I copy FR version), I will check that tomorrow. ________________________________ De : Thomas Mortagne <[email protected]> À : XWiki Users <[email protected]> Cc : Pascal BASTIEN <[email protected]> Envoyé le : Lundi 21 juillet 2014 16h06 Objet : Re: [xwiki-users] copyDocument method: copy without attachments? Maybe you copied a translation. The attachments/objects are associated to the default language only. On Mon, Jul 21, 2014 at 3:51 PM, Marius Dumitru Florea <[email protected]> wrote:
On Mon, Jul 21, 2014 at 3:41 PM, Pascal BASTIEN <[email protected]> wrote:
Hello, I use the copyDocument method: http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/XWiki... but file attached on my source page is not copied on target space...
Is it normal?
No. But XWiki 4.1.x is a bit old. Note that I've recently used this method on the File Manager Application, see https://github.com/xwiki-contrib/application-filemanager/blob/master/api/src... , and it worked fine on XWiki 5.4.5. The attachments were copied. Yes, I used the private API, but the public API (api.XWIki#copyDocument) is calling the private API. So I'm pretty sure the copyDocument method works fine, at least with the parameters I've used.
Hope this helps, Marius
Thxs.
Pascal BASTIEN _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
participants (3)
-
Marius Dumitru Florea -
Pascal BASTIEN -
Thomas Mortagne