View Javadoc

1   /*
2    * Copyright 2000-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.portals.bridges.php;
17  
18  import javax.portlet.GenericPortlet;
19  import javax.portlet.PortletRequest;
20  import javax.portlet.PortletResponse;
21  import javax.servlet.ServletContext;
22  import javax.servlet.http.HttpServletRequest;
23  import javax.servlet.http.HttpServletRequestWrapper;
24  import javax.servlet.http.HttpServletResponse;
25  import javax.servlet.http.HttpServletResponseWrapper;
26  import  org.apache.portals.bridges.common.ServletContextProvider;
27  //import org.apache.jetspeed.container.JetspeedPortletContext;
28  
29  
30  /***
31   * PHPServletContextProviderImpl supplies a PHPPortlet access to the
32   * Servlet context of a Jetspeed Portlet.
33   * @author <a href="mailto:rogerrut@apache.org">Roger Ruttimann</a>
34   * @version $Id: PHPServletContextProviderImpl.java 187920 2004-11-11 02:17:56 +0100 (Thu, 11 Nov 2004) rogerrut $
35   */
36  public class PHPServletContextProviderImpl implements ServletContextProvider 
37  {
38      public ServletContext getServletContext(GenericPortlet portlet) 
39      {
40      	// Not needed any more since the PHP is decoupled from Jetspeed
41          return null; 
42      }
43  
44      public HttpServletRequest getHttpServletRequest(GenericPortlet portlet, PortletRequest request) 
45      {
46          return (HttpServletRequest) ((HttpServletRequestWrapper) request).getRequest();
47      }
48  
49      public HttpServletResponse getHttpServletResponse(GenericPortlet portlet, PortletResponse response) 
50      {
51          return (HttpServletResponse) ((HttpServletResponseWrapper) response).getResponse();
52      }
53  }