KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > portlet > DefaultViewSelector


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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: matzew $)
31  * @version $Revision: 1.1 $ $Date: 2005/01/26 17:03:10 $
32  * $Log: DefaultViewSelector.java,v $
33  * Revision 1.1 2005/01/26 17:03:10 matzew
34  * MYFACES-86. portlet support provided by Stan Silver (JBoss Group)
35  *
36  */

37 public interface DefaultViewSelector {
38     
39     /**
40      * This method will be called by the MyFacesGenericPortlet in order to
41      * give the selector an opportunity to store a reference to the
42      * PortletContext.
43      */

44     public void setPortletContext(PortletContext portletContext);
45     
46     /**
47      * This method allows a JSF application to specify which JSF view will be
48      * when the incoming request does not provide a view id.
49      *
50      * @param request The RenderRequest
51      * @param response The RenderResponse
52      * @return a JSF View Id, or <code>null</code> if the selector wishes to
53      * revert to the default View Id specified in portlet.xml.
54      * @throws PortletException if a View Id can not be determined because of
55      * some underlying error.
56      */

57     public String JavaDoc selectViewId(RenderRequest request, RenderResponse response) throws PortletException;
58 }
59
Popular Tags