Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Lisa Simpson
Move to FreeMarker from Velocity
9 marzo 2010 9.05
Risposta

Lisa Simpson

Punteggio: Liferay Legend

Messaggi: 2034

Data di Iscrizione: 5 marzo 2009

Messaggi recenti

A couple of questions here -

1) Just out of curiosity, does this move have anything to do with correcting the internationalization/special character issues?

2) Why the hybrid move to use Velocity and FreeMarker? Does that reflect the lack of maturity of FreeMarker in it's current state?
Mika Koivisto
RE: Move to FreeMarker from Velocity
9 marzo 2010 9.25
Risposta

Mika Koivisto

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 1499

Data di Iscrizione: 7 agosto 2006

Messaggi recenti

We are not moving to FreeMarker it is just another option for theme developers. Velocity will still be the default one for now. Some people like Velocity more than FreeMaker and other like me prefer FreeMarker.

FreeMarker library is very performant and mature but the FreeMarker theme support in Liferay is new and not so throughly tested. I would love to see some freemarker based themes and get feedback on how well it is working and how we can improve it.
Jonathan Neal
RE: Move to FreeMarker from Velocity
9 marzo 2010 9.30
Risposta

Jonathan Neal

LIFERAY STAFF

Punteggio: Junior Member

Messaggi: 66

Data di Iscrizione: 29 agosto 2007

Messaggi recenti

Mika Koivisto:
I would love to see some freemarker based themes and get feedback on how well it is working and how we can improve it.


I feel the same way as Mika, and I hope to shift my own themes to use Freemarker. I came from the PHP world, so Velocity has always looked like nonsense, because there is no clear separation between the string and variables. Freemarker gives us another set of tools to accomplish our goals. However, since most Liferay users were accustomed to Velocity, change for change sake probably didn't seem reason enough to make Freemarker the default engine.

Jonathan
Lisa Simpson
RE: Move to FreeMarker from Velocity
9 marzo 2010 13.22
Risposta

Lisa Simpson

Punteggio: Liferay Legend

Messaggi: 2034

Data di Iscrizione: 5 marzo 2009

Messaggi recenti

I think that you might want to reconsider not changing to FreeMarker. I've been reading the documentation on both. This is posted on FreeMarkers web site as one reason to choose them over Velocity...

Internationalization/localization aware

* Charset aware (uses UNICODE internally).
* Locale sensitive number formatting.
* Locale sensitive date and time formatting.
* Non-US characters can be used in identifiers (as variable names).
* Multiple variations of the same template for different languages.




That's historically been an issue with Liferay. The only official answer I've seen is that "it's core to Liferay" but I'm wondering if this isn't a step in resolving that problem.

I asked about the "hybrid" implementation because the 6 bundle that I got has both FreeMarker and Velocity templates in the default theme. And at least to my eye, they seem to be performing different functions. Is that because there are still a lot of velocity calls written into the Java classes?
Mika Koivisto
RE: Move to FreeMarker from Velocity
9 marzo 2010 14.14
Risposta

Mika Koivisto

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 1499

Data di Iscrizione: 7 agosto 2006

Messaggi recenti

Velocity files are the ones that classic theme actually uses but if someone want's to base their theme to classic theme but still use FreeMarker that is possible thus both files on _unstyled, _styled and classic.

I don't know what issues you've had with regarding localization but I've never had any problems creating multilingual sites with Liferay. You've just need to be aware that not all portlets allow displaying content in multiple languages. Keeping everything as UTF-8 allows you to use characters from pretty much any language. FreeMarker of course makes things even easier by allowing you to use it's built-in functions to format numbers etc.
Mickey Fox
RE: Move to FreeMarker from Velocity
10 marzo 2010 13.46
Risposta

Mickey Fox

Punteggio: Junior Member

Messaggi: 60

Data di Iscrizione: 15 luglio 2009

Messaggi recenti

Mika, the internationalization issue is one that is well documented here in the forums. In fact, there are a few postings that appear to be quite angry over the subject.

My first thought was to congratulate Liferay on the move to freemarker as it does handle internationalization quite handily AND gives one a lot of flexibility with respect to escaping for special characters.

With respect to Freemarker, can one of you guys explain how to make the initial call for the portal_normal.ftl in order that we might work on a freemarker theme (I am salivating at the opportunity)?
Mika Koivisto
RE: Move to FreeMarker from Velocity
12 marzo 2010 7.10
Risposta

Mika Koivisto

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 1499

Data di Iscrizione: 7 agosto 2006

Messaggi recenti

Mickey Fox:
Mika, the internationalization issue is one that is well documented here in the forums. In fact, there are a few postings that appear to be quite angry over the subject.


I must have missed them can you provide some links to these issues. I've mostly worked on non-english sites and we haven't had any problems.

Mickey Fox:
With respect to Freemarker, can one of you guys explain how to make the initial call for the portal_normal.ftl in order that we might work on a freemarker theme (I am salivating at the opportunity)?


Umm. not sure what you mean here. You create freemarker theme the same way as velocity based except the type is ftl instead of vm (this is defined in liferay-look-and-feel.xml).
Mickey Fox
RE: Move to FreeMarker from Velocity
15 marzo 2010 10.20
Risposta

Mickey Fox

Punteggio: Junior Member

Messaggi: 60

Data di Iscrizione: 15 luglio 2009

Messaggi recenti


Umm. not sure what you mean here. You create freemarker theme the same way as velocity based except the type is ftl instead of vm (this is defined in liferay-look-and-feel.xml).


Now it is my turn to say that I am not sure what you mean. Free Marker Templates and Velocity templates are not created equally. Not do they function equally. I simply asked where the originating call was made from.

As for the documentation, I believe Lisa Simpson has pulled that together several times for the Liferay staff, so I will not do it again. To say you are unaware of folks' problems with special characters strikes me as rather odd. Are you saying that liferay handles special characters without any problems? Otherwise, internationalization (which relies on special characters) does not function well with velocity or liferay as special characters has ALWAYS been a problem (quick, meaningless, reference is hereby made to special characters in blog titles, for instance.)
Jonathan Neal
RE: Move to FreeMarker from Velocity
15 marzo 2010 11.22
Risposta

Jonathan Neal

LIFERAY STAFF

Punteggio: Junior Member

Messaggi: 66

Data di Iscrizione: 29 agosto 2007

Messaggi recenti

Hi Lisa! Hi Mickey! I'm going to need a few examples of how I can create this special characters issue over here so I can help you out. But first:

Lisa Simpson:
This is posted on FreeMarkers web site as one reason to choose them over Velocity...

Internationalization/localization aware

* Charset aware (uses UNICODE internally).
* Locale sensitive number formatting.
* Locale sensitive date and time formatting.
* Non-US characters can be used in identifiers (as variable names).
* Multiple variations of the same template for different languages.




That's historically been an issue with Liferay. The only official answer I've seen is that "it's core to Liferay" but I'm wondering if this isn't a step in resolving that problem.


My response here is a bit tangential from the bigger issue, but, while Freemarker may be superior (I think it is), the user experience must be considered. I hope you would understand that swapping Velocity with Freemarker as the default may cost more to the end-user than the benefit. Freemarker is the closest thing to my good ol' days in PHP, but I'm not about to pull the rug out from everyone else.

Also, let me be very forward in saying that IMHO Freemarker is still a feature in development, and I haven't been able to get it working on my local machine. It must be working before the GA, so I trust our developers to deliver and I appreciate this feature making its way into the product. Now that it's there, it will have to work! emoticon

Mickey Fox:
To say you are unaware of folks' problems with special characters strikes me as rather odd. Are you saying that liferay handles special characters without any problems?


Hey Mickey. Liferay is tested and used internationally, just Google allinurl:web/guest site:.cn. Really, do search. I challenged my superiors to prove it was working and they challenged me to break it.

ROUND 1!

I believe there is truth in these complaints and I want to help. So, I went ahead and searched the website for special characters, particularly in forum posts.

First, I found portlet title special characters. I opened up my local copy of Liferay 6 trunk and named a portlet "città".

To just a bit of surprise, it worked just fine. "Okay," I thought to myself, "I'm glad we've fixed that bug, but I'm not convinced."

ROUND 2!

Next, I found HTML editor and special characters. I opened up my same local copy and created a new web content article with "é" after "é" after "é". Again, all was well, so I went ahead and titled my portlet "ééééééé".

Frustrated with my success, I refreshed the page; still it worked! Never! I restarted my server. And guess what? It still worked.

ROUND 3!

I kept thinking, "There's gotta be something that doesn't work." Then I found username not accepting special characters.

Of course, before I could even test it, the issue was already resolved, thanks to my ol' pal Bruno (you know, of Bruno Admin fame?). Special characters are disabled by default, since the site would not support these characters in the url, and even then a solution is provided so these special characters can be used in the username anyway.

ROUND 4!

I wasn't going down without a fight, so I opened up classic's portal_normal.vm and erased the footer and replaced it with:

1<p class="powered-by">
2    VIVA LA éééééééééééééé!
3</p>


Refreshed. It still worked!

ROUND 5!

Okay, fine velocity, you're gonna get what's comin' to you!

1<p class="powered-by">
2    #set ($breakThisPlease = "VIVA LA éééééééééééééé!")
3    #set ($breakThisPlease = "$breakThisPlease ... Also città")
4    $breakThisPlease
5</p>


And it works.

FINAL SCORE
Liferay: 5
Jonathan Neal: 0


All right. Mickey, Lisa, tell me how I can break this.

Otherwise, I can only tell you with absolute personal experience and some 1,230,000 search results that it really does work.
Mickey Fox
RE: Move to FreeMarker from Velocity
24 marzo 2010 19.53
Risposta

Mickey Fox

Punteggio: Junior Member

Messaggi: 60

Data di Iscrizione: 15 luglio 2009

Messaggi recenti

LOL, try putting special characters in blog titles, etc.

Merely disabling special characters is not an acceptable solution (and if you found that thread, you will know the individuals REQUIRE special characters in their usernames for reasons outside of Liferay.)

You see, the special character issue is not one that is evident in the page itself, it's one that exists in the titling function. Try writing a blog post and titling it with a question (as in "Will this post work?" or, better yet, just put a friggin name with an umlat in it, or heck, maybe even a hyphen) Now try doing simple things like commenting, etc. You can't. Because it's broken. BROKEN.

Forget doing the tests that you've been running and go over to the bug reporting area - look for the issue there.

Frankly, I'm a wee bit tired of being treated as if I am some ignorant child with a silly rant. I am frustrated with the patronizing "answers" that appear here and even more frustrated with Liferay's Bullshit.

There is a problem with special characters in the titling functions. It's a *VERY* well documented problem. It's been documented for well over a year now. And I am sick of Liferay pretending it's NOT A PROBLEM BECAUSE "IT'S A KNOWN BUG."

Do yourself a big favor. Pretend that the folks who comment here on a regular basis have a clue. Maybe contact them off-line for an in-depth explanation before you make an ass of yourself.

Having said that, know this: You had earned my respect because of your initial forthrightness. You have lost it in a single asinine bout of hubris.

I shant bother with this platform any more - I will go to EXO (GateIn). Please cancel my username and account. And - this message is for all Liferay - remember your roots. This program *was* about God; *now* it's about you.
Lisa Simpson
RE: Move to FreeMarker from Velocity
25 marzo 2010 6.01
Risposta

Lisa Simpson

Punteggio: Liferay Legend

Messaggi: 2034

Data di Iscrizione: 5 marzo 2009

Messaggi recenti

Dood,

Most of this stuff is tied to my JIRA account and Dimitry Babain, and some other people.

http://www.liferay.com/community/forums/-/message_boards/message/4731242?_19_redirect=%2Fcommunity%2Fforums%2F-%2Fmessage_boards%2Fsearch%3F_19_redirect%3D%252Fcommunity%252Fforums%252F-%252Fmessage_boards%252Fcategory%252F243728%26_19_breadcrumbsCategoryId%3D243728%26_19_searchCategoryId%3D243728%26_19_keywords%3DESL

http://www.liferay.com/community/forums/-/message_boards/message/4348148?_19_redirect=%2Fcommunity%2Fforums%2F-%2Fmessage_boards%2Fsearch%3F_19_redirect%3D%252Fcommunity%252Fforums%252F-%252Fmessage_boards%252Fcategory%252F243728%26_19_breadcrumbsCategoryId%3D243728%26_19_searchCategoryId%3D243728%26_19_keywords%3DESL

http://www.liferay.com/community/forums/-/message_boards/message/4215608?_19_redirect=%2Fcommunity%2Fforums%2F-%2Fmessage_boards%2Fsearch%3F_19_redirect%3D%252Fcommunity%252Fforums%252F-%252Fmessage_boards%252Fcategory%252F243728%26_19_breadcrumbsCategoryId%3D243728%26_19_searchCategoryId%3D243728%26_19_keywords%3DESL

There's three threads that I've pulled right off the top. There's about a zillion more. Seriously.... we're not the only ones having this issue..... and YES the database is set to UTF-8. The information in the database is correct.

Talk to Mr. Ferrer. He's been promising me that it will get fixed because I had an absolute EXPLOSION and splattered all over the forums when the developer (I think it's in the ticket in that middle thread) said that it was "core to Liferay and not really a problem".
Jonathan Neal
RE: Move to FreeMarker from Velocity
25 marzo 2010 11.12
Risposta

Jonathan Neal

LIFERAY STAFF

Punteggio: Junior Member

Messaggi: 66

Data di Iscrizione: 29 agosto 2007

Messaggi recenti

Show me the money.

Lisa Simpson:
http://www.liferay.com/community/forums/-/message_boards/message/4731242?_19_redirect=%2Fcommunity%2Fforums%2F-%2Fmessage_boards%2Fsearch%3F_19_redirect%3D%252Fcommunity%252Fforums%252F-%252Fmessage_boards%252Fcategory%252F243728%26_19_breadcrumbsCategoryId%3D243728%26_19_searchCategoryId%3D243728%26_19_keywords%3DESL


Amos could not replicate this, and he provided an example of it working.

Lisa Simpson:
http://www.liferay.com/community/forums/-/message_boards/message/4348148?_19_redirect=%2Fcommunity%2Fforums%2F-%2Fmessage_boards%2Fsearch%3F_19_redirect%3D%252Fcommunity%252Fforums%252F-%252Fmessage_boards%252Fcategory%252F243728%26_19_breadcrumbsCategoryId%3D243728%26_19_searchCategoryId%3D243728%26_19_keywords%3DESL


I believe this was covered in my previous post (in reference to this). Minhchau replied: "Usernames are used as the friendly URL for each user's personal page, so allowing special characters which aren't accepted in the URL path defined in RFC-1738 would be a bad idea."

Lisa Simpson:
http://www.liferay.com/community/forums/-/message_boards/message/4215608?_19_redirect=%2Fcommunity%2Fforums%2F-%2Fmessage_boards%2Fsearch%3F_19_redirect%3D%252Fcommunity%252Fforums%252F-%252Fmessage_boards%252Fcategory%252F243728%26_19_breadcrumbsCategoryId%3D243728%26_19_searchCategoryId%3D243728%26_19_keywords%3DESL


But my screenshots don't mean much in here, do they. emoticon

Lisa Simpson:
There's three threads that I've pulled right off the top. There's about a zillion more.


Then let's go through all of them until we can replicate this issue and fix it.

Lisa Simpson:
Talk to Mr. Ferrer.


No problem, take it away Jorge!
Jorge Ferrer
RE: Move to FreeMarker from Velocity
25 marzo 2010 11.12
Risposta

Jorge Ferrer

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2756

Data di Iscrizione: 31 agosto 2006

Messaggi recenti

Hi Lisa, Michael, Jon,

Here is the ticket that I have assigned to me: http://issues.liferay.com/browse/LPS-6105.

I created it based on a comment from you although I couldn't reproduce the problem at the time. So I thought that maybe I had to spend more time to test it in depth, but I haven't had time for it yet.

Based on Jon's post it seems he hasn't reproduced it either. Michael, Lisa, I think it's just that we are not testing the exact same thing. Could you add more info to the ticket linked above with an exact step-by-step guide to reproduce it?

It would be great if you could also test it in Liferay 6 preview. If you can't I'll do it.