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.portal.wsrp;
21  
22  import javax.portlet.PortletMode;
23  import javax.portlet.PortletModeException;
24  import javax.portlet.WindowState;
25  import javax.portlet.WindowStateException;
26  import javax.servlet.http.HttpServletResponse;
27  
28  import oasis.names.tc.wsrp.v1.types.PerformBlockingInteraction;
29  
30  import org.apache.wsrp4j.producer.provider.Provider;
31  
32  import com.liferay.portal.model.Layout;
33  import com.liferay.portal.model.User;
34  import com.liferay.portlet.ActionRequestImpl;
35  import com.liferay.portlet.ActionResponseImpl;
36  import com.liferay.portlet.PortletRequestImpl;
37  import com.liferay.portlet.PortletURLImpl;
38  
39  /**
40   * <a href="WSRPActionResponseImpl.java.html"><b><i>View Source</i></b></a>
41   *
42   * @author Michael Young
43   *
44   */
45  public class WSRPActionResponseImpl extends ActionResponseImpl {
46  
47      public WSRPActionResponseImpl() {
48          super();
49      }
50  
51      public WSRPActionResponseImpl(PerformBlockingInteraction pbo, Provider wsrpProvider,
52              ActionRequestImpl req, HttpServletResponse res, String portletName,
53              User user, Layout layout, WindowState windowState,
54              PortletMode portletMode) throws PortletModeException,
55              WindowStateException {
56          init(req, res, portletName, user, layout, windowState, portletMode);
57          _init(pbo, wsrpProvider, req);
58      }
59  
60      public PortletURLImpl createPortletURLImpl(String portletName, String lifecycle) {
61          return new WSRPPortletURLImpl(_pbo, _wsrpProvider, _req,
62                  portletName, getLayout().getLayoutId(), lifecycle);
63      }
64  
65      private void _init(PerformBlockingInteraction pbo, Provider wsrpProvider, PortletRequestImpl req) {
66          _pbo = pbo;
67          _wsrpProvider = wsrpProvider;
68          _req = req;
69      }
70  
71      private PerformBlockingInteraction _pbo;
72  
73      private Provider _wsrpProvider;
74      
75      private PortletRequestImpl _req;
76  
77  }