Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
Jean-Noel Colin
How do I retrieve the list of article types from a JSF portlet
27. August 2008 08:01
Antwort

Jean-Noel Colin

Rang: New Member

Nachrichten: 17

Eintrittsdatum: 11. Februar 2008

Neue 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
RE: How do I retrieve the list of article types from a JSF portlet
27. August 2008 08:12
Antwort

Christopher Olbertz

Rang: Regular Member

Nachrichten: 107

Eintrittsdatum: 21. November 2007

Neue 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
RE: How do I retrieve the list of article types from a JSF portlet
27. August 2008 08:18
Antwort

Jean-Noel Colin

Rang: New Member

Nachrichten: 17

Eintrittsdatum: 11. Februar 2008

Neue 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
RE: How do I retrieve the list of article types from a JSF portlet
27. August 2008 08:25
Antwort

Christopher Olbertz

Rang: Regular Member

Nachrichten: 107

Eintrittsdatum: 21. November 2007

Neue 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
Ray Augé
RE: How do I retrieve the list of article types from a JSF portlet
27. August 2008 11:04
Antwort

Ray Augé

LIFERAY STAFF

Rang: Liferay Legend

Nachrichten: 1195

Eintrittsdatum: 7. Februar 2005

Neue Beiträge

Try:

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

HTH!
Jean-Noel Colin
RE: How do I retrieve the list of article types from a JSF portlet
27. August 2008 12:00
Antwort

Jean-Noel Colin

Rang: New Member

Nachrichten: 17

Eintrittsdatum: 11. Februar 2008

Neue 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