On 02/03/2010 12:00 PM, Vincent Massol wrote:
Hi,
I'd like to make this change for 2.2RC1 (since I don't see any danger about it, although that's subjective and if we don't agree I could wait for 2.3M1).
<explanation> The story behind this is because we need to get access to the Syntax object from templates in a few places order to check the syntax used. Right now for example we do the following in macros.vm for the livetable macro:
#if($doc.syntaxId == "xwiki/2.0")
The pb is that this is going to fail in the future when we introduce the XWiki 2.1 syntax (which we're preparing with Thomas).
To fix this we'll need to check that syntax.getType == "xwiki"&& syntax.getVersion> 1.0 instead.
I also wanted to convert some panels to 2.0 syntax for 2.2 final but that requires to convert macros.vm's #panelheader to work fine with all syntaxes rather than adding ugly checks in panel code itself... (or wrapping them all with unnecessary html macros). </explanation>
Here's my +1 for doing it now (although I'm also +1 for doing it but in 2.3M1).
+1 for 2.2RC1. Thanks to the tests, we'll catch most of the getSyntaxId calls.
Note that doing now has one advantage: In order to implement it cleanly we need to break an API, namely: CoreConfiguration.getDefaultDocumentSyntax would return Syntax instead of returning String now. Since this API isn't used from Velocity and is pretty new there's little risk to break lots of people but better modify it ASAP than wait.
-- Sergiu Dumitriu http://purl.org/net/sergiu/