Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Guenter Nobody
why are the important portlets not based on JournalArticle ?
September 20, 2012 10:51 AM
Answer

Guenter Nobody

Rank: Regular Member

Posts: 119

Join Date: January 27, 2012

Recent Posts

Hi,

is there a reason why the calendar, knowledge base and other important ones were not developed upon the Journal Article ? Because now we noticed we can't localize or extend them at all.

than you
Alireza Zare
RE: why are the important portlets not based on JournalArticle ?
September 20, 2012 12:57 PM
Answer

Alireza Zare

Rank: Regular Member

Posts: 110

Join Date: September 3, 2010

Recent Posts

Hi Guenter,
That is the idea of having different portlets for different reasons. You can place them where you want, reuse them and change them seprately.
Journal Article is just a functionality among others. It is not the core functionality of Liferay. Because Liferay is not a CMS but a Portal.
I don't know exactly what you need to do, but you can hook portlets and this way modify and extend them.
If there are functionalities that you need and they are not there, than you have to create your own portlet.

Regards,
Alireza
Guenter Nobody
RE: why are the important portlets not based on JournalArticle ?
September 30, 2012 11:50 AM
Answer

Guenter Nobody

Rank: Regular Member

Posts: 119

Join Date: January 27, 2012

Recent Posts

Thank you, the reason why I've asked this that we'd like to start contributing some things back but if everybody is doing is own soup it doesn't make much sense anymore. Sure, I am understanding now "...its not a cms" but somehow this is somehow the reason we choose Liferay. It's cms features are also highlighted on the frontpage and I am now pretty much confused to hear that its bad to build on.

g
Hitoshi Ozawa
RE: why are the important portlets not based on JournalArticle ?
September 30, 2012 4:45 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

It may be because portlets are being added by different liferay.com teams. I don't think there was a definite guideline to how portlets should be build, but I think we're getting to know the best practices for building them know.
James Falkner
RE: why are the important portlets not based on JournalArticle ?
September 30, 2012 5:15 PM
Answer

James Falkner

Community Moderator

Rank: Liferay Legend

Posts: 1406

Join Date: September 17, 2010

Recent Posts

Hitoshi Ozawa:
It may be because portlets are being added by different liferay.com teams. I don't think there was a definite guideline to how portlets should be build, but I think we're getting to know the best practices for building them know.


I know it doesn't help existing deployments, but you should check out the work that Juan has done to bring some of the Journal-related capability (templating) to other portlets based on the asset framework (like blogs, calendars, etc). It will let you re-use the backend asset infrastructure, while providing your own template with which to render the items. It doesn't bring the full functionality of Journal to every other portlet (e.g. you can't version a calendar entry with it) but it's cool nonetheless!
Jorge Ferrer
RE: why are the important portlets not based on JournalArticle ?
October 3, 2012 2:28 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2768

Join Date: August 31, 2006

Recent Posts

Hey guys,

This thread was just brought to my attention and I'd like to add some additional information.

I'll start with the original question: Why are not all portlets built based on JournalArticle?

The reason is that JournalArticle is meant as a way to allow authoring and management of web content. The needs of web content are in some cases similar but in many ways also different to other portlets, even if they are content based as well. So if all portlets were based on JournalArticle we would end up either having the minimum functionality common to all or too much functionality in all applications. Some other platforms have tried that approach but we don't think it is the best.

Instead the Liferay approach is to have independent applications for things that are different (such as handling significantly different types of content) and invest in having a common infrastructure and set of frameworks so that all applications can reuse them. Good examples of this are the asset framework that allow handling tags, categories and others in a unified way, the API to allow storing attachments in the doc lib from any portlet (which is going through a lot of improvements for 6.2 BTW), and many others.

For internationalization in particular, which seems to be the root question that motivated this thread, we also realized that many portlets benefited from it and we also created a framework to allow applying the same techniques that Journal uses to any other portlet. We have already applied it to several portlets. Calendar in particular was in the plan but had to be dropped out of 6.1.

If you want to contribute it for 6.2 it would be highly appreciated. You can take a look at how it is done for roles, for example, because its UI is simple and can serve you as a model.

PS:
Hitoshi Ozawa:

It may be because portlets are being added by different liferay.com teams. I don't think there was a definite guideline to how portlets should be build, but I think we're getting to know the best practices for building them know.


With all the useful answers you provide in the forums Hitoshi, I gotta say that some times you puzzle me with this type of FUD. I think you've been around enough to know that we have a very strict review process for all code that goes into the product so what you are saying above is just impossible.

I would appreciate if you avoid saying things like that unless you really know that's the case, because we work very hard to make the best product possible and comments like that from a very active community member make it seem like we don't even try. It's quite discouraging.
Hitoshi Ozawa
RE: why are the important portlets not based on JournalArticle ?
October 3, 2012 11:23 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

I think you've been around enough to know that we have a very strict review process for all code that goes into the product so what you are saying above is just impossible.


I'm not talking about quality here. I'm talking about consistency of design and implementation.

I know there is a strict review process but do you have a written guideline on how portlets should be designed and constructed? If you do have it, I'm sure most of us here would really appreciate if you'll make it available and it'll probably greatly improve quality of community build portlets.

Liferay offers many different technologies and it's possible develop portlets using different methods, but is there a recommended best way? I think most developers starting of portlet development gets mixed up because there are too many ways to do things.

I'm sure having a written best practices on portlet design and implementation will greatly increase the number of developers writing portlets.

There are many examples on how to develop portlets in different ways, but I think beginning developer just want to know how to do it in one "recommended" way. From looking at liferay's source code, it's difficult to know what the "recommended" way is.

Number of portlets are going to increase. It would be difficult to have more complex portlet interoperability and portlet reuse without a common guideline.

Jorge, I think the difference between us is that you're more concerned about the code liferay.com is writing, while I'm more concerned about getting more developers participate in writing code using liferay. Yes, I do write programs but I'll rather have somebody else write it for me if possible.
Jorge Ferrer
RE: why are the important portlets not based on JournalArticle ?
October 4, 2012 1:56 AM
Answer

Jorge Ferrer

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2768

Join Date: August 31, 2006

Recent Posts

Hi Hitoshi,

Hitoshi:

I'm not talking about quality here. I'm talking about consistency of design and implementation.


Keeping consistency is probably the #1 priority of the code reviews. If you happen to meet Brian in person or try sending a contribution you'll be able to check how Strict he is with consisteny.

Hitoshi:

I know there is a strict review process but do you have a written guideline on how portlets should be designed and constructed?


We do have written guidelines but it's impossible to cover everything in a written document and keep it up to date. Instead we rely on a common set of rules which can be translated to:
1) Always follow the patterns of the existing code
2) If you don't agree with an existing pattern you can come up with a better one as long as you change it everywhere

These rules are applied very strictly and only very specific cases are allowed as an exception. In fact I've always believed that such a level of consistency is one of the hidden secrets of Liferay and why the development team is so productive. I have never seen any code of a product even close to Liferay's size with such a great degree of consistency.

In summary, if you find something that seems inconsistent, there is most probably a good reason for it. And if there is not a reason feel free to fix it and send us a pull request or just let us know and it'll be solved quickly.

Hope that helps.
Hitoshi Ozawa
RE: why are the important portlets not based on JournalArticle ?
October 4, 2012 4:36 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Come on Jorge, those are mostly coding guidelines and about which technology to use and not a best practice guidelines on adding/customizing features. It's doesn't cover when a developer is suppose to use Web Content and when not to.

What I'm looking for is something like those explained in James' blog on why he choose to use Web Content over building a portlet. That is a very good blog on adding a feature to liferay. Most other pages are about "how to". I need something more of "why".

https://www.liferay.com/web/james.falkner/blog/-/blogs/10616492

If you happen to meet Brian in person or try sending a contribution you'll be able to check how Strict he is with consisteny.


I've seen Brian's recent talk on YouTube and I fully agree with him when he said that not everything can be communicated through the net. It'll be great if I can meet Brian and you in person. I think our goals are the same because we won't be spending so much time with liferay otherwise. :-)

BTW, I rate open source projects by people involved in the project and not by software's features - in other words, I think you guys are all great! :-)
Guenter Nobody
RE: why are the important portlets not based on JournalArticle ?
October 11, 2012 12:17 PM
Answer

Guenter Nobody

Rank: Regular Member

Posts: 119

Join Date: January 27, 2012

Recent Posts

Jorge Ferrer:
Hi Hitoshi,

2) If you don't agree with an existing pattern you can come up with a better one as long as you change it everywhere



Yup, I don't agree. I wanted a sort of toolbox at the time I chose Liferay, especially when it comes to content and its management. Many things are good but it still lacks of a straight forward way to build on existing work. Knowledgebase, calendar, do all their own persistence, managment, etc... routines and that doesn't look any good to me and actually they could have been inherited easily from JournalArticle.

"you can come up with a better" ...

Ideally, I'd love to register just a new content type for my portlets and inherit the things I need : persistence, indexing, localization, categorization, custom structures, custom templates, custom renderer and that's it !

I am fighting since quite a while with the JournalArticle classes from different trunk versions and the pain starts as soon I cross a version. I think its part of the core to remove this tedious fiddling, no ?