[xwiki-devs] XWiki 1.9-RC1: XWiki2.0 syntax by default breaks the creation of XWikiClass
The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax doc: ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") but now when you create a class, it is XWiki/2.0 and should be: {{velocity}} {{html wiki=true}} ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") {{/html}} {{/velocity}} What's the best solution to your mind in order to have something working in all the cases? Pascal
Hi Pascal, On Fri, May 29, 2009 at 2:25 PM, Pascal Voitot <[email protected]>wrote:
The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax doc: ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet")
but now when you create a class, it is XWiki/2.0 and should be: {{velocity}} {{html wiki=true}} ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") {{/html}} {{/velocity}}
What's the best solution to your mind in order to have something working in all the cases?
Well, since now all new documents will be created in syntax 2.0, we could convert the XWiki.XWikiClassTemplate page and make it 2.0 by default in the wiki. Not sure whether this would break existing classes but I don't think so... Guillaume
Pascal _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Product Manager - XWiki Skype ID : wikibc http://guillaumelerouge.com/
On Fri, May 29, 2009 at 2:34 PM, Guillaume Lerouge <[email protected]>wrote:
Hi Pascal,
On Fri, May 29, 2009 at 2:25 PM, Pascal Voitot <[email protected]>wrote:
The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax doc: ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet")
but now when you create a class, it is XWiki/2.0 and should be: {{velocity}} {{html wiki=true}} ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") {{/html}} {{/velocity}}
What's the best solution to your mind in order to have something working in all the cases?
Well, since now all new documents will be created in syntax 2.0, we could convert the XWiki.XWikiClassTemplate page and make it 2.0 by default in the wiki. Not sure whether this would break existing classes but I don't think so...
the scripts in XWiki/1.0 must be modified a bit to be XWiki/2.0 because they contain a mix of velocity and html that renders bad in XWiki/2.0... such as <a href="$doc.getURL("edit", "xpage=editclass")">Edit the Class</a>
Guillaume
Pascal _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Product Manager - XWiki Skype ID : wikibc http://guillaumelerouge.com/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
In fact, this is a problem for all the class scripts because the scripts include other scripts from other page which are also in XWiki/1.0... This is quite a problem these inclusion issues between XWiki/2.0 and XWiki/1.0... Have you thought about that? Pascal On Fri, May 29, 2009 at 2:25 PM, Pascal Voitot <[email protected]>wrote:
The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax doc: ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet")
but now when you create a class, it is XWiki/2.0 and should be: {{velocity}} {{html wiki=true}} ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") {{/html}} {{/velocity}}
What's the best solution to your mind in order to have something working in all the cases?
Pascal
Hi Pascal, On May 29, 2009, at 2:25 PM, Pascal Voitot wrote:
The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax doc: ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet")
but now when you create a class, it is XWiki/2.0 and should be: {{velocity}} {{html wiki=true}} ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") {{/html}} {{/velocity}}
What's the best solution to your mind in order to have something working in all the cases?
The created page will use the syntax of the template page thus it should work in all cases. -Vincent
On Fri, May 29, 2009 at 2:35 PM, Vincent Massol <[email protected]> wrote:
Hi Pascal,
On May 29, 2009, at 2:25 PM, Pascal Voitot wrote:
The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax doc: ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet")
but now when you create a class, it is XWiki/2.0 and should be: {{velocity}} {{html wiki=true}} ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") {{/html}} {{/velocity}}
What's the best solution to your mind in order to have something working in all the cases?
The created page will use the syntax of the template page thus it should work in all cases.
not sure to understand... Do you mean if the template is 1.0, the created page should be 1.0 also? Apparently, this is not the case yet, isn't it? pascal
-Vincent _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On May 29, 2009, at 2:42 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 2:35 PM, Vincent Massol <[email protected]> wrote:
Hi Pascal,
On May 29, 2009, at 2:25 PM, Pascal Voitot wrote:
The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax doc: ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet")
but now when you create a class, it is XWiki/2.0 and should be: {{velocity}} {{html wiki=true}} ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") {{/html}} {{/velocity}}
What's the best solution to your mind in order to have something working in all the cases?
The created page will use the syntax of the template page thus it should work in all cases.
not sure to understand... Do you mean if the template is 1.0, the created page should be 1.0 also?
yes
Apparently, this is not the case yet, isn't it?
It's supposed to be (I coded it ;)). The code is in XWikiDocument.readFromTemplate(): // Set the new document syntax as the syntax of the template since the template content // is copied into the new document setSyntaxId(templatedoc.getSyntaxId()); Apparently it's not working for you it seems. Please open a jira issue if that's the case. Thanks -Vincent
On Fri, May 29, 2009 at 2:47 PM, Vincent Massol <[email protected]> wrote:
On May 29, 2009, at 2:42 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 2:35 PM, Vincent Massol <[email protected]> wrote:
Hi Pascal,
On May 29, 2009, at 2:25 PM, Pascal Voitot wrote:
The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax doc: ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet")
but now when you create a class, it is XWiki/2.0 and should be: {{velocity}} {{html wiki=true}} ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") {{/html}} {{/velocity}}
What's the best solution to your mind in order to have something working in all the cases?
The created page will use the syntax of the template page thus it should work in all cases.
not sure to understand... Do you mean if the template is 1.0, the created page should be 1.0 also?
yes
Apparently, this is not the case yet, isn't it?
It's supposed to be (I coded it ;)).
The code is in XWikiDocument.readFromTemplate():
// Set the new document syntax as the syntax of the template since the template content // is copied into the new document setSyntaxId(templatedoc.getSyntaxId());
Apparently it's not working for you it seems. Please open a jira issue if that's the case.
Thanks -Vincent
I recompiled everything from scratch so I should have a good release now! Can you test it to verify? Just create a new class from the XWikiClasses editor and see if the doc is XWiki/1.0 or 2.0?
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
In the scripts, there are some: <form action="$xwiki.getURL("${doc.space}.${class}ClassSheet","edit")" method="post"> and when you render that inside {{velocity}}{{html}}/{{/html}}{{/velocity}}, this is quite a problem because it render the $xwiki.getUrl and then treats it as wiki syntax and surrounds it with <span>... and you can't remove the wiki=true because in other part of the scripts, there is real wiki syntax... What can we do to go around this? On Fri, May 29, 2009 at 2:51 PM, Pascal Voitot <[email protected]>wrote:
On Fri, May 29, 2009 at 2:47 PM, Vincent Massol <[email protected]>wrote:
On May 29, 2009, at 2:42 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 2:35 PM, Vincent Massol <[email protected]> wrote:
Hi Pascal,
On May 29, 2009, at 2:25 PM, Pascal Voitot wrote:
The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax doc: ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet")
but now when you create a class, it is XWiki/2.0 and should be: {{velocity}} {{html wiki=true}} ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") {{/html}} {{/velocity}}
What's the best solution to your mind in order to have something working in all the cases?
The created page will use the syntax of the template page thus it should work in all cases.
not sure to understand... Do you mean if the template is 1.0, the created page should be 1.0 also?
yes
Apparently, this is not the case yet, isn't it?
It's supposed to be (I coded it ;)).
The code is in XWikiDocument.readFromTemplate():
// Set the new document syntax as the syntax of the template since the template content // is copied into the new document setSyntaxId(templatedoc.getSyntaxId());
Apparently it's not working for you it seems. Please open a jira issue if that's the case.
Thanks -Vincent
I recompiled everything from scratch so I should have a good release now!
Can you test it to verify? Just create a new class from the XWikiClasses editor and see if the doc is XWiki/1.0 or 2.0?
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On May 29, 2009, at 3:03 PM, Pascal Voitot wrote:
In the scripts, there are some:
<form action="$xwiki.getURL("${doc.space}.${class}ClassSheet","edit")" method="post">
and when you render that inside {{velocity}}{{html}}/{{/html}}{{/ velocity}}, this is quite a problem because it render the $xwiki.getUrl and then treats it as wiki syntax and surrounds it with <span>...
This looks like a bug of the HTML macro. Can you create a jira issue?
and you can't remove the wiki=true because in other part of the scripts, there is real wiki syntax...
Actually you can by using clean=false and break it into several html macros. Thanks -Vincent
What can we do to go around this?
On Fri, May 29, 2009 at 2:51 PM, Pascal Voitot <[email protected]>wrote:
On Fri, May 29, 2009 at 2:47 PM, Vincent Massol <[email protected]>wrote:
On May 29, 2009, at 2:42 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 2:35 PM, Vincent Massol <[email protected]> wrote:
Hi Pascal,
On May 29, 2009, at 2:25 PM, Pascal Voitot wrote:
The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax doc: ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet")
but now when you create a class, it is XWiki/2.0 and should be: {{velocity}} {{html wiki=true}} ## replace Main with the Space where you want your documents to be created ## replace the default parent with the one of your choice ## Save this template using the 'Save' button #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) #set($defaultparent = "kmbase.${class}Class") #set($defaultweb = "kmbase") #includeForm("XWiki.ClassSheet") {{/html}} {{/velocity}}
What's the best solution to your mind in order to have something working in all the cases?
The created page will use the syntax of the template page thus it should work in all cases.
not sure to understand... Do you mean if the template is 1.0, the created page should be 1.0 also?
yes
Apparently, this is not the case yet, isn't it?
It's supposed to be (I coded it ;)).
The code is in XWikiDocument.readFromTemplate():
// Set the new document syntax as the syntax of the template since the template content // is copied into the new document setSyntaxId(templatedoc.getSyntaxId());
Apparently it's not working for you it seems. Please open a jira issue if that's the case.
Thanks -Vincent
I recompiled everything from scratch so I should have a good release now!
Can you test it to verify? Just create a new class from the XWikiClasses editor and see if the doc is XWiki/1.0 or 2.0?
On Fri, May 29, 2009 at 3:19 PM, Vincent Massol <[email protected]> wrote:
On May 29, 2009, at 3:03 PM, Pascal Voitot wrote:
In the scripts, there are some:
<form action="$xwiki.getURL("${doc.space}.${class}ClassSheet","edit")" method="post">
and when you render that inside {{velocity}}{{html}}/{{/html}}{{/ velocity}}, this is quite a problem because it render the $xwiki.getUrl and then treats it as wiki syntax and surrounds it with <span>...
This looks like a bug of the HTML macro. Can you create a jira issue?
I will
and you can't remove the wiki=true because in other part of the scripts, there is real wiki syntax...
Actually you can by using clean=false and break it into several html macros.
what does it do exactly as it's not explained in the macro doc ?
Thanks -Vincent
What can we do to go around this?
On Fri, May 29, 2009 at 2:51 PM, Pascal Voitot <[email protected]>wrote:
On Fri, May 29, 2009 at 2:47 PM, Vincent Massol <[email protected]>wrote:
On May 29, 2009, at 2:42 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 2:35 PM, Vincent Massol <[email protected]> wrote:
Hi Pascal,
On May 29, 2009, at 2:25 PM, Pascal Voitot wrote:
> The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax > doc: > ## replace Main with the Space where you want your documents to > be > created > ## replace the default parent with the one of your choice > ## Save this template using the 'Save' button > #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) > #set($defaultparent = "kmbase.${class}Class") > #set($defaultweb = "kmbase") > #includeForm("XWiki.ClassSheet") > > but now when you create a class, it is XWiki/2.0 and should be: > {{velocity}} > {{html wiki=true}} > ## replace Main with the Space where you want your documents to > be > created > ## replace the default parent with the one of your choice > ## Save this template using the 'Save' button > #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) > #set($defaultparent = "kmbase.${class}Class") > #set($defaultweb = "kmbase") > #includeForm("XWiki.ClassSheet") > {{/html}} > {{/velocity}} > > What's the best solution to your mind in order to have something > working in > all the cases?
The created page will use the syntax of the template page thus it should work in all cases.
not sure to understand... Do you mean if the template is 1.0, the created page should be 1.0 also?
yes
Apparently, this is not the case yet, isn't it?
It's supposed to be (I coded it ;)).
The code is in XWikiDocument.readFromTemplate():
// Set the new document syntax as the syntax of the template since the template content // is copied into the new document setSyntaxId(templatedoc.getSyntaxId());
Apparently it's not working for you it seems. Please open a jira issue if that's the case.
Thanks -Vincent
I recompiled everything from scratch so I should have a good release now!
Can you test it to verify? Just create a new class from the XWikiClasses editor and see if the doc is XWiki/1.0 or 2.0?
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On May 29, 2009, at 3:28 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 3:19 PM, Vincent Massol <[email protected]> wrote:
On May 29, 2009, at 3:03 PM, Pascal Voitot wrote:
In the scripts, there are some:
<form action="$xwiki.getURL("${doc.space}.$ {class}ClassSheet","edit")" method="post">
and when you render that inside {{velocity}}{{html}}/{{/html}}{{/ velocity}}, this is quite a problem because it render the $xwiki.getUrl and then treats it as wiki syntax and surrounds it with <span>...
This looks like a bug of the HTML macro. Can you create a jira issue?
I will
and you can't remove the wiki=true because in other part of the scripts, there is real wiki syntax...
Actually you can by using clean=false and break it into several html macros.
what does it do exactly as it's not explained in the macro doc ?
Fixed: http://code.xwiki.org/xwiki/bin/view/Macros/HTMLMacro -Vincent
What can we do to go around this?
On Fri, May 29, 2009 at 2:51 PM, Pascal Voitot <[email protected]>wrote:
On Fri, May 29, 2009 at 2:47 PM, Vincent Massol <[email protected]>wrote:
On May 29, 2009, at 2:42 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 2:35 PM, Vincent Massol <[email protected]> wrote:
> Hi Pascal, > > On May 29, 2009, at 2:25 PM, Pascal Voitot wrote: > >> The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax >> doc: >> ## replace Main with the Space where you want your documents to >> be >> created >> ## replace the default parent with the one of your choice >> ## Save this template using the 'Save' button >> #set( $class = >> $doc.name.substring(0,$doc.name.indexOf("Class"))) >> #set($defaultparent = "kmbase.${class}Class") >> #set($defaultweb = "kmbase") >> #includeForm("XWiki.ClassSheet") >> >> but now when you create a class, it is XWiki/2.0 and should be: >> {{velocity}} >> {{html wiki=true}} >> ## replace Main with the Space where you want your documents to >> be >> created >> ## replace the default parent with the one of your choice >> ## Save this template using the 'Save' button >> #set( $class = >> $doc.name.substring(0,$doc.name.indexOf("Class"))) >> #set($defaultparent = "kmbase.${class}Class") >> #set($defaultweb = "kmbase") >> #includeForm("XWiki.ClassSheet") >> {{/html}} >> {{/velocity}} >> >> What's the best solution to your mind in order to have >> something >> working in >> all the cases? > > The created page will use the syntax of the template page thus > it > should work in all cases. >
not sure to understand... Do you mean if the template is 1.0, the created page should be 1.0 also?
yes
Apparently, this is not the case yet, isn't it?
It's supposed to be (I coded it ;)).
The code is in XWikiDocument.readFromTemplate():
// Set the new document syntax as the syntax of the template since the template content // is copied into the new document setSyntaxId(templatedoc.getSyntaxId());
Apparently it's not working for you it seems. Please open a jira issue if that's the case.
Thanks -Vincent
I recompiled everything from scratch so I should have a good release now!
Can you test it to verify? Just create a new class from the XWikiClasses editor and see if the doc is XWiki/1.0 or 2.0?
On Fri, May 29, 2009 at 3:19 PM, Vincent Massol <[email protected]> wrote:
On May 29, 2009, at 3:03 PM, Pascal Voitot wrote:
In the scripts, there are some:
<form action="$xwiki.getURL("${doc.space}.${class}ClassSheet","edit")" method="post">
and when you render that inside {{velocity}}{{html}}/{{/html}}{{/ velocity}}, this is quite a problem because it render the $xwiki.getUrl and then treats it as wiki syntax and surrounds it with <span>...
This looks like a bug of the HTML macro. Can you create a jira issue?
in fact I wonder if this is the normal behavior if you write {{velocity}} {{html wiki="true"}} <form action="$xwiki.getURL("${doc.space}.${class}ClassTemplate","edit")" method="post"> </form> {{/html}} {{/velocity}} isn't it normal that it renders ? <form action=""><span class="wikiexternallink"> <a class="wikimodel-freestanding" href=" http://www.mandubian.org/xwiki/bin/edit/myspace/%24%7Bclass%7DClassTemplate"
<span class="wikigeneratedlinkcontent"> http://www.mandubian.org/xwiki/bin/edit/myspace/%24%7Bclass%7DClassTemplate </span> </a> </span> " method="post"> in order not to treat the URL as wiki, it should be set to wiki=false... Pascal
and you can't remove the wiki=true because in other part of the scripts, there is real wiki syntax...
Actually you can by using clean=false and break it into several html macros.
Thanks -Vincent
What can we do to go around this?
On Fri, May 29, 2009 at 2:51 PM, Pascal Voitot <[email protected]>wrote:
On Fri, May 29, 2009 at 2:47 PM, Vincent Massol <[email protected]>wrote:
On May 29, 2009, at 2:42 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 2:35 PM, Vincent Massol <[email protected]> wrote:
Hi Pascal,
On May 29, 2009, at 2:25 PM, Pascal Voitot wrote:
> The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax > doc: > ## replace Main with the Space where you want your documents to > be > created > ## replace the default parent with the one of your choice > ## Save this template using the 'Save' button > #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) > #set($defaultparent = "kmbase.${class}Class") > #set($defaultweb = "kmbase") > #includeForm("XWiki.ClassSheet") > > but now when you create a class, it is XWiki/2.0 and should be: > {{velocity}} > {{html wiki=true}} > ## replace Main with the Space where you want your documents to > be > created > ## replace the default parent with the one of your choice > ## Save this template using the 'Save' button > #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class"))) > #set($defaultparent = "kmbase.${class}Class") > #set($defaultweb = "kmbase") > #includeForm("XWiki.ClassSheet") > {{/html}} > {{/velocity}} > > What's the best solution to your mind in order to have something > working in > all the cases?
The created page will use the syntax of the template page thus it should work in all cases.
not sure to understand... Do you mean if the template is 1.0, the created page should be 1.0 also?
yes
Apparently, this is not the case yet, isn't it?
It's supposed to be (I coded it ;)).
The code is in XWikiDocument.readFromTemplate():
// Set the new document syntax as the syntax of the template since the template content // is copied into the new document setSyntaxId(templatedoc.getSyntaxId());
Apparently it's not working for you it seems. Please open a jira issue if that's the case.
Thanks -Vincent
I recompiled everything from scratch so I should have a good release now!
Can you test it to verify? Just create a new class from the XWikiClasses editor and see if the doc is XWiki/1.0 or 2.0?
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On May 29, 2009, at 3:34 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 3:19 PM, Vincent Massol <[email protected]> wrote:
On May 29, 2009, at 3:03 PM, Pascal Voitot wrote:
In the scripts, there are some:
<form action="$xwiki.getURL("${doc.space}.$ {class}ClassSheet","edit")" method="post">
and when you render that inside {{velocity}}{{html}}/{{/html}}{{/ velocity}}, this is quite a problem because it render the $xwiki.getUrl and then treats it as wiki syntax and surrounds it with <span>...
This looks like a bug of the HTML macro. Can you create a jira issue?
in fact I wonder if this is the normal behavior
if you write {{velocity}} {{html wiki="true"}} <form action="$xwiki.getURL("${doc.space}.$ {class}ClassTemplate","edit")" method="post"> </form> {{/html}} {{/velocity}}
isn't it normal that it renders ? <form action=""><span class="wikiexternallink"> <a class="wikimodel-freestanding" href=" http://www.mandubian.org/xwiki/bin/edit/myspace/%24%7Bclass%7DClassTemplate "
<span class="wikigeneratedlinkcontent"> http://www.mandubian.org/xwiki/bin/edit/myspace/%24%7Bclass%7DClassTemplate </span> </a> </span> " method="post">
Yes this is "normal". Since you've specified wiki=true it treats content as wiki content and thus sees the external link. Now what we could maybe do is decide that inline references should not be used inside the html macro since there's no wiki special symbol to indicate it's a link. There are alternatives: - several html macros with wiki=false - use {{html wiki=true}}{{velocity}} maybe I'll let thomas answer since I haven't thought much about it (I'm on something else right now). Thanks -Vincent
in order not to treat the URL as wiki, it should be set to wiki=false...
Pascal
and you can't remove the wiki=true because in other part of the scripts, there is real wiki syntax...
Actually you can by using clean=false and break it into several html macros.
Thanks -Vincent
What can we do to go around this?
On Fri, May 29, 2009 at 2:51 PM, Pascal Voitot <[email protected]>wrote:
On Fri, May 29, 2009 at 2:47 PM, Vincent Massol <[email protected]>wrote:
On May 29, 2009, at 2:42 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 2:35 PM, Vincent Massol <[email protected]> wrote:
> Hi Pascal, > > On May 29, 2009, at 2:25 PM, Pascal Voitot wrote: > >> The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax >> doc: >> ## replace Main with the Space where you want your documents to >> be >> created >> ## replace the default parent with the one of your choice >> ## Save this template using the 'Save' button >> #set( $class = >> $doc.name.substring(0,$doc.name.indexOf("Class"))) >> #set($defaultparent = "kmbase.${class}Class") >> #set($defaultweb = "kmbase") >> #includeForm("XWiki.ClassSheet") >> >> but now when you create a class, it is XWiki/2.0 and should be: >> {{velocity}} >> {{html wiki=true}} >> ## replace Main with the Space where you want your documents to >> be >> created >> ## replace the default parent with the one of your choice >> ## Save this template using the 'Save' button >> #set( $class = >> $doc.name.substring(0,$doc.name.indexOf("Class"))) >> #set($defaultparent = "kmbase.${class}Class") >> #set($defaultweb = "kmbase") >> #includeForm("XWiki.ClassSheet") >> {{/html}} >> {{/velocity}} >> >> What's the best solution to your mind in order to have >> something >> working in >> all the cases? > > The created page will use the syntax of the template page thus > it > should work in all cases. >
not sure to understand... Do you mean if the template is 1.0, the created page should be 1.0 also?
yes
Apparently, this is not the case yet, isn't it?
It's supposed to be (I coded it ;)).
The code is in XWikiDocument.readFromTemplate():
// Set the new document syntax as the syntax of the template since the template content // is copied into the new document setSyntaxId(templatedoc.getSyntaxId());
Apparently it's not working for you it seems. Please open a jira issue if that's the case.
Thanks -Vincent
I recompiled everything from scratch so I should have a good release now!
Can you test it to verify? Just create a new class from the XWikiClasses editor and see if the doc is XWiki/1.0 or 2.0?
On Fri, May 29, 2009 at 3:43 PM, Vincent Massol <[email protected]> wrote:
On May 29, 2009, at 3:34 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 3:19 PM, Vincent Massol <[email protected]> wrote:
On May 29, 2009, at 3:03 PM, Pascal Voitot wrote:
In the scripts, there are some:
<form action="$xwiki.getURL("${doc.space}.$ {class}ClassSheet","edit")" method="post">
and when you render that inside {{velocity}}{{html}}/{{/html}}{{/ velocity}}, this is quite a problem because it render the $xwiki.getUrl and then treats it as wiki syntax and surrounds it with <span>...
This looks like a bug of the HTML macro. Can you create a jira issue?
in fact I wonder if this is the normal behavior
if you write {{velocity}} {{html wiki="true"}} <form action="$xwiki.getURL("${doc.space}.$ {class}ClassTemplate","edit")" method="post"> </form> {{/html}} {{/velocity}}
isn't it normal that it renders ? <form action=""><span class="wikiexternallink"> <a class="wikimodel-freestanding" href="
http://www.mandubian.org/xwiki/bin/edit/myspace/%24%7Bclass%7DClassTemplate
"
<span class="wikigeneratedlinkcontent">
http://www.mandubian.org/xwiki/bin/edit/myspace/%24%7Bclass%7DClassTemplate
</span> </a> </span> " method="post">
Yes this is "normal". Since you've specified wiki=true it treats content as wiki content and thus sees the external link. Now what we could maybe do is decide that inline references should not be used inside the html macro since there's no wiki special symbol to indicate it's a link.
There are alternatives: - several html macros with wiki=false - use {{html wiki=true}}{{velocity}} maybe
I'll let thomas answer since I haven't thought much about it (I'm on something else right now).
I see... I'm beginning to use xwiki/2.0 intensively and I'm trying to make it clear in my head when using velocity and html macro... Let me tell this is not so easy and trivial... when you mix wiki/velocity/html, it becomes quite tricky... I will tell with the experience if I can do everything I need but sometimes I spend some minutes trying several solutions to obtain what I want...
Thanks -Vincent
in order not to treat the URL as wiki, it should be set to wiki=false...
Pascal
and you can't remove the wiki=true because in other part of the scripts, there is real wiki syntax...
Actually you can by using clean=false and break it into several html macros.
Thanks -Vincent
What can we do to go around this?
On Fri, May 29, 2009 at 2:51 PM, Pascal Voitot <[email protected]>wrote:
On Fri, May 29, 2009 at 2:47 PM, Vincent Massol <[email protected]>wrote:
On May 29, 2009, at 2:42 PM, Pascal Voitot wrote:
> On Fri, May 29, 2009 at 2:35 PM, Vincent Massol > <[email protected]> > wrote: > >> Hi Pascal, >> >> On May 29, 2009, at 2:25 PM, Pascal Voitot wrote: >> >>> The XWikiClassTemplate velocity script is in a XWiki/1.0 syntax >>> doc: >>> ## replace Main with the Space where you want your documents to >>> be >>> created >>> ## replace the default parent with the one of your choice >>> ## Save this template using the 'Save' button >>> #set( $class = >>> $doc.name.substring(0,$doc.name.indexOf("Class"))) >>> #set($defaultparent = "kmbase.${class}Class") >>> #set($defaultweb = "kmbase") >>> #includeForm("XWiki.ClassSheet") >>> >>> but now when you create a class, it is XWiki/2.0 and should be: >>> {{velocity}} >>> {{html wiki=true}} >>> ## replace Main with the Space where you want your documents to >>> be >>> created >>> ## replace the default parent with the one of your choice >>> ## Save this template using the 'Save' button >>> #set( $class = >>> $doc.name.substring(0,$doc.name.indexOf("Class"))) >>> #set($defaultparent = "kmbase.${class}Class") >>> #set($defaultweb = "kmbase") >>> #includeForm("XWiki.ClassSheet") >>> {{/html}} >>> {{/velocity}} >>> >>> What's the best solution to your mind in order to have >>> something >>> working in >>> all the cases? >> >> The created page will use the syntax of the template page thus >> it >> should work in all cases. >> > > not sure to understand... > Do you mean if the template is 1.0, the created page should be > 1.0 > also?
yes
> Apparently, this is not the case yet, isn't it?
It's supposed to be (I coded it ;)).
The code is in XWikiDocument.readFromTemplate():
// Set the new document syntax as the syntax of the template since the template content // is copied into the new document setSyntaxId(templatedoc.getSyntaxId());
Apparently it's not working for you it seems. Please open a jira issue if that's the case.
Thanks -Vincent
I recompiled everything from scratch so I should have a good release now!
Can you test it to verify? Just create a new class from the XWikiClasses editor and see if the doc is XWiki/1.0 or 2.0?
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On May 29, 2009, at 3:50 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 3:43 PM, Vincent Massol <[email protected]> wrote:
On May 29, 2009, at 3:34 PM, Pascal Voitot wrote:
On Fri, May 29, 2009 at 3:19 PM, Vincent Massol <[email protected]> wrote:
On May 29, 2009, at 3:03 PM, Pascal Voitot wrote:
In the scripts, there are some:
<form action="$xwiki.getURL("${doc.space}.$ {class}ClassSheet","edit")" method="post">
and when you render that inside {{velocity}}{{html}}/{{/html}}{{/ velocity}}, this is quite a problem because it render the $xwiki.getUrl and then treats it as wiki syntax and surrounds it with <span>...
This looks like a bug of the HTML macro. Can you create a jira issue?
in fact I wonder if this is the normal behavior
if you write {{velocity}} {{html wiki="true"}} <form action="$xwiki.getURL("${doc.space}.$ {class}ClassTemplate","edit")" method="post"> </form> {{/html}} {{/velocity}}
isn't it normal that it renders ? <form action=""><span class="wikiexternallink"> <a class="wikimodel-freestanding" href="
http://www.mandubian.org/xwiki/bin/edit/myspace/%24%7Bclass%7DClassTemplate
"
<span class="wikigeneratedlinkcontent">
http://www.mandubian.org/xwiki/bin/edit/myspace/%24%7Bclass%7DClassTemplate
</span> </a> </span> " method="post">
Yes this is "normal". Since you've specified wiki=true it treats content as wiki content and thus sees the external link. Now what we could maybe do is decide that inline references should not be used inside the html macro since there's no wiki special symbol to indicate it's a link.
There are alternatives: - several html macros with wiki=false - use {{html wiki=true}}{{velocity}} maybe
I'll let thomas answer since I haven't thought much about it (I'm on something else right now).
I see... I'm beginning to use xwiki/2.0 intensively and I'm trying to make it clear in my head when using velocity and html macro... Let me tell this is not so easy and trivial... when you mix wiki/velocity/html, it becomes quite tricky... I will tell with the experience if I can do everything I need but sometimes I spend some minutes trying several solutions to obtain what I want...
Yes and the main reason is that you should not use HTML in general when using wiki syntax (the 2.0 syntax was made powerful so that you should have way less needs for HTML). Re form there's no other solution right now but we can imagine a form macro in the future. In any case the 2.0 syntax is quite new and new experience using it before we can tune it further. All feedback are much welcome. Please let us know other problems you have (you seem to hint at other problems). Thanks -Vincent
in order not to treat the URL as wiki, it should be set to wiki=false...
Pascal
and you can't remove the wiki=true because in other part of the scripts, there is real wiki syntax...
Actually you can by using clean=false and break it into several html macros.
Thanks -Vincent
What can we do to go around this?
On Fri, May 29, 2009 at 2:51 PM, Pascal Voitot <[email protected]>wrote:
On Fri, May 29, 2009 at 2:47 PM, Vincent Massol <[email protected]>wrote:
> > On May 29, 2009, at 2:42 PM, Pascal Voitot wrote: > >> On Fri, May 29, 2009 at 2:35 PM, Vincent Massol >> <[email protected]> >> wrote: >> >>> Hi Pascal, >>> >>> On May 29, 2009, at 2:25 PM, Pascal Voitot wrote: >>> >>>> The XWikiClassTemplate velocity script is in a XWiki/1.0 >>>> syntax >>>> doc: >>>> ## replace Main with the Space where you want your >>>> documents to >>>> be >>>> created >>>> ## replace the default parent with the one of your choice >>>> ## Save this template using the 'Save' button >>>> #set( $class = >>>> $doc.name.substring(0,$doc.name.indexOf("Class"))) >>>> #set($defaultparent = "kmbase.${class}Class") >>>> #set($defaultweb = "kmbase") >>>> #includeForm("XWiki.ClassSheet") >>>> >>>> but now when you create a class, it is XWiki/2.0 and should >>>> be: >>>> {{velocity}} >>>> {{html wiki=true}} >>>> ## replace Main with the Space where you want your >>>> documents to >>>> be >>>> created >>>> ## replace the default parent with the one of your choice >>>> ## Save this template using the 'Save' button >>>> #set( $class = >>>> $doc.name.substring(0,$doc.name.indexOf("Class"))) >>>> #set($defaultparent = "kmbase.${class}Class") >>>> #set($defaultweb = "kmbase") >>>> #includeForm("XWiki.ClassSheet") >>>> {{/html}} >>>> {{/velocity}} >>>> >>>> What's the best solution to your mind in order to have >>>> something >>>> working in >>>> all the cases? >>> >>> The created page will use the syntax of the template page thus >>> it >>> should work in all cases. >>> >> >> not sure to understand... >> Do you mean if the template is 1.0, the created page should be >> 1.0 >> also? > > yes > >> Apparently, this is not the case yet, isn't it? > > It's supposed to be (I coded it ;)). > > The code is in XWikiDocument.readFromTemplate(): > > // Set the new document syntax as the syntax of > the template since the template content > // is copied into the new document > setSyntaxId(templatedoc.getSyntaxId()); > > Apparently it's not working for you it seems. Please open a jira > issue > if that's the case. > > Thanks > -Vincent >
I recompiled everything from scratch so I should have a good release now!
Can you test it to verify? Just create a new class from the XWikiClasses editor and see if the doc is XWiki/1.0 or 2.0?
participants (3)
-
Guillaume Lerouge -
Pascal Voitot -
Vincent Massol