1 32 33 package com.knowgate.http.portlets; 34 35 import java.util.Hashtable ; 36 import java.util.Enumeration ; 37 import java.util.Properties ; 38 import java.util.Map ; 39 import java.util.Locale ; 40 41 import java.security.Principal ; 42 43 import javax.portlet.*; 44 45 import javax.servlet.http.HttpServletRequest ; 46 47 51 52 public class HipergateRenderRequest implements RenderRequest { 53 54 private HttpServletRequest oSrvltReq; 55 private Properties oProps; 56 private Hashtable oAttrs; 57 private WindowState oWinState; 58 59 public HipergateRenderRequest(HttpServletRequest oServletReq) { 60 oAttrs = new Hashtable (); 61 oProps = new Properties (); 62 oSrvltReq = oServletReq; 63 oWinState = WindowState.NORMAL; 64 } 65 66 public boolean isWindowStateAllowed(WindowState state) { 67 return state == WindowState.NORMAL; 68 } 69 70 public boolean isPortletModeAllowed(PortletMode mode) { 71 return mode == PortletMode.VIEW; 72 } 73 74 public PortletMode getPortletMode () { 75 return PortletMode.VIEW; 76 } 77 78 public WindowState getWindowState () { 79 return oWinState; 80 } 81 82 public void setWindowState (String state) { 83 if (state.equalsIgnoreCase("NORMAL")) 84 oWinState = WindowState.NORMAL; 85 else if (state.equalsIgnoreCase("MINIMIZED")) 86 oWinState = WindowState.MINIMIZED; 87 else if (state.equalsIgnoreCase("MAXIMIZED")) 88 oWinState = WindowState.MAXIMIZED; 89 } 90 91 public void setWindowState (WindowState state) { 92 oWinState = state; 93 } 94 95 public PortletPreferences getPreferences () { 96 return null; 97 } 98 99 public PortletSession getPortletSession () { 100 return null; 101 } 102 103 public PortletSession getPortletSession (boolean create) { 104 return null; 105 } 106 107 public String getProperty(String name) { 108 return oProps.getProperty(name); 109 } 110 111 public void setProperty(String name, String value) { 112 oProps.put(name, value); 113 } 114 115 public void setProperties(Properties props) { 116 oProps = props; 117 } 118 119 public Enumeration getProperties(String name) { 120 return (Enumeration ) oProps; 121 } 122 123 public Enumeration getPropertyNames() { 124 return oProps.keys(); 125 } 126 127 public PortalContext getPortalContext() { 128 return null; 129 130 } 131 132 public String getAuthType() { 133 return null; 134 } 135 136 public String getContextPath() { 137 return oSrvltReq.getContextPath(); 138 } 139 140 public String getRemoteUser() { 141 return oSrvltReq.getRemoteUser(); 142 } 143 144 public Principal getUserPrincipal() { 145 return oSrvltReq.getUserPrincipal(); 146 } 147 148 public boolean isUserInRole(String role) { 149 return false; 150 } 151 152 public Object getAttribute(String name) { 153 return oAttrs.get(name); 154 } 155 156 public Enumeration getAttributeNames() { 157 return oAttrs.keys(); 158 } 159 160 public String getParameter(String name) { 161 return oSrvltReq.getParameter(name); 162 } 163 164 public Enumeration getParameterNames() { 165 return oSrvltReq.getParameterNames(); 166 } 167 168 public String [] getParameterValues(String name) { 169 return oSrvltReq.getParameterValues(name); 170 } 171 172 public Map getParameterMap() { 173 return oSrvltReq.getParameterMap(); 174 } 175 176 public boolean isSecure() { 177 return false; 178 } 179 180 public void setAttribute(String name, Object o) { 181 if (oAttrs.containsKey(name)) oAttrs.remove(name); 182 oAttrs.put(name, o); 183 } 184 185 public void removeAttribute(String name) { 186 oAttrs.remove(name); 187 } 188 189 public String getRequestedSessionId() { 190 return oSrvltReq.getRequestedSessionId(); 191 } 192 193 public boolean isRequestedSessionIdValid() { 194 return oSrvltReq.isRequestedSessionIdValid(); 195 } 196 197 public String getResponseContentType() { 198 throw new UnsupportedOperationException ("getResponseContentType() not implemented at HipergateRenderRequest"); 199 } 200 201 public Enumeration getResponseContentTypes() { 202 throw new UnsupportedOperationException ("getResponseContentTypes() not implemented HipergateRenderRequest"); 203 } 204 205 public Locale getLocale() { 206 return oSrvltReq.getLocale(); 207 } 208 209 public Enumeration getLocales() { 210 return oSrvltReq.getLocales(); 211 } 212 213 public String getScheme() { 214 return oSrvltReq.getScheme(); 215 } 216 217 public String getServerName() { 218 return oSrvltReq.getServerName(); 219 } 220 221 public int getServerPort() { 222 return oSrvltReq.getServerPort(); 223 } 224 } 225 | Popular Tags |