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 | public class AdminPortlet extends GenericPortlet { |
28 | |
29 | private static final String VIEW_PAGE = "/WEB-INF/fragments/admin/view.jsp"; |
30 | private static final String EDIT_PAGE = "/WEB-INF/fragments/admin/edit.jsp"; |
31 | private static final String HELP_PAGE = "/WEB-INF/fragments/admin/help.jsp"; |
32 | |
33 | // GenericPortlet Impl ----------------------------------------------------- |
34 | |
35 | public void doView(RenderRequest request, RenderResponse response) |
36 | throws PortletException, IOException { |
37 | PortletContext context = getPortletContext(); |
38 | PortletRequestDispatcher requestDispatcher = |
39 | context.getRequestDispatcher(VIEW_PAGE); |
40 | requestDispatcher.include(request, response); |
41 | } |
42 | |
43 | protected void doEdit(RenderRequest request, RenderResponse response) |
44 | throws PortletException, IOException { |
45 | PortletContext context = getPortletContext(); |
46 | PortletRequestDispatcher requestDispatcher = |
47 | context.getRequestDispatcher(EDIT_PAGE); |
48 | requestDispatcher.include(request, response); |
49 | } |
50 | |
51 | protected void doHelp(RenderRequest request, RenderResponse response) |
52 | throws PortletException, IOException { |
53 | PortletContext context = getPortletContext(); |
54 | PortletRequestDispatcher requestDispatcher = |
55 | context.getRequestDispatcher(HELP_PAGE); |
56 | requestDispatcher.include(request, response); |
57 | } |
58 | |
59 | } |