1 16 19 20 package org.apache.pluto.core.impl; 21 22 import java.io.BufferedReader ; 23 import java.io.IOException ; 24 import java.util.Enumeration ; 25 26 import javax.portlet.PortletPreferences; 27 import javax.portlet.RenderRequest; 28 29 import org.apache.pluto.PortletContainerServices; 30 import org.apache.pluto.factory.PortletObjectAccess; 31 import org.apache.pluto.om.window.PortletWindow; 32 import org.apache.pluto.services.log.LogService; 33 import org.apache.pluto.services.log.Logger; 34 35 43 public class RenderRequestImpl extends PortletRequestImpl implements RenderRequest { 44 47 private PortletPreferences portletPreferences = null; 48 private Logger log = null; 49 50 public RenderRequestImpl(PortletWindow portletWindow, 51 javax.servlet.http.HttpServletRequest servletRequest) 52 { 53 super(portletWindow, servletRequest); 54 this.log = ((LogService)PortletContainerServices 55 .get(LogService.class)).getLogger(getClass()); 56 } 57 58 62 public BufferedReader getReader() throws IOException 63 { 64 return super.getReader(); 65 } 66 67 public PortletPreferences getPreferences() 68 { 69 if(log.isDebugEnabled()) { 70 log.debug("Getting Preferences: "+portletPreferences); 71 } 72 73 if (portletPreferences == null) { 74 portletPreferences = PortletObjectAccess.getPortletPreferences( 75 org.apache.pluto.Constants.METHOD_RENDER, 76 super.getInternalPortletWindow().getPortletEntity() 77 ); 78 } 79 if(log.isDebugEnabled()) { 80 log.debug("Returning Preferences: " + portletPreferences); 81 Enumeration e = portletPreferences.getNames(); 82 while (e.hasMoreElements()) { 83 String name = (String )e.nextElement(); 84 log.debug(" - Preference: name = " + name); 85 } 86 } 87 88 return portletPreferences; 89 } 90 } 92 | Popular Tags |