On Thu, Nov 20, 2014 at 10:42 AM, Adrien Moi <adrienmoi1...@hotmail.com> wrote: > Hello, > I have little question : I would like to define a class in a groovy macro in > a document, create an instances of this class on another document and then > access this instance on the first document. Is that possible to do? > > It would kinda look like this: > First doc (Doc1): > {{groovy}} > public class Hello{ > public printHello(){ > println("HelloWorld!") > } > } > > Hello A = //get instance "FirstTest" of Hello from the doc2 > > A.printHello(); > {{/groovy}} > > second doc (Doc2): > {{groovy}} > //import class definition from Doc1 > Hello FirstTest = new Hello(); > {{/groovy}} > > > then the first document would output "HelloWorld! " > > Is that doable in any way??
{{include reference="Doc1"/}} {{groovy}} Hello FirstTest = new Hello(); {{/groovy}} > > Thanks in advance > > Adrien > > _______________________________________________ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users -- Thomas Mortagne _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users