use of javax.portlet.ActionRequest in project liferay-ide by liferay.
the class SayHelloActionCommand method processCommand.
@Override
public boolean processCommand(PortletRequest portletRequest, PortletResponse portletResponse) throws PortletException {
ActionRequest actionRequest = (ActionRequest) portletRequest;
ActionResponse actionResponse = (ActionResponse) portletResponse;
String name = ParamUtil.getString(actionRequest, "name");
actionResponse.setRenderParameter("name", name);
actionResponse.setRenderParameter("mvcPath", "/html/demoactioncommand/view.jsp");
return true;
}
use of javax.portlet.ActionRequest in project uPortal by Jasig.
the class PortletAdministrationHelper method configModeAction.
public boolean configModeAction(ExternalContext externalContext, String fname) throws IOException {
final ActionRequest actionRequest = (ActionRequest) externalContext.getNativeRequest();
final ActionResponse actionResponse = (ActionResponse) externalContext.getNativeResponse();
final IPortletWindowId portletWindowId = this.getDelegateWindowId(externalContext, fname);
if (portletWindowId == null) {
throw new IllegalStateException("Cannot execute configModeAciton without a delegate window ID in the session for key: " + RenderPortletTag.DEFAULT_SESSION_KEY_PREFIX + fname);
}
final PortletDelegationDispatcher requestDispatcher = this.portletDelegationLocator.getRequestDispatcher(actionRequest, portletWindowId);
final DelegationActionResponse delegationResponse = requestDispatcher.doAction(actionRequest, actionResponse);
final String redirectLocation = delegationResponse.getRedirectLocation();
final DelegateState delegateState = delegationResponse.getDelegateState();
if (redirectLocation != null || (delegationResponse.getPortletMode() != null && !IPortletRenderer.CONFIG.equals(delegationResponse.getPortletMode())) || !IPortletRenderer.CONFIG.equals(delegateState.getPortletMode())) {
// The portlet sent a redirect OR changed it's mode away from CONFIG, assume it is done
return true;
}
return false;
}
Aggregations