Re: [xwiki-users] a velocity problem

2014-09-15 Thread Thomas Mortagne
Usually for this use case the included page should be wiki content:

{{velocity}}
#macro(mymacro)
  Hello world
#end
{{/velocity}}


And then you include it using {{include}} macro as in:

{{include reference=API.InterfaceDocTemplate/}}

{{velocity}}
#mymacro()
{{/velocity}}

On Mon, Sep 15, 2014 at 9:08 AM, 李例 dr...@163.com wrote:
 Hello, now I have this scenario: I’d like to use a page(which 
 includes some velocity macros) in another new page, I use the snippet below 
 in my new page:

 {{velocity}}
 #set($reference = $services.model.createDocumentReference('', 'API', 
 'InterfaceDocTemplate'))
 #set($document  = $xwiki.getDocument($reference))
 $xwiki.getDocument($document).getContent()
 {{/velocity}}

 but it turns out that the velocity macros cannot be executed, and the alert 
 is “Failed to execute the [velocity] macro”.
 I would greatly appreciate if someone could give me a solution.
 Excuse my poor English please, thank you very much!
 ___
 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


Re: [xwiki-users] a velocity problem

2014-09-15 Thread Lee
Thomas, Thank you very much!
Maybe I did not explain my question clearly, the usage of macros in the page 
that I want to include is display some parameters, so it would be great if 
these parameters could display in the new page.
在 2014年9月15日,下午3:23,Thomas Mortagne thomas.morta...@xwiki.com 写道:

 Usually for this use case the included page should be wiki content:
 
 {{velocity}}
 #macro(mymacro)
  Hello world
 #end
 {{/velocity}}
 
 
 And then you include it using {{include}} macro as in:
 
 {{include reference=API.InterfaceDocTemplate/}}
 
 {{velocity}}
 #mymacro()
 {{/velocity}}
 
 On Mon, Sep 15, 2014 at 9:08 AM, 李例 dr...@163.com wrote:
Hello, now I have this scenario: I’d like to use a page(which 
 includes some velocity macros) in another new page, I use the snippet below 
 in my new page:
 
 {{velocity}}
 #set($reference = $services.model.createDocumentReference('', 'API', 
 'InterfaceDocTemplate'))
 #set($document  = $xwiki.getDocument($reference))
 $xwiki.getDocument($document).getContent()
 {{/velocity}}
 
 but it turns out that the velocity macros cannot be executed, and the alert 
 is “Failed to execute the [velocity] macro”.
I would greatly appreciate if someone could give me a solution.
Excuse my poor English please, thank you very much!
 ___
 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


___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] a velocity problem

2014-09-15 Thread Marius Dumitru Florea
Then maybe you need
http://extensions.xwiki.org/xwiki/bin/view/Extension/Display+Macro .

Hope this helps,
Marius

On Mon, Sep 15, 2014 at 10:41 AM, Lee dr...@163.com wrote:
 Thomas, Thank you very much!
 Maybe I did not explain my question clearly, the usage of macros in the page 
 that I want to include is display some parameters, so it would be great if 
 these parameters could display in the new page.
 在 2014年9月15日,下午3:23,Thomas Mortagne thomas.morta...@xwiki.com 写道:

 Usually for this use case the included page should be wiki content:

 {{velocity}}
 #macro(mymacro)
  Hello world
 #end
 {{/velocity}}


 And then you include it using {{include}} macro as in:

 {{include reference=API.InterfaceDocTemplate/}}

 {{velocity}}
 #mymacro()
 {{/velocity}}

 On Mon, Sep 15, 2014 at 9:08 AM, 李例 dr...@163.com wrote:
Hello, now I have this scenario: I’d like to use a page(which 
 includes some velocity macros) in another new page, I use the snippet below 
 in my new page:

 {{velocity}}
 #set($reference = $services.model.createDocumentReference('', 'API', 
 'InterfaceDocTemplate'))
 #set($document  = $xwiki.getDocument($reference))
 $xwiki.getDocument($document).getContent()
 {{/velocity}}

 but it turns out that the velocity macros cannot be executed, and the alert 
 is “Failed to execute the [velocity] macro”.
I would greatly appreciate if someone could give me a solution.
Excuse my poor English please, thank you very much!
 ___
 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


 ___
 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] a velocity problem

2014-09-15 Thread Lee
Thank you very much, Marius! That’s what I want, you really helped me a lot.
在 2014年9月15日,下午8:04,Marius Dumitru Florea mariusdumitru.flo...@xwiki.com 写道:

 Then maybe you need
 http://extensions.xwiki.org/xwiki/bin/view/Extension/Display+Macro .
 
 Hope this helps,
 Marius
 
 On Mon, Sep 15, 2014 at 10:41 AM, Lee dr...@163.com wrote:
 Thomas, Thank you very much!
 Maybe I did not explain my question clearly, the usage of macros in the page 
 that I want to include is display some parameters, so it would be great if 
 these parameters could display in the new page.
 在 2014年9月15日,下午3:23,Thomas Mortagne thomas.morta...@xwiki.com 写道:
 
 Usually for this use case the included page should be wiki content:
 
 {{velocity}}
 #macro(mymacro)
 Hello world
 #end
 {{/velocity}}
 
 
 And then you include it using {{include}} macro as in:
 
 {{include reference=API.InterfaceDocTemplate/}}
 
 {{velocity}}
 #mymacro()
 {{/velocity}}
 
 On Mon, Sep 15, 2014 at 9:08 AM, 李例 dr...@163.com wrote:
   Hello, now I have this scenario: I’d like to use a page(which 
 includes some velocity macros) in another new page, I use the snippet 
 below in my new page:
 
 {{velocity}}
 #set($reference = $services.model.createDocumentReference('', 'API', 
 'InterfaceDocTemplate'))
 #set($document  = $xwiki.getDocument($reference))
 $xwiki.getDocument($document).getContent()
 {{/velocity}}
 
 but it turns out that the velocity macros cannot be executed, and the 
 alert is “Failed to execute the [velocity] macro”.
   I would greatly appreciate if someone could give me a solution.
   Excuse my poor English please, thank you very much!
 ___
 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
 
 
 ___
 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