[xwiki-devs] [VOTE] Add get/setSyntax and deprecate get/setSyntaxId() in Document/XWikiDocument
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). 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. Thanks -Vincent
On Feb 3, 2010, at 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).
Actually Document.setSyntaxId shouldn't be deprecated since otherwise it's too hard for now to set a syntax from velocity. So Document.setSyntaxId wouldn't be deprecated. Thanks -Vincent
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.
Thanks -Vincent
Vincent Massol wrote:
On Feb 3, 2010, at 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).
Actually Document.setSyntaxId shouldn't be deprecated since otherwise it's too hard for now to set a syntax from velocity. So Document.setSyntaxId wouldn't be deprecated.
+1 Thanks, Marius
Thanks -Vincent
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.
Thanks -Vincent
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
On Wed, Feb 3, 2010 at 12:05, Vincent Massol <vincent@massol.net> wrote:
On Feb 3, 2010, at 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
Actually Document.setSyntaxId shouldn't be deprecated since otherwise it's too hard for now to set a syntax from velocity. So Document.setSyntaxId wouldn't be deprecated.
+1, String based velocty apis APIs should not be deprecated too quickly (until we add some conversion proxy for it)
Thanks -Vincent
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.
Thanks -Vincent
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
+0 What will be the "new way" of checking syntax in velocity ? #if($doc.syntax.type == "xwiki"&& $doc.syntax.version == "2.0") ... #end ? Jerome On 2/3/10 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).
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.
Thanks -Vincent
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
On Wed, Feb 3, 2010 at 12:12, Jerome Velociter <jerome@xwiki.com> wrote:
+0
What will be the "new way" of checking syntax in velocity ?
#if($doc.syntax.type == "xwiki"&& $doc.syntax.version == "2.0") ... #end
No the goal is to stop testing for "2.0". When you want to test one specific syntax you can still use #if($doc.syntaxId == "xwiki/1.0") #end that doe snot change. But in some cases we ant to do #if($doc.syntax.type == "xwiki"&& $doc.syntax.version != "1.0") #end to cover all xwiki syntax that are not the old very different xwiki/1.0 syntax.
?
Jerome
On 2/3/10 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).
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.
Thanks -Vincent
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
On 2/3/10 12:24 PM, Thomas Mortagne wrote:
On Wed, Feb 3, 2010 at 12:12, Jerome Velociter<jerome@xwiki.com> wrote:
+0
What will be the "new way" of checking syntax in velocity ?
#if($doc.syntax.type == "xwiki"&& $doc.syntax.version == "2.0") ... #end
No the goal is to stop testing for "2.0".
When you want to test one specific syntax you can still use
#if($doc.syntaxId == "xwiki/1.0") #end
that doe snot change.
Well it will be deprecated no ? So you are not encouraged to use this.
But in some cases we ant to do
#if($doc.syntax.type == "xwiki"&& $doc.syntax.version != "1.0") #end
to cover all xwiki syntax that are not the old very different xwiki/1.0 syntax.
I see. Jerome.
?
Jerome
On 2/3/10 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).
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.
Thanks -Vincent
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
On Feb 3, 2010, at 12:47 PM, Jerome Velociter wrote:
On 2/3/10 12:24 PM, Thomas Mortagne wrote:
On Wed, Feb 3, 2010 at 12:12, Jerome Velociter<jerome@xwiki.com> wrote:
+0
What will be the "new way" of checking syntax in velocity ?
#if($doc.syntax.type == "xwiki"&& $doc.syntax.version == "2.0") ... #end
No the goal is to stop testing for "2.0".
When you want to test one specific syntax you can still use
#if($doc.syntaxId == "xwiki/1.0") #end
that doe snot change.
Well it will be deprecated no ? So you are not encouraged to use this.
doc.syntaxId will be deprecated but not doc.syntax.toIdString() -Vincent
But in some cases we ant to do
#if($doc.syntax.type == "xwiki"&& $doc.syntax.version != "1.0") #end
to cover all xwiki syntax that are not the old very different xwiki/1.0 syntax.
I see.
Jerome.
?
Jerome
On 2/3/10 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).
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.
Thanks -Vincent
On Feb 3, 2010, at 12:12 PM, Jerome Velociter wrote:
+0
What will be the "new way" of checking syntax in velocity ?
#if($doc.syntax.type == "xwiki"&& $doc.syntax.version == "2.0")
No, that would the same as before. I think the best would be to create a Version class with a format. For example: get/setMinor(), get/setMajor() which use integers. So you'd write: #if($doc.syntax.type == "xwiki" && $doc.syntax.version.major > 1) Obviously you'd use this only in backward-compatibility scenarios since the best solution is not to have to use it, i.e. to create a WikiMacro or a Java Macro proper (for the livetable example). Note: This Version class would be useful also for the product version and for extension versions when we implement the extension manager. -Vincent
... #end
?
Jerome
On 2/3/10 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).
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.
Thanks -Vincent
+0, JV. On Wed, Feb 3, 2010 at 12:00 PM, Vincent Massol <vincent@massol.net> 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).
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.
Thanks -Vincent
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
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/
I'll postpone this to 2.3M1. Thanks -Vincent On Feb 3, 2010, at 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).
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.
Thanks -Vincent
participants (6)
-
Jean-Vincent Drean -
Jerome Velociter -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol