01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.jetspeed.container.state;
18:
19: import javax.portlet.PortletMode;
20: import javax.portlet.WindowState;
21: import javax.servlet.http.HttpServletRequest;
22:
23: import org.apache.jetspeed.container.url.PortalURL;
24:
25: /**
26: * NavigationalState
27: *
28: * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
29: * @version $Id: NavigationalStateComponent.java 516448 2007-03-09 16:25:47Z ate $
30: */
31: public interface NavigationalStateComponent {
32: /**
33: * Creates a navigational state.
34: * Depending on the implementation, a navigational state context can be retrieved from
35: * a persistence store to recover the state of a page such as portlet modes
36: * and window states of portlets on a page.
37: *
38: * @return A new navigational state. This method will never return <code>null</code>
39: * @throws FailedToCreateNavStateException if the nav state could not be created. Under normal
40: * circumstances, this should not happen.
41: */
42: NavigationalState create();
43:
44: /**
45: * Creates a Portal URL representing the URL of the request.
46: *
47: * @param request The ubiqitious request.
48: * @param characterEncoding String containing the name of the chararacter encoding
49: * @return A new Portal URL. This method will never return <code>null</code>;
50: * @throws FailedToCreatePortalUrlException if the portelt url could not be created. Under normal
51: * circumstances, this should not happen.
52: */
53: PortalURL createURL(HttpServletRequest request,
54: String characterEncoding);
55:
56: /**
57: * Given a window state name, look up its object.
58: * Ensures that we always use the same objects for WindowStates
59: * allowing for comparison by value.
60: *
61: * @param name The string representation of the window state.
62: * @return The corresponding WindowState object
63: */
64: WindowState lookupWindowState(String name);
65:
66: /**
67: * Given a portlet mode name, look up its object.
68: * Ensures that we always use the same objects for Portlet Modes
69: * allowing for comparison by value.
70: *
71: * @param name The string representation of the portlet mode.
72: * @return The corresponding PortletMode object
73: */
74: PortletMode lookupPortletMode(String name);
75:
76: /**
77: * Creates a Desktop Portal URL representing the URL of the request.
78: *
79: * @param request The ubiqitious request.
80: * @param characterEncoding String containing the name of the chararacter encoding
81: * @return A new Portal URL. This method will never return <code>null</code>;
82: * @throws FailedToCreatePortalUrlException if the portelt url could not be created. Under normal
83: * circumstances, this should not happen.
84: */
85: PortalURL createDesktopURL(HttpServletRequest request,
86: String characterEncoding);
87: }
|