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.kernel.util.ParamUtil;
18  import com.liferay.portal.model.Portlet;
19  
20  import java.util.Map;
21  
22  import javax.portlet.PortletContext;
23  import javax.portlet.PortletMode;
24  import javax.portlet.PortletPreferences;
25  import javax.portlet.PortletRequest;
26  import javax.portlet.ResourceRequest;
27  import javax.portlet.ResourceURL;
28  import javax.portlet.WindowState;
29  
30  import javax.servlet.http.HttpServletRequest;
31  
32  /**
33   * <a href="ResourceRequestImpl.java.html"><b><i>View Source</i></b></a>
34   *
35   * @author Brian Wing Shun Chan
36   */
37  public class ResourceRequestImpl
38      extends ClientDataRequestImpl implements ResourceRequest {
39  
40      public String getCacheability() {
41          return _cacheablity;
42      }
43  
44      public String getETag() {
45          return null;
46      }
47  
48      public String getLifecycle() {
49          return PortletRequest.RESOURCE_PHASE;
50      }
51  
52      public Map<String, String[]> getPrivateRenderParameterMap() {
53          return null;
54      }
55  
56      public String getResourceID() {
57          return _resourceID;
58      }
59  
60      protected void init(
61          HttpServletRequest request, Portlet portlet,
62          InvokerPortlet invokerPortlet, PortletContext portletContext,
63          WindowState windowState, PortletMode portletMode,
64          PortletPreferences preferences, long plid) {
65  
66          super.init(
67              request, portlet, invokerPortlet, portletContext, windowState,
68              portletMode, preferences, plid);
69  
70          _cacheablity = ParamUtil.getString(
71              request, "p_p_cacheability", ResourceURL.PAGE);
72          _resourceID = request.getParameter("p_p_resource_id");
73      }
74  
75      private String _cacheablity;
76      private String _resourceID;
77  
78  }