1
2 private String getPortletIdByName(String portletName){
3 //logger.info("searching for portlet with name " + portletName);
4 List<Portlet> list = PortletLocalServiceUtil.getPortlets();
5
6 for(int i=0;i<list.size();i++){
7
8 try{
9 //logger.info(list.get(i).getDisplayName() + " - ");
10 if(list.get(i).getDisplayName().equalsIgnoreCase(portletName)){
11 //logger.info("portlet found");
12 return list.get(i).getPortletId();
13 }
14 }catch(Exception e){
15 logger.error(e.getMessage());
16 }
17 }
18 //logger.info("portlet not found");
19 return null;
20 }
i wrote this to put all my istanceable and non portlets into the pages through my hook
Please sign in to flag this as inappropriate.