1 package org.andromda.cartridges.jsf.portlet.myfaces.tomahawk.support;
2
3 import java.io.BufferedReader;
4 import java.io.IOException;
5 import java.io.UnsupportedEncodingException;
6 import java.security.Principal;
7 import java.util.Enumeration;
8 import java.util.Locale;
9 import java.util.Map;
10 import javax.portlet.PortalContext;
11 import javax.portlet.PortletContext;
12 import javax.portlet.PortletMode;
13 import javax.portlet.PortletPreferences;
14 import javax.portlet.PortletRequest;
15 import javax.portlet.PortletSession;
16 import javax.portlet.WindowState;
17 import javax.servlet.RequestDispatcher;
18 import javax.servlet.ServletInputStream;
19 import javax.servlet.http.Cookie;
20 import javax.servlet.http.HttpServletRequest;
21 import javax.servlet.http.HttpSession;
22
23
24
25
26
27
28
29 public class HttpServletRequestWrapper
30 implements HttpServletRequest
31 {
32 private final PortletRequest portletRequest;
33 private final PortletContext portletContext;
34
35
36
37
38
39 public HttpServletRequestWrapper(
40 final PortletRequest portletRequest,
41 final PortletContext portletContext)
42 {
43 this.portletRequest = portletRequest;
44 this.portletContext = portletContext;
45 }
46
47
48
49
50 public String getAuthType()
51 {
52 return portletRequest.getAuthType();
53 }
54
55
56
57
58 public String getContextPath()
59 {
60 return portletRequest.getContextPath();
61 }
62
63
64
65
66 public Cookie[] getCookies()
67 {
68 return new Cookie[0];
69 }
70
71
72
73
74 public long getDateHeader(final String dateHeader)
75 {
76 return 0;
77 }
78
79
80
81
82 public String getHeader(final String header)
83 {
84 return null;
85 }
86
87
88
89
90 public Enumeration getHeaderNames()
91 {
92 return null;
93 }
94
95
96
97
98 public Enumeration getHeaders(final String arg0)
99 {
100 return null;
101 }
102
103
104
105
106 public int getIntHeader(final String arg0)
107 {
108 return 0;
109 }
110
111
112
113
114 public String getMethod()
115 {
116 return null;
117 }
118
119
120
121
122 public String getPathInfo()
123 {
124 return null;
125 }
126
127
128
129
130 public String getPathTranslated()
131 {
132 return null;
133 }
134
135
136
137
138 public String getQueryString()
139 {
140 return null;
141 }
142
143
144
145
146 public String getRemoteUser()
147 {
148 return portletRequest.getRemoteUser();
149 }
150
151
152
153
154 public String getRequestedSessionId()
155 {
156 return portletRequest.getRequestedSessionId();
157 }
158
159
160
161
162 public String getRequestURI()
163 {
164 return null;
165 }
166
167
168
169
170 public StringBuffer getRequestURL()
171 {
172 return null;
173 }
174
175
176
177
178 public String getServletPath()
179 {
180 return null;
181 }
182
183
184
185
186 public HttpSession getSession()
187 {
188 return new HttpSessionWrapper(portletRequest.getPortletSession(),
189 portletContext);
190 }
191
192
193
194
195 public HttpSession getSession(final boolean create)
196 {
197 return new HttpSessionWrapper(portletRequest.getPortletSession(create),
198 portletContext);
199 }
200
201
202
203
204 public Principal getUserPrincipal()
205 {
206 return portletRequest.getUserPrincipal();
207 }
208
209
210
211
212 public boolean isRequestedSessionIdFromCookie()
213 {
214 return false;
215 }
216
217
218
219
220
221 @Deprecated
222 public boolean isRequestedSessionIdFromUrl()
223 {
224 return false;
225 }
226
227
228
229
230 public boolean isRequestedSessionIdFromURL()
231 {
232 return false;
233 }
234
235
236
237
238 public boolean isRequestedSessionIdValid()
239 {
240 return portletRequest.isRequestedSessionIdValid();
241 }
242
243
244
245
246 public boolean isUserInRole(final String arg0)
247 {
248 return portletRequest.isUserInRole(arg0);
249 }
250
251
252
253
254 public Object getAttribute(final String arg0)
255 {
256 return portletRequest.getAttribute(arg0);
257 }
258
259
260
261
262 public Enumeration getAttributeNames()
263 {
264 return portletRequest.getAttributeNames();
265 }
266
267
268
269
270 public String getCharacterEncoding()
271 {
272 return null;
273 }
274
275
276
277
278 public int getContentLength()
279 {
280 return 0;
281 }
282
283
284
285
286 public String getContentType()
287 {
288 return null;
289 }
290
291
292
293
294 public ServletInputStream getInputStream() throws IOException
295 {
296 return null;
297 }
298
299
300
301
302 public Locale getLocale()
303 {
304 return portletRequest.getLocale();
305 }
306
307
308
309
310 public Enumeration getLocales()
311 {
312 return portletRequest.getLocales();
313 }
314
315
316
317
318 public String getParameter(final String arg0)
319 {
320 return portletRequest.getParameter(arg0);
321 }
322
323
324
325
326 public Map getParameterMap()
327 {
328 return portletRequest.getParameterMap();
329 }
330
331
332
333
334 public Enumeration getParameterNames()
335 {
336 return portletRequest.getParameterNames();
337 }
338
339
340
341
342 public String[] getParameterValues(final String arg0)
343 {
344 return portletRequest.getParameterValues(arg0);
345 }
346
347
348
349
350 public String getProtocol()
351 {
352 return null;
353 }
354
355
356
357
358 public BufferedReader getReader() throws IOException
359 {
360 return null;
361 }
362
363
364
365
366
367 @Deprecated
368 public String getRealPath(final String arg0)
369 {
370 return null;
371 }
372
373
374
375
376 public String getRemoteAddr()
377 {
378 return null;
379 }
380
381
382
383
384 public String getRemoteHost()
385 {
386 return null;
387 }
388
389
390
391
392 public RequestDispatcher getRequestDispatcher(final String arg0)
393 {
394 return null;
395 }
396
397
398
399
400 public String getScheme()
401 {
402 return portletRequest.getScheme();
403 }
404
405
406
407
408 public String getServerName()
409 {
410 return portletRequest.getServerName();
411 }
412
413
414
415
416 public int getServerPort()
417 {
418 return portletRequest.getServerPort();
419 }
420
421
422
423
424 public boolean isSecure()
425 {
426 return portletRequest.isSecure();
427 }
428
429
430
431
432 public void removeAttribute(final String arg0)
433 {
434 portletRequest.removeAttribute(arg0);
435 }
436
437
438
439
440 public void setAttribute(final String arg0, final Object arg1)
441 {
442 portletRequest.setAttribute(arg0, arg1);
443 }
444
445
446
447
448 public void setCharacterEncoding(final String encoding) throws UnsupportedEncodingException
449 {
450 }
451
452
453
454
455 public PortalContext getPortalContext()
456 {
457 return portletRequest.getPortalContext();
458 }
459
460
461
462
463 public PortletMode getPortletMode()
464 {
465 return portletRequest.getPortletMode();
466 }
467
468
469
470
471 public PortletSession getPortletSession()
472 {
473 return portletRequest.getPortletSession();
474 }
475
476
477
478
479
480 public PortletSession getPortletSession(final boolean create)
481 {
482 return portletRequest.getPortletSession(create);
483 }
484
485
486
487
488 public PortletPreferences getPreferences()
489 {
490 return portletRequest.getPreferences();
491 }
492
493
494
495
496
497 public Enumeration getProperties(final String arg0)
498 {
499 return portletRequest.getProperties(arg0);
500 }
501
502
503
504
505
506 public String getProperty(final String arg0)
507 {
508 return portletRequest.getProperty(arg0);
509 }
510
511
512
513
514 public Enumeration getPropertyNames()
515 {
516 return portletRequest.getPropertyNames();
517 }
518
519
520
521
522 public String getResponseContentType()
523 {
524 return portletRequest.getResponseContentType();
525 }
526
527
528
529
530 public Enumeration getResponseContentTypes()
531 {
532 return portletRequest.getResponseContentTypes();
533 }
534
535
536
537
538 public WindowState getWindowState()
539 {
540 return portletRequest.getWindowState();
541 }
542
543
544
545
546
547 public boolean isPortletModeAllowed(final PortletMode portletMode)
548 {
549 return portletRequest.isPortletModeAllowed(portletMode);
550 }
551
552
553
554
555
556 public boolean isWindowStateAllowed(final WindowState windowState)
557 {
558 return portletRequest.isWindowStateAllowed(windowState);
559 }
560
561
562
563
564 public int getRemotePort()
565 {
566 return 0;
567 }
568
569
570
571
572 public String getLocalName()
573 {
574 return null;
575 }
576
577
578
579
580 public String getLocalAddr()
581 {
582 return null;
583 }
584
585
586
587
588 public int getLocalPort()
589 {
590 return 0;
591 }
592 }