01: /*
02: * ==============================================================================
03: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
04: * use this file except in compliance with the License. You may obtain a copy of
05: * the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * Unless required by applicable law or agreed to in writing, software
10: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12: * License for the specific language governing permissions and limitations under
13: * the License.
14: */
15: package wicket.protocol.http.portlet;
16:
17: import org.apache.commons.logging.Log;
18: import org.apache.commons.logging.LogFactory;
19:
20: import wicket.RequestCycle;
21: import wicket.request.compound.IResponseStrategy;
22:
23: /**
24: * @author Janne Hietamäki
25: *
26: * IResponseStrategy which do not really render the page, but sets the needed
27: * parameters as portlet render parameters
28: */
29: public class PortletActionRequestResponseStrategy implements
30: IResponseStrategy {
31:
32: /** Logging object */
33: private static final Log log = LogFactory
34: .getLog(PortletActionRequestResponseStrategy.class);
35:
36: /*
37: * @see wicket.request.compound.IResponseStrategy#respond(wicket.RequestCycle)
38: */
39: public void respond(RequestCycle requestCycle) {
40: PortletRequestCodingStrategy strategy = (PortletRequestCodingStrategy) requestCycle
41: .getProcessor().getRequestCodingStrategy();
42: strategy.setRenderParameters(
43: (PortletRequestCycle) requestCycle, requestCycle
44: .getRequestTarget());
45: }
46:
47: }
|