01: /*
02: * Copyright 2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.myfaces.portlet;
18:
19: import javax.portlet.PortletContext;
20: import javax.portlet.PortletException;
21: import javax.portlet.RenderRequest;
22: import javax.portlet.RenderResponse;
23:
24: /**
25: * Imlementations of this interface allow a JSF application to specify which
26: * JSF view will be selected when the incoming request does not provide a View
27: * Id. The implementation can optionally return <code>null</code> to revert to
28: * the default View Id specified in portlet.xml.
29: *
30: * @author Stan Silvert (latest modification by $Author: grantsmith $)
31: * @version $Revision: 169655 $ $Date: 2005-05-11 18:45:06 +0200 (Mi, 11 Mai 2005) $
32: */
33: public interface DefaultViewSelector {
34:
35: /**
36: * This method will be called by the MyFacesGenericPortlet in order to
37: * give the selector an opportunity to store a reference to the
38: * PortletContext.
39: */
40: public void setPortletContext(PortletContext portletContext);
41:
42: /**
43: * This method allows a JSF application to specify which JSF view will be
44: * when the incoming request does not provide a view id.
45: *
46: * @param request The RenderRequest
47: * @param response The RenderResponse
48: * @return a JSF View Id, or <code>null</code> if the selector wishes to
49: * revert to the default View Id specified in portlet.xml.
50: * @throws PortletException if a View Id can not be determined because of
51: * some underlying error.
52: */
53: public String selectViewId(RenderRequest request,
54: RenderResponse response) throws PortletException;
55: }
|