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 | package org.apache.pluto.driver.portlets; |
17 | |
18 | import java.io.IOException; |
19 | |
20 | import javax.portlet.GenericPortlet; |
21 | import javax.portlet.PortletContext; |
22 | import javax.portlet.PortletException; |
23 | import javax.portlet.PortletRequestDispatcher; |
24 | import javax.portlet.RenderRequest; |
25 | import javax.portlet.RenderResponse; |
26 | |
27 | /** |
28 | * The pluto portal driver about portlet. |
29 | * @author <a href="mailto:zheng@apache.org">ZHENG Zhong</a> |
30 | * @since 2006-02-09 |
31 | */ |
32 | public class AboutPortlet extends GenericPortlet { |
33 | |
34 | private static final String VIEW_PAGE = "/WEB-INF/fragments/about/view.jsp"; |
35 | private static final String EDIT_PAGE = "/WEB-INF/fragments/about/edit.jsp"; |
36 | private static final String HELP_PAGE = "/WEB-INF/fragments/about/help.jsp"; |
37 | |
38 | // GenericPortlet Impl ----------------------------------------------------- |
39 | |
40 | public void doView(RenderRequest request, RenderResponse response) |
41 | throws PortletException, IOException { |
42 | PortletContext context = getPortletContext(); |
43 | PortletRequestDispatcher requestDispatcher = |
44 | context.getRequestDispatcher(VIEW_PAGE); |
45 | requestDispatcher.include(request, response); |
46 | } |
47 | |
48 | protected void doEdit(RenderRequest request, RenderResponse response) |
49 | throws PortletException, IOException { |
50 | PortletContext context = getPortletContext(); |
51 | PortletRequestDispatcher requestDispatcher = |
52 | context.getRequestDispatcher(EDIT_PAGE); |
53 | requestDispatcher.include(request, response); |
54 | } |
55 | |
56 | protected void doHelp(RenderRequest request, RenderResponse response) |
57 | throws PortletException, IOException { |
58 | PortletContext context = getPortletContext(); |
59 | PortletRequestDispatcher requestDispatcher = |
60 | context.getRequestDispatcher(HELP_PAGE); |
61 | requestDispatcher.include(request, response); |
62 | } |
63 | |
64 | |
65 | } |