1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet;
21  
22  import com.liferay.portal.kernel.util.ParamUtil;
23  import com.liferay.portal.model.Portlet;
24  
25  import java.util.Map;
26  
27  import javax.portlet.PortletContext;
28  import javax.portlet.PortletMode;
29  import javax.portlet.PortletPreferences;
30  import javax.portlet.PortletRequest;
31  import javax.portlet.ResourceRequest;
32  import javax.portlet.ResourceURL;
33  import javax.portlet.WindowState;
34  
35  import javax.servlet.http.HttpServletRequest;
36  
37  /**
38   * <a href="ResourceRequestImpl.java.html"><b><i>View Source</i></b></a>
39   *
40   * @author Brian Wing Shun Chan
41   *
42   */
43  public class ResourceRequestImpl
44      extends ClientDataRequestImpl implements ResourceRequest {
45  
46      public String getCacheability() {
47          return _cacheablity;
48      }
49  
50      public String getETag() {
51          return null;
52      }
53  
54      public String getLifecycle() {
55          return PortletRequest.RESOURCE_PHASE;
56      }
57  
58      public Map<String, String[]> getPrivateRenderParameterMap() {
59          return null;
60      }
61  
62      public String getResourceID() {
63          return _resourceID;
64      }
65  
66      protected void init(
67          HttpServletRequest request, Portlet portlet,
68          InvokerPortlet invokerPortlet, PortletContext portletContext,
69          WindowState windowState, PortletMode portletMode,
70          PortletPreferences preferences, long plid) {
71  
72          super.init(
73              request, portlet, invokerPortlet, portletContext, windowState,
74              portletMode, preferences, plid);
75  
76          _cacheablity = ParamUtil.getString(
77              request, "p_p_cacheability", ResourceURL.PAGE);
78          _resourceID = request.getParameter("p_p_resource_id");
79      }
80  
81      private String _cacheablity;
82      private String _resourceID;
83  
84  }