1 /**
2 * Copyright (C) 2005-2009 Alfresco Software Limited.
3 *
4 * This file is part of the Spring Surf Extension project.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 package org.springframework.extensions.webscripts.jsf;
20
21 import org.springframework.extensions.surf.util.Content;
22 import org.springframework.extensions.surf.util.URLDecoder;
23 import org.springframework.extensions.webscripts.Match;
24 import org.springframework.extensions.webscripts.Runtime;
25 import org.springframework.extensions.webscripts.WebScriptRequestURLImpl;
26
27 /**
28 * Implementation of a WebScript Request for the JSF environment.
29 *
30 * @author Kevin Roast
31 */
32 public class WebScriptJSFRequest extends WebScriptRequestURLImpl
33 {
34 /**
35 * Construct
36 *
37 * @param container
38 * @param scriptUrlParts
39 * @param match
40 */
41 public WebScriptJSFRequest(Runtime container, String[] scriptUrlParts, Match match)
42 {
43 super(container, scriptUrlParts, match);
44 // decode url args (as they would be if this was a servlet)
45 for (String name : this.queryArgs.keySet())
46 {
47 this.queryArgs.put(name, URLDecoder.decode(this.queryArgs.get(name)));
48 }
49 }
50
51 /* (non-Javadoc)
52 * @see org.alfresco.web.scripts.WebScriptRequest#getServerPath()
53 */
54 public String getServerPath()
55 {
56 // NOTE: not accessable from JSF context - cannot create absolute external urls...
57 return "";
58 }
59
60 /* (non-Javadoc)
61 * @see org.alfresco.web.scripts.WebScriptRequest#getAgent()
62 */
63 public String getAgent()
64 {
65 // NOTE: unknown in the JSF environment
66 return null;
67 }
68
69 /* (non-Javadoc)
70 * @see org.alfresco.web.scripts.WebScriptRequest#getHeaderNames()
71 */
72 public String[] getHeaderNames()
73 {
74 return new String[] {};
75 }
76
77 /* (non-Javadoc)
78 * @see org.alfresco.web.scripts.WebScriptRequest#getHeader(java.lang.String)
79 */
80 public String getHeader(String name)
81 {
82 return null;
83 }
84
85 /* (non-Javadoc)
86 * @see org.alfresco.web.scripts.WebScriptRequest#getHeaderValues(java.lang.String)
87 */
88 public String[] getHeaderValues(String name)
89 {
90 return null;
91 }
92
93 /* (non-Javadoc)
94 * @see org.alfresco.web.scripts.WebScriptRequest#getContent()
95 */
96 public Content getContent()
97 {
98 return null;
99 }
100
101 }