1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
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  }