Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DefaultViewSelector |
|
| 1.0;1 |
1 | /* | |
2 | * Licensed to the Apache Software Foundation (ASF) under one | |
3 | * or more contributor license agreements. See the NOTICE file | |
4 | * distributed with this work for additional information | |
5 | * regarding copyright ownership. The ASF licenses this file | |
6 | * to you under the Apache License, Version 2.0 (the | |
7 | * "License"); you may not use this file except in compliance | |
8 | * with the License. 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, | |
13 | * software distributed under the License is distributed on an | |
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
15 | * KIND, either express or implied. See the License for the | |
16 | * specific language governing permissions and limitations | |
17 | * under the License. | |
18 | */ | |
19 | package org.apache.myfaces.portlet; | |
20 | ||
21 | import javax.portlet.PortletContext; | |
22 | import javax.portlet.PortletException; | |
23 | import javax.portlet.RenderRequest; | |
24 | import javax.portlet.RenderResponse; | |
25 | ||
26 | /** | |
27 | * Imlementations of this interface allow a JSF application to specify which | |
28 | * JSF view will be selected when the incoming request does not provide a View | |
29 | * Id. The implementation can optionally return <code>null</code> to revert to | |
30 | * the default View Id specified in portlet.xml. | |
31 | * | |
32 | * @author Stan Silvert (latest modification by $Author: skitching $) | |
33 | * @version $Revision: 684465 $ $Date: 2008-08-10 06:38:21 -0500 (Sun, 10 Aug 2008) $ | |
34 | */ | |
35 | public interface DefaultViewSelector { | |
36 | ||
37 | /** | |
38 | * This method will be called by the MyFacesGenericPortlet in order to | |
39 | * give the selector an opportunity to store a reference to the | |
40 | * PortletContext. | |
41 | */ | |
42 | public void setPortletContext(PortletContext portletContext); | |
43 | ||
44 | /** | |
45 | * This method allows a JSF application to specify which JSF view will be | |
46 | * when the incoming request does not provide a view id. | |
47 | * | |
48 | * @param request The RenderRequest | |
49 | * @param response The RenderResponse | |
50 | * @return a JSF View Id, or <code>null</code> if the selector wishes to | |
51 | * revert to the default View Id specified in portlet.xml. | |
52 | * @throws PortletException if a View Id can not be determined because of | |
53 | * some underlying error. | |
54 | */ | |
55 | public String selectViewId(RenderRequest request, RenderResponse response) throws PortletException; | |
56 | } |