Foros de discusión
How do I retrieve the list of article types from a JSF portlet
Jean-Noel Colin, modificado hace 15 años.
How do I retrieve the list of article types from a JSF portlet
New Member Mensajes: 17 Fecha de incorporación: 11/02/08 Mensajes recientes
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
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, modificado hace 15 años.
RE: How do I retrieve the list of article types from a JSF portlet
Regular Member Mensajes: 107 Fecha de incorporación: 21/11/07 Mensajes recientes
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
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, modificado hace 15 años.
RE: How do I retrieve the list of article types from a JSF portlet
New Member Mensajes: 17 Fecha de incorporación: 11/02/08 Mensajes recientes
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
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, modificado hace 15 años.
RE: How do I retrieve the list of article types from a JSF portlet
Regular Member Mensajes: 107 Fecha de incorporación: 21/11/07 Mensajes recientes
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
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é, modificado hace 15 años.
RE: How do I retrieve the list of article types from a JSF portlet
Liferay Legend Mensajes: 1197 Fecha de incorporación: 8/02/05 Mensajes recientes
Try:
[tt]String[] TYPES = PropsUtil.getArray(PropsKeys.JOURNAL_ARTICLE_TYPES);[/tt]
HTH!
[tt]String[] TYPES = PropsUtil.getArray(PropsKeys.JOURNAL_ARTICLE_TYPES);[/tt]
HTH!
Jean-Noel Colin, modificado hace 15 años.
RE: How do I retrieve the list of article types from a JSF portlet
New Member Mensajes: 17 Fecha de incorporación: 11/02/08 Mensajes recientes
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
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