Foren

How do I retrieve the list of article types from a JSF portlet

Jean-Noel Colin, geändert vor 15 Jahren.

How do I retrieve the list of article types from a JSF portlet

New Member Beiträge: 17 Beitrittsdatum: 11.02.08 Neueste Beiträge
Hi

I've written a jsf portlet, and I would need to retrieve the list of available article types (news, general, annoucement,...) to create a combobox. What's the right way to do that?

Thanks for your help

Jean-Noel Colin
Christopher Olbertz, geändert vor 15 Jahren.

RE: How do I retrieve the list of article types from a JSF portlet

Regular Member Beiträge: 107 Beitrittsdatum: 21.11.07 Neueste Beiträge
Hi Jean-Noel,

my problem was similiar to yours. I solved it in the following way:

I created a bean, which contains service-methods. I will call it ArticleService. It is a managed bean with the name articleServce in the faces-config.xml.

Now, you build a method ArrayList ArticleService.getArticleList(). In this method, you can read the list from the database and return it as ArrayList. You can display the data for example in a datatable. Here is an example:

<h:dataTable id="articles" value="#{articleService.articleList}" var="row" border="1">

The variable "row" is the current article. You can access it in buttons for example with row.news.

I hope, you understand, what I mean.

Here is a link to a tutorial, which helped me very much.

http://www.laliluna.de/first-java-server-faces-tutorial.html

Christopher
Jean-Noel Colin, geändert vor 15 Jahren.

RE: How do I retrieve the list of article types from a JSF portlet

New Member Beiträge: 17 Beitrittsdatum: 11.02.08 Neueste Beiträge
Hi Christopher

THanks a lot for your response; I do understand the JSF part, my question was more how to retrieve the list of article types from Liferay as well as the localized version.

Best

Jean-Noel
Christopher Olbertz, geändert vor 15 Jahren.

RE: How do I retrieve the list of article types from a JSF portlet

Regular Member Beiträge: 107 Beitrittsdatum: 21.11.07 Neueste Beiträge
Hi Jean-Noel,

I'm sorry. I missunderstood you. I was glad, that I can help anybody this time, because I normally need a lot of help. But now, I can't help you.

I hope, you find an answer for your problem.

Christopher
thumbnail
Ray Augé, geändert vor 15 Jahren.

RE: How do I retrieve the list of article types from a JSF portlet

Liferay Legend Beiträge: 1197 Beitrittsdatum: 08.02.05 Neueste Beiträge
Try:

[tt]String[] TYPES = PropsUtil.getArray(PropsKeys.JOURNAL_ARTICLE_TYPES);[/tt]

HTH!
Jean-Noel Colin, geändert vor 15 Jahren.

RE: How do I retrieve the list of article types from a JSF portlet

New Member Beiträge: 17 Beitrittsdatum: 11.02.08 Neueste Beiträge
Thanks. That's definitely going in the good direction, but I'm developing in the plugin enviromnent, and the only method available from PropsUtils is get(String)

It seems that the class you're refering to is com/liferay/portal/util/PropsUtil.java while the one available in the plugin environment is com/liferay/portal/kernel/util/PropsUtil.java

Is there a way to obtain those values from the plugin SDK env?

Thanks

Jean-Noel