001
014
015 package com.liferay.portlet;
016
017 import com.liferay.portal.kernel.util.ParamUtil;
018 import com.liferay.portal.kernel.util.Validator;
019 import com.liferay.portal.model.Portlet;
020
021 import java.util.Map;
022
023 import javax.portlet.PortletContext;
024 import javax.portlet.PortletMode;
025 import javax.portlet.PortletPreferences;
026 import javax.portlet.PortletRequest;
027 import javax.portlet.ResourceRequest;
028 import javax.portlet.ResourceURL;
029 import javax.portlet.WindowState;
030
031 import javax.servlet.http.HttpServletRequest;
032
033
036 public class ResourceRequestImpl
037 extends ClientDataRequestImpl implements ResourceRequest {
038
039 public String getCacheability() {
040 return _cacheablity;
041 }
042
043 public String getETag() {
044 return null;
045 }
046
047 public String getLifecycle() {
048 return PortletRequest.RESOURCE_PHASE;
049 }
050
051 public Map<String, String[]> getPrivateRenderParameterMap() {
052 return null;
053 }
054
055 public String getResourceID() {
056 return _resourceID;
057 }
058
059 protected void init(
060 HttpServletRequest request, Portlet portlet,
061 InvokerPortlet invokerPortlet, PortletContext portletContext,
062 WindowState windowState, PortletMode portletMode,
063 PortletPreferences preferences, long plid) {
064
065 if (Validator.isNull(windowState.toString())) {
066 windowState = WindowState.NORMAL;
067 }
068
069 if (Validator.isNull(portletMode.toString())) {
070 portletMode = PortletMode.VIEW;
071 }
072
073 super.init(
074 request, portlet, invokerPortlet, portletContext, windowState,
075 portletMode, preferences, plid);
076
077 _cacheablity = ParamUtil.getString(
078 request, "p_p_cacheability", ResourceURL.PAGE);
079 _resourceID = request.getParameter("p_p_resource_id");
080 }
081
082 private String _cacheablity;
083 private String _resourceID;
084
085 }