Hi Thomas, {{test /}} just outputs the result of TestService.testMe():
out.println( TestService.testMe() )
TestService.testMe() just returns the literal string "TEST", so I think it
should be fine. Would there be anything I could do to enable some debug
output perhaps?
On Thu, Jun 10, 2010 at 9:57 PM, Thomas Mortagne
<[email protected]>wrote:
> On Thu, Jun 10, 2010 at 14:36, Lewis Denizen <[email protected]> wrote:
> > Thanks for the quick reply, Thomas! Actually, I tried that but without
> > luck. It gives the exact same output as what I have below :-( BTW, I am
> > using XWiki 2.3.1, which should be the latest stable release as well.
>
> As far as i can see the "<p></p>TEST" is produced by your macro. What
> {{text /}} is supposed to do ?
>
> >
> > On Thu, Jun 10, 2010 at 12:55 AM, Thomas Mortagne <
> [email protected]
> >> wrote:
> >
> >> On Wed, Jun 9, 2010 at 15:39, Lewis Denizen <[email protected]> wrote:
> >> > Hi xwiki-users,
> >> >
> >> > I created a page called Sandbox.TestMacro with the following content:
> >> >
> >> > * {{test /}}
> >> >
> >> > The page also has a WikiMacro object defined:
> >> >
> >> > {{include document="Sandbox.TestService" context="current"
> /}}{{groovy}}
> >> > import com.test.TestService
> >> > out.println( TestService.testMe() )
> >> > {{/groovy}}
> >> >
> >> > Sandbox.TestService has the following content in it:
> >> >
> >> > {{include document="Sandbox.TestService2" context="current"
> /}}{{groovy
> >> > output="false"}}
> >> > package com.test
> >> > class TestService {
> >> > def static testMe() {
> >> > return "TEST"
> >> > }
> >> > }
> >> > {{/groovy}}
> >>
> >> When you do that you write a paragraph containing two macros (include
> >> and groovy).
> >>
> >> You should write
> >>
> >> {{include document="Sandbox.TestService2" context="current" /}}
> >>
> >> {{groovy output="false"}}
> >> package com.test
> >> class TestService {
> >> def static testMe() {
> >> return "TEST"
> >> }
> >> }
> >> {{/groovy}}
> >>
> >> instead.
> >>
> >> >
> >> > Now, when I render the TestMacro page, I get a few extra <p> inserted
> >> before
> >> > the text "TEST":
> >> >
> >> > <ul><li><p></p>TEST</li></ul>
> >> >
> >> > This makes the page look weird, since the bullet point text is on a
> new
> >> line
> >> > now.. I've also had to put the {{include}} and the {{groovy}} lines
> >> > together in the pages above; otherwise, there would just be more <p>'s
> >> > inserted.. Is there any way around this? Appreciate any tips!
> >> > _______________________________________________
> >> > users mailing list
> >> > [email protected]
> >> > http://lists.xwiki.org/mailman/listinfo/users
> >> >
> >>
> >>
> >>
> >> --
> >> Thomas Mortagne
> >> _______________________________________________
> >> 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
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users