1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
package org.apache.jetspeed.container.url.impl; |
18 |
|
|
19 |
|
import javax.servlet.http.HttpServletRequest; |
20 |
|
|
21 |
|
import org.apache.jetspeed.PortalContext; |
22 |
|
import org.apache.jetspeed.container.state.NavigationalState; |
23 |
|
import org.apache.jetspeed.container.url.BasePortalURL; |
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
public class QueryStringEncodingPortalURL extends AbstractPortalURL |
32 |
|
{ |
33 |
|
public QueryStringEncodingPortalURL(NavigationalState navState, PortalContext portalContext, BasePortalURL base) |
34 |
|
{ |
35 |
0 |
super(navState, portalContext, base); |
36 |
0 |
} |
37 |
|
|
38 |
|
public QueryStringEncodingPortalURL(NavigationalState navState, PortalContext portalContext) |
39 |
|
{ |
40 |
0 |
super(navState, portalContext); |
41 |
0 |
} |
42 |
|
|
43 |
|
public QueryStringEncodingPortalURL(String characterEncoding, NavigationalState navState, PortalContext portalContext) |
44 |
|
{ |
45 |
0 |
super(characterEncoding, navState, portalContext); |
46 |
0 |
} |
47 |
|
|
48 |
|
public QueryStringEncodingPortalURL(HttpServletRequest request, String characterEncoding, NavigationalState navState, PortalContext portalContext) |
49 |
|
{ |
50 |
0 |
super(request, characterEncoding, navState, portalContext); |
51 |
0 |
} |
52 |
|
|
53 |
|
protected void decodePathAndNavigationalState(HttpServletRequest request) |
54 |
|
{ |
55 |
0 |
setEncodedNavigationalState(request.getParameter(getNavigationalStateParameterName())); |
56 |
0 |
String path = null; |
57 |
0 |
if (request.getPathInfo() != null) |
58 |
|
{ |
59 |
0 |
path = request.getPathInfo(); |
60 |
0 |
int length = path.length(); |
61 |
0 |
if ( length > 1 && path.endsWith("/") ) |
62 |
|
{ |
63 |
0 |
path = path.substring(0, length-1); |
64 |
|
} |
65 |
|
} |
66 |
0 |
setPath(path); |
67 |
0 |
} |
68 |
|
|
69 |
|
protected String createPortletURL(String encodedNavigationalState, boolean secure) |
70 |
|
{ |
71 |
0 |
StringBuffer buffer = new StringBuffer(getBaseURL(secure)); |
72 |
0 |
buffer.append(getBasePath()); |
73 |
0 |
if ( getPath() != null ) |
74 |
|
{ |
75 |
0 |
buffer.append(getPath()); |
76 |
|
} |
77 |
0 |
if ( encodedNavigationalState != null ) |
78 |
|
{ |
79 |
0 |
buffer.append("?"); |
80 |
0 |
buffer.append(getNavigationalStateParameterName()); |
81 |
0 |
buffer.append("="); |
82 |
0 |
buffer.append(encodedNavigationalState); |
83 |
|
} |
84 |
0 |
return buffer.toString(); |
85 |
|
} |
86 |
|
} |