1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet;
16  
17  import com.liferay.portal.model.Portlet;
18  
19  import javax.portlet.PortletContext;
20  import javax.portlet.PortletMode;
21  import javax.portlet.PortletPreferences;
22  import javax.portlet.WindowState;
23  
24  import javax.servlet.http.HttpServletRequest;
25  
26  /**
27   * <a href="RenderRequestFactory.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Brian Wing Shun Chan
30   */
31  public class RenderRequestFactory {
32  
33      public static RenderRequestImpl create(
34              HttpServletRequest request, Portlet portlet,
35              InvokerPortlet invokerPortlet, PortletContext portletContext,
36              WindowState windowState, PortletMode portletMode,
37              PortletPreferences preferences)
38          throws Exception {
39  
40          return create(
41              request, portlet, invokerPortlet, portletContext, windowState,
42              portletMode, preferences, 0);
43      }
44  
45      public static RenderRequestImpl create(
46              HttpServletRequest request, Portlet portlet,
47              InvokerPortlet invokerPortlet, PortletContext portletContext,
48              WindowState windowState, PortletMode portletMode,
49              PortletPreferences preferences, long plid)
50          throws Exception {
51  
52          RenderRequestImpl renderRequestImpl = new RenderRequestImpl();
53  
54          renderRequestImpl.init(
55              request, portlet, invokerPortlet, portletContext, windowState,
56              portletMode, preferences, plid);
57  
58          return renderRequestImpl;
59      }
60  
61  }