Re: [xwiki-users] issue with getAttachment from different document in Groovy
Reported an issue in JIRA for this. http://jira.xwiki.org/jira/browse/XWIKI-5640 I have proven that is affects only 2.5 and not 2.4.4 nor 2.6 trunk. Caleb On 10/28/2010 07:20 PM, Caleb James DeLisle wrote: > Hi Arnaud, > > I have indeed repeated this problem. It appears that I have introduced a bug > when I fixed > http://jira.xwiki.org/jira/browse/XWIKI-5405. This bug nolonger exists on the > 2.6 trunk due to > additional refactoring and I will work on a targeted patch for v2.5.1 > Terribly sorry for the inconvenience and thank you for the report! > > Caleb > > > On 10/28/2010 06:25 PM, [Ricardo Rodriguez] eBioTIC. wrote: >> Hi! >> >> Arnaud bourree wrote: >>> Hello >>> >>> I put a file Text.txt as attachment in a page: Sandbox.Page1 >>> I in an other page Sandbox.Page2, I write the following script: >>> {{groovy}} >>> def mydoc=xwiki.getDocument('Sandbox.Page1') >>> def myfile=mydoc.getAttachment('Text.txt') >>> println "|"+mydoc+"|"+myfile >>> {{/goovy}} >>> The result is >>> |Sandbox.Page1|null >>> >>> If I put the same script in Sandbox.Page2, the result become: >>> |Sandbox.Page1|com.xpn.xwiki.api.attachm...@331be8 >>> >> >> I don't understand the situation: do you have two documents? One having >> an attachment, and another one without it? In any case, myfile gets an >> array: classname (com.xpn.xwiki.api.Attachment) and an object ID. I >> can't explain why it varies though. >>> Why cannot get attachments from other document? >>> >> >> Check this... >> >> http://ebiotic.net/bin/ICT/HasAttachment#Attachments >> http://ebiotic.net/bin/ICT/GetAttachment#Attachments >> >> This should help: >> >> http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/com/xpn/xwiki/platform/xwiki-core/2.5/xwiki-core-2.5-javadoc.jar/!/com/xpn/xwiki/api/Attachment.html >> >> Please, take into account that I'm not a maven! I've just picked up some >> ideas here and there. Please, consider critically this message! Thanks. >>> I run XWiki 2.5 with Tomcat 6.0.28, Mysql 5.1.49, Ubuntu 10.10 >>> >>> Arnaud. >>> ___ >>> users mailing list >>> users@xwiki.org >>> http://lists.xwiki.org/mailman/listinfo/users >>> >>> >> > > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users > ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] issue with getAttachment from different document in Groovy
2010/10/29 Caleb James DeLisle : > Hi Arnaud, > > I have indeed repeated this problem. It appears that I have introduced a bug > when I fixed > http://jira.xwiki.org/jira/browse/XWIKI-5405. This bug nolonger exists on the > 2.6 trunk due to > additional refactoring and I will work on a targeted patch for v2.5.1 > Terribly sorry for the inconvenience and thank you for the report! > > Caleb > Thanks Caleb That explain why that doesn't work for me and work for Ricardo Arnaud. > > On 10/28/2010 06:25 PM, [Ricardo Rodriguez] eBioTIC. wrote: >> Hi! >> >> Arnaud bourree wrote: >>> Hello >>> >>> I put a file Text.txt as attachment in a page: Sandbox.Page1 >>> I in an other page Sandbox.Page2, I write the following script: >>> {{groovy}} >>> def mydoc=xwiki.getDocument('Sandbox.Page1') >>> def myfile=mydoc.getAttachment('Text.txt') >>> println "|"+mydoc+"|"+myfile >>> {{/goovy}} >>> The result is >>> |Sandbox.Page1|null >>> >>> If I put the same script in Sandbox.Page2, the result become: >>> |Sandbox.Page1|com.xpn.xwiki.api.attachm...@331be8 >>> >> >> I don't understand the situation: do you have two documents? One having >> an attachment, and another one without it? In any case, myfile gets an >> array: classname (com.xpn.xwiki.api.Attachment) and an object ID. I >> can't explain why it varies though. >>> Why cannot get attachments from other document? >>> >> >> Check this... >> >> http://ebiotic.net/bin/ICT/HasAttachment#Attachments >> http://ebiotic.net/bin/ICT/GetAttachment#Attachments >> >> This should help: >> >> http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/com/xpn/xwiki/platform/xwiki-core/2.5/xwiki-core-2.5-javadoc.jar/!/com/xpn/xwiki/api/Attachment.html >> >> Please, take into account that I'm not a maven! I've just picked up some >> ideas here and there. Please, consider critically this message! Thanks. >>> I run XWiki 2.5 with Tomcat 6.0.28, Mysql 5.1.49, Ubuntu 10.10 >>> >>> Arnaud. >>> ___ >>> users mailing list >>> users@xwiki.org >>> http://lists.xwiki.org/mailman/listinfo/users >>> >>> >> > > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users > ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] issue with getAttachment from different document in Groovy
Hi Arnaud, I have indeed repeated this problem. It appears that I have introduced a bug when I fixed http://jira.xwiki.org/jira/browse/XWIKI-5405. This bug nolonger exists on the 2.6 trunk due to additional refactoring and I will work on a targeted patch for v2.5.1 Terribly sorry for the inconvenience and thank you for the report! Caleb On 10/28/2010 06:25 PM, [Ricardo Rodriguez] eBioTIC. wrote: > Hi! > > Arnaud bourree wrote: >> Hello >> >> I put a file Text.txt as attachment in a page: Sandbox.Page1 >> I in an other page Sandbox.Page2, I write the following script: >> {{groovy}} >> def mydoc=xwiki.getDocument('Sandbox.Page1') >> def myfile=mydoc.getAttachment('Text.txt') >> println "|"+mydoc+"|"+myfile >> {{/goovy}} >> The result is >> |Sandbox.Page1|null >> >> If I put the same script in Sandbox.Page2, the result become: >> |Sandbox.Page1|com.xpn.xwiki.api.attachm...@331be8 >> > > I don't understand the situation: do you have two documents? One having > an attachment, and another one without it? In any case, myfile gets an > array: classname (com.xpn.xwiki.api.Attachment) and an object ID. I > can't explain why it varies though. >> Why cannot get attachments from other document? >> > > Check this... > > http://ebiotic.net/bin/ICT/HasAttachment#Attachments > http://ebiotic.net/bin/ICT/GetAttachment#Attachments > > This should help: > > http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/com/xpn/xwiki/platform/xwiki-core/2.5/xwiki-core-2.5-javadoc.jar/!/com/xpn/xwiki/api/Attachment.html > > Please, take into account that I'm not a maven! I've just picked up some > ideas here and there. Please, consider critically this message! Thanks. >> I run XWiki 2.5 with Tomcat 6.0.28, Mysql 5.1.49, Ubuntu 10.10 >> >> Arnaud. >> ___ >> users mailing list >> users@xwiki.org >> http://lists.xwiki.org/mailman/listinfo/users >> >> > ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] issue with getAttachment from different document in Groovy
Hi! Arnaud bourree wrote: > Hello > > I put a file Text.txt as attachment in a page: Sandbox.Page1 > I in an other page Sandbox.Page2, I write the following script: > {{groovy}} > def mydoc=xwiki.getDocument('Sandbox.Page1') > def myfile=mydoc.getAttachment('Text.txt') > println "|"+mydoc+"|"+myfile > {{/goovy}} > The result is > |Sandbox.Page1|null > > If I put the same script in Sandbox.Page2, the result become: > |Sandbox.Page1|com.xpn.xwiki.api.attachm...@331be8 > I don't understand the situation: do you have two documents? One having an attachment, and another one without it? In any case, myfile gets an array: classname (com.xpn.xwiki.api.Attachment) and an object ID. I can't explain why it varies though. > Why cannot get attachments from other document? > Check this... http://ebiotic.net/bin/ICT/HasAttachment#Attachments http://ebiotic.net/bin/ICT/GetAttachment#Attachments This should help: http://nexus.xwiki.org/nexus/service/local/repositories/releases/archive/com/xpn/xwiki/platform/xwiki-core/2.5/xwiki-core-2.5-javadoc.jar/!/com/xpn/xwiki/api/Attachment.html Please, take into account that I'm not a maven! I've just picked up some ideas here and there. Please, consider critically this message! Thanks. > I run XWiki 2.5 with Tomcat 6.0.28, Mysql 5.1.49, Ubuntu 10.10 > > Arnaud. > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users > > -- Ricardo RodrÃguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] issue with getAttachment from different document in Groovy
Hello I put a file Text.txt as attachment in a page: Sandbox.Page1 I in an other page Sandbox.Page2, I write the following script: {{groovy}} def mydoc=xwiki.getDocument('Sandbox.Page1') def myfile=mydoc.getAttachment('Text.txt') println "|"+mydoc+"|"+myfile {{/goovy}} The result is |Sandbox.Page1|null If I put the same script in Sandbox.Page2, the result become: |Sandbox.Page1|com.xpn.xwiki.api.attachm...@331be8 Why cannot get attachments from other document? I run XWiki 2.5 with Tomcat 6.0.28, Mysql 5.1.49, Ubuntu 10.10 Arnaud. ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users