Re: [xwiki-devs] Blog Plugin Proposal
Hi Andreas, On Mon, Aug 31, 2009 at 1:11 AM, Andreas Schaefer <schaefera@me.com> wrote:
My try to deploy the Blog Plugin together with the updated Blog Application failed miserably today and my dislike of Velocity reach a new high.
Because I see the value of the scripting nature of the Blog allowing users to customize their Blog to a quite large degree I don't want to ditch that but I have a lot of problems with Velocity and the way is plastering over issues. I rather fail fast than late with hardly a trail to understand what is going on.
My personal experience with velocity is more of a try & fail, try & fail, try and succeed one than anything else. What I found out is that I was msot of the time better off rewriting stuff starting with small chunks rather than trying to take existing code and reuse it all at once. The current blog is a fairly complex piece of velocity code (that is, given the lack of debugging tools when coding in velocity in the wiki). This is one of the reasons I think Sergiu's argument that "devs will be able to look at the code and learn from it" is not entirely true ;-) What's really important for the blog is that it can be customized easily at 2 levels: - Look: an user should be able to use the panels she wants for her blog - Deployment: an user should be able to create a new space blog or global wiki blog in any space she wants Besides that the way the blog is code doesn't matter much for the end user. That said I still think that it might be a good idea to convert the
scripted part of the Blog over to Groovy and keep the rest in the Blog Plugin. I don't have any experience with Groovy inside XWiki but for sure the documentation of Groovy outside is excellent compared to Velocity. I will use the next week to get up to speed and try to convert a piece of the Blog over to Groovy.
Then go ahead and give it a go :-) One thing you need to be aware of when using Groovy inside the wiki is that your pages will haveto be saved using programming rights. This can cause a number of issues, don't forget to code with an user that has them, it will save yo ua lot of hassle ;-)
Cheers - Andy
Good luck and thanks for all the nice work, Guillaume
_______________________________________________ devs mailing list devs@xwiki.org http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Product Manager - XWiki Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/
On Aug 31, 2009, at 9:28 AM, Guillaume Lerouge wrote:
Hi Andreas,
On Mon, Aug 31, 2009 at 1:11 AM, Andreas Schaefer <schaefera@me.com> wrote:
My try to deploy the Blog Plugin together with the updated Blog Application failed miserably today and my dislike of Velocity reach a new high.
Because I see the value of the scripting nature of the Blog allowing users to customize their Blog to a quite large degree I don't want to ditch that but I have a lot of problems with Velocity and the way is plastering over issues. I rather fail fast than late with hardly a trail to understand what is going on.
My personal experience with velocity is more of a try & fail, try & fail, try and succeed one than anything else.
This is not really related to velocity which is the simplest language on earth. It's related to any language you type without an IDE to help you. Try using groovy in wiki pages you'll have the same problem (I know I have it, I need to preview 10 times to get something right). That said, there are some velocity editing support in IntellilJ IDEA and I think there's also a plugin for Eclipse which might help. You can also use XEclipse which has syntax highlighting and some autocompletion for velocity (you'd need to use the 1.2RC1 version).
What I found out is that I was msot of the time better off rewriting stuff starting with small chunks rather than trying to take existing code and reuse it all at once. The current blog is a fairly complex piece of velocity code (that is, given the lack of debugging tools when coding in velocity in the wiki). This is one of the reasons I think Sergiu's argument that "devs will be able to look at the code and learn from it" is not entirely true ;-)
What's really important for the blog is that it can be customized easily at 2 levels:
- Look: an user should be able to use the panels she wants for her blog - Deployment: an user should be able to create a new space blog or global wiki blog in any space she wants
Besides that the way the blog is code doesn't matter much for the end user.
That said I still think that it might be a good idea to convert the
scripted part of the Blog over to Groovy and keep the rest in the Blog Plugin. I don't have any experience with Groovy inside XWiki but for sure the documentation of Groovy outside is excellent compared to Velocity. I will use the next week to get up to speed and try to convert a piece of the Blog over to Groovy.
Then go ahead and give it a go :-)
One thing you need to be aware of when using Groovy inside the wiki is that your pages will haveto be saved using programming rights. This can cause a number of issues, don't forget to code with an user that has them, it will save yo ua lot of hassle ;-)
Yes and we might not be able to include it in the default distribution since our rule so far was only velocity in the default XE XAR. Thanks -Vincent
Cheers - Andy
Good luck and thanks for all the nice work,
Guillaume
Hi Guillaume On Aug 31, 2009, at 12:28 AM, Guillaume Lerouge wrote:
scripted part of the Blog over to Groovy and keep the rest in the Blog Plugin. I don't have any experience with Groovy inside XWiki but for sure the documentation of Groovy outside is excellent compared to Velocity. I will use the next week to get up to speed and try to convert a piece of the Blog over to Groovy.
Then go ahead and give it a go :-)
One thing you need to be aware of when using Groovy inside the wiki is that your pages will haveto be saved using programming rights. This can cause a number of issues, don't forget to code with an user that has them, it will save yo ua lot of hassle ;-)
I encounter this issue when I tried to create a new blog entry within a Groovy script. That wouldn't be such a problem if I could understand what is going on but I don't. First I don't know when the programming rights are checked and second even if I have programming rights (as user Admin) I still cannot pass that check. The Create Post which calls the inline blog edtior (see CreatePost when a name is given) falls even though no page is created yet. For now it seems I cannot only create a new post when both the CreatePost page as well as the BlogPostTemplate is written in velocity. BTW I use 2.0m4 as the code base. Cheers - Andy
Hi I got over that. It is not pretty and I don't know what went wrong but I finally could find a good compromise. What I did was to use a Velocity script that then parsed and loaded a Groovy class which contained the code for the Blog Post Template. This way there was not check and it so I could pass this issue. That said I wasted some hours casing the issue where no entry object could be found until it dawned on me that the Blog Post Template not only contains the Wiki code but also and instance of the Blog Post Class, silly me. I am still working on getting the last kinks out but I think I mastered the most difficult issues. Soon I have to decide if I want to create a two prong Blog application or if I create a second Blog application (GBlog) that contains the Groovy code. Most likely the point that decides on which way to go is the fact if I can keep the Blog documents already written. Cheers - Andy On Sep 6, 2009, at 7:33 PM, Andreas Schaefer wrote:
Hi Guillaume
On Aug 31, 2009, at 12:28 AM, Guillaume Lerouge wrote:
scripted part of the Blog over to Groovy and keep the rest in the Blog Plugin. I don't have any experience with Groovy inside XWiki but for sure the documentation of Groovy outside is excellent compared to Velocity. I will use the next week to get up to speed and try to convert a piece of the Blog over to Groovy.
Then go ahead and give it a go :-)
One thing you need to be aware of when using Groovy inside the wiki is that your pages will haveto be saved using programming rights. This can cause a number of issues, don't forget to code with an user that has them, it will save yo ua lot of hassle ;-)
I encounter this issue when I tried to create a new blog entry within a Groovy script. That wouldn't be such a problem if I could understand what is going on but I don't. First I don't know when the programming rights are checked and second even if I have programming rights (as user Admin) I still cannot pass that check.
The Create Post which calls the inline blog edtior (see CreatePost when a name is given) falls even though no page is created yet. For now it seems I cannot only create a new post when both the CreatePost page as well as the BlogPostTemplate is written in velocity.
BTW I use 2.0m4 as the code base.
Cheers - Andy
participants (3)
-
Andreas Schaefer -
Guillaume Lerouge -
Vincent Massol