Thank you Guillaume.

I put it outside and now all works great. I was just wondering why the 
automatic switch put it in the velocity code.

Anyway, now my migration from 1.0 to 2.0 is finished successfully ;-)

> -----Message d'origine-----
> De : users-boun...@xwiki.org [mailto:users-boun...@xwiki.org] 
> De la part de Guillaume Lerouge
> Envoyé : lundi 14 décembre 2009 11:03
> À : XWiki Users
> Objet : Re: [xwiki-users] Switching from 1.0 to 2.0 syntax
> 
> Hi Christophe,
> 
> On Mon, Dec 14, 2009 at 10:55 AM, PERINAUD Christophe <
> christophe.perin...@kbl-bank.com> wrote:
> 
> > Hello all,
> >
> > I currently have a page in the xwiki/1.0 syntax :
> > ----------
> > #includeMacros("WikiCode.KBLMacros")
> > <div style="text-align:center">
> > #displayAllProjectsTable()
> > </div>
> > ----------
> >
> > When switching to xwiki/2.0 syntax, it generates this :
> > ----------
> > {{velocity filter="none"}}
> > {{html clean="false" wiki="true"}}
> > {{include document="WikiCode.KBLMacros"/}}
> > <p/>
> >
> > (% style="text-align:center" %)(((
> > #displayAllProjectsTable()
> > )))
> >
> > {{/html}}
> > {{/velocity}}
> > ----------
> >
> > The problem is that in the page called WikiCode.KBLMacros, i have a
> > variable called mainDocumentTitle and in the syntax 2.0 
> generated, i can't
> > read it from the macro displayAllProjectsTable.
> >
> > But if i move the line
> > {{include document="WikiCode.KBLMacros"/}}
> >
> > before the line
> > {{velocity filter="none"}}
> >
> > then it works again.
> >
> > Do all include have to be set outside the velocity code ?
> >
> 
> Yes. I'm not sure what the reason was but it has something to 
> do with the
> order in which the macros are executed in syntax 2.0. You 
> need to put the
> include outside so that its contents get included fine and 
> become available
> to the following velocity macro.
> 
> Again, I'm not sure exactly what the technical reason is but 
> it's better if
> your include macros are outside velocity macros.
> 
> Guillaume
> 
> 
> > Christophe Périnaud
> > Windows Server 2003 SP2 in a VMWare instance
> > Oracle 10g
> > Java 1.6.0_12
> > Xwiki 2.0.3 from the pack Jetty/HSQL
> >
> >
> >
> > 
> --------------------------------------------------------------
> ------------------
> >
> > This e-mail is intended only for the addressee named above. 
> It does not
> > bind the sender, except in the case of an existing written 
> convention with
> > the addressee. This e-mail may contain material that is 
> confidential and
> > privileged for the sole use of the intended recipient. Any 
> review, reliance
> > or distribution by others or forwarding without express 
> permission is
> > strictly prohibited and may be unlawful. If you are not the intended
> > recipient, please contact the sender and delete all copies.
> >
> > While reasonable precautions have been taken to ensure that 
> this e-mail and
> > any attachments are free from any computer virus or similar 
> defect, no
> > liability will be accepted in that respect. Anyone 
> accessing this e-mail
> > must take their own precautions as to security and virus protection.
> >
> > KBL European Private Bankers S.A., 43 boulevard Royal 
> L-2955 Luxembourg,
> > R.C.S. Luxembourg B 6395, T (352) 47 97 1
> > _______________________________________________
> > users mailing list
> > users@xwiki.org
> > http://lists.xwiki.org/mailman/listinfo/users
> >
> 
> 
> 
> -- 
> Guillaume Lerouge
> Product Manager - XWiki SAS
> Skype: wikibc
> Twitter: glerouge
> http://guillaumelerouge.com/
> _______________________________________________
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
> 
--------------------------------------------------------------------------------

This e-mail is intended only for the addressee named above. It does not bind 
the sender, except in the case of an existing written convention with the 
addressee. This e-mail may contain material that is confidential and privileged 
for the sole use of the intended recipient. Any review, reliance or 
distribution by others or forwarding without express permission is strictly 
prohibited and may be unlawful. If you are not the intended recipient, please 
contact the sender and delete all copies.

While reasonable precautions have been taken to ensure that this e-mail and any 
attachments are free from any computer virus or similar defect, no liability 
will be accepted in that respect. Anyone accessing this e-mail must take their 
own precautions as to security and virus protection.

KBL European Private Bankers S.A., 43 boulevard Royal L-2955 Luxembourg, R.C.S. 
Luxembourg B 6395, T (352) 47 97 1
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to