KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > services > portletcontainer > impl > utils > PortletUtil


1 /**
2  * Copyright 2001-2003 The EXO Development Team All rights reserved.
3  * Please look at license.txt in info directory for more license detail.
4  **/

5
6 package org.exoplatform.services.portletcontainer.impl.utils;
7
8
9 import java.util.List JavaDoc;
10 import org.exoplatform.services.portletcontainer.pci.model.Description;
11 import org.exoplatform.services.portletcontainer.pci.model.Portlet;
12 /**
13  * Created by the Exo Development team
14  * Author : Tuan Nguyen
15  * tuan08@users.sourceforge.net
16  */

17 public class PortletUtil {
18
19   static public String JavaDoc getPortletTitle(Portlet portlet) {
20     return portlet.getPortletInfo().getTitle() ;
21   }
22
23   static public String JavaDoc getDescription(Portlet portlet, String JavaDoc lang) {
24     lang = lang.toLowerCase() ;
25     List JavaDoc list = portlet.getDescription() ;
26     for (int i = 0; i < list.size(); i++) {
27       Description desc = (Description) list.get(i) ;
28       if (lang.equals(desc.getLang().toLowerCase())) {
29         return desc.getDescription() ;
30       }
31     }
32    return null ;
33   }
34 }
35
Popular Tags