Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
RestoreViewSupport |
|
| 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.lifecycle; | |
20 | ||
21 | import javax.faces.FacesException; | |
22 | import javax.faces.component.UIComponent; | |
23 | import javax.faces.context.ExternalContext; | |
24 | import javax.faces.context.FacesContext; | |
25 | ||
26 | /** | |
27 | * Support class for restore view phase | |
28 | * | |
29 | * @author Mathias Broekelmann (latest modification by $Author: mbr $) | |
30 | * @version $Revision: 517403 $ $Date: 2007-03-12 16:17:00 -0500 (Mon, 12 Mar 2007) $ | |
31 | */ | |
32 | public interface RestoreViewSupport | |
33 | { | |
34 | /** | |
35 | * <p> | |
36 | * Calculates the view id from the given faces context by the following algorithm | |
37 | * </p> | |
38 | * <ul> | |
39 | * <li>lookup the viewid from the request attribute "javax.servlet.include.path_info" | |
40 | * <li>if null lookup the value for viewid by {@link ExternalContext#getRequestPathInfo()} | |
41 | * <li>if null lookup the value for viewid from the request attribute "javax.servlet.include.servlet_path" | |
42 | * <li>if null lookup the value for viewid by {@link ExternalContext#getRequestServletPath()} | |
43 | * <li>if null throw a {@link FacesException} | |
44 | * </ul> | |
45 | */ | |
46 | String calculateViewId(FacesContext facesContext); | |
47 | ||
48 | /** | |
49 | * Processes the component tree. For each component (including the given one) in the tree determine if a value | |
50 | * expression for the attribute "binding" is defined. If the expression is not null set the component instance to | |
51 | * the value of this expression | |
52 | * | |
53 | * @param facesContext | |
54 | * @param component | |
55 | * the root component | |
56 | */ | |
57 | void processComponentBinding(FacesContext facesContext, UIComponent component); | |
58 | ||
59 | /** | |
60 | * <p> | |
61 | * Determine if the current request is a post back by the following algorithm. | |
62 | * </p> | |
63 | * <p> | |
64 | * Find the render-kit-id for the current request by calling calculateRenderKitId() on the Application’s | |
65 | * ViewHandler. Get that RenderKit’s ResponseStateManager and call its isPostback() method, passing the given | |
66 | * FacesContext. | |
67 | * </p> | |
68 | * | |
69 | * @param facesContext | |
70 | * @return | |
71 | */ | |
72 | boolean isPostback(FacesContext facesContext); | |
73 | } |