Java Code Examples for javax.portlet.ActionRequest#setAttribute()

The following examples show how to use javax.portlet.ActionRequest#setAttribute() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EnvironmentTests_PortletPreferences_ApiRender.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
    throws PortletException, IOException {

  portletResp.setRenderParameters(portletReq.getParameterMap());
  long tid = Thread.currentThread().getId();
  portletReq.setAttribute(THREADID_ATTR, tid);

}
 
Example 2
Source File: SigTestsEnv_PortletSession_SIGRender.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
    throws PortletException, IOException {

  portletResp.setRenderParameters(portletReq.getParameterMap());
  long tid = Thread.currentThread().getId();
  portletReq.setAttribute(THREADID_ATTR, tid);

}
 
Example 3
Source File: DispatcherTests4_SPEC2_19_IncludeJSPEvent.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   new StringWriter();

   QName eventQName = new QName(TCKNAMESPACE, "DispatcherTests4_SPEC2_19_IncludeJSPEvent");
   portletResp.setEvent(eventQName, "Hi!");
}
 
Example 4
Source File: DispatcherReqRespTests4_SPEC2_19_IncludeServletActionResponse.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
      throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   // Now do the actual dispatch
   String target = SERVLET_PREFIX + "DispatcherReqRespTests4_SPEC2_19_IncludeServletActionResponse_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING;
   PortletRequestDispatcher rd = portletConfig.getPortletContext()
         .getRequestDispatcher(target);
   rd.include(portletReq, portletResp);
}
 
Example 5
Source File: DispatcherReqRespTests5S_SPEC2_19_IncludeServletRenderResponse.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
      throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

}
 
Example 6
Source File: DispatcherReqRespTests1_SPEC2_19_ForwardJSPResourceRequest.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
      throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

}
 
Example 7
Source File: URLTests_PortletURL_ApiRenderRenurl.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq,
      ActionResponse portletResp) throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

}
 
Example 8
Source File: DispatcherTests2_SPEC2_19_IncludeJSPEvent.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   new StringWriter();

   QName eventQName = new QName(TCKNAMESPACE, "DispatcherTests2_SPEC2_19_IncludeJSPEvent");
   portletResp.setEvent(eventQName, "Hi!");
}
 
Example 9
Source File: WrapperTests_PortletRequestWrapper_ApiRender.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq,
      ActionResponse portletResp) throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

}
 
Example 10
Source File: SigTestsURL_ResourceURL_SIGRender.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
    throws PortletException, IOException {

  portletResp.setRenderParameters(portletReq.getParameterMap());
  long tid = Thread.currentThread().getId();
  portletReq.setAttribute(THREADID_ATTR, tid);

}
 
Example 11
Source File: DispatcherReqRespTests1_SPEC2_19_ForwardJSPEventResponse.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
      throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   QName eventQName = new QName(TCKNAMESPACE,
          "DispatcherReqRespTests1_SPEC2_19_ForwardJSPEventResponse");
   portletResp.setEvent(eventQName, "Hi!");
}
 
Example 12
Source File: AddlEnvironmentTests_SPEC2_18_Sessions.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
    throws PortletException, IOException {

  portletResp.setRenderParameters(portletReq.getParameterMap());
  long tid = Thread.currentThread().getId();
  portletReq.setAttribute(THREADID_ATTR, tid);

}
 
Example 13
Source File: DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
      throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   QName eventQName = new QName(TCKNAMESPACE,
          "DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest");
   portletResp.setEvent(eventQName, "Hi!");
}
 
Example 14
Source File: SigTestsEnv_PortletConfig_SIGRender.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
    throws PortletException, IOException {

  portletResp.setRenderParameters(portletReq.getParameterMap());
  long tid = Thread.currentThread().getId();
  portletReq.setAttribute(THREADID_ATTR, tid);

}
 
Example 15
Source File: DispatcherTests2_SPEC2_19_ForwardJSPAction.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   new StringWriter();

   // Now do the actual dispatch
   String target = JSP_PREFIX + "DispatcherTests2_SPEC2_19_ForwardJSPAction" + JSP_SUFFIX + "?" + QUERY_STRING;
   PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target);
   rd.forward(portletReq, portletResp);
}
 
Example 16
Source File: AddlRequestTests_SPEC2_11_ActionAttr.java    From portals-pluto with Apache License 2.0 4 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
    throws PortletException, IOException {

  portletResp.setRenderParameters(portletReq.getParameterMap());
  long tid = Thread.currentThread().getId();
  portletReq.setAttribute(THREADID_ATTR, tid);

  StringWriter writer = new StringWriter();

  JSR286SpecTestCaseDetails tcd = new JSR286SpecTestCaseDetails();

  // Create result objects for the tests

  /* TestCase: V2AddlRequestTests_SPEC2_11_ActionAttr_attributes1 */
  /* Details: "The portlet can access a map with user information */
  /* attributes via the request attribute PortletRequest.USER_INFO" */
  TestResult tr0 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_ACTIONATTR_ATTRIBUTES1);
  if (portletReq.getAttribute(PortletRequest.USER_INFO) != null) {
    tr0.setTcSuccess(true);
  }
  tr0.writeTo(writer);

  /* TestCase: V2AddlRequestTests_SPEC2_11_ActionAttr_attributes2 */
  /* Details: "The PortletRequest.CCPP_PROFILE request attribute must */
  /* return a javax.ccpp.Profile based on the current portlet request" */
  TestResult tr1 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_ACTIONATTR_ATTRIBUTES2);
  if (portletReq.getAttribute(PortletRequest.CCPP_PROFILE) != null) {
    tr1.setTcSuccess(true);
  }
  tr1.writeTo(writer);

  /* TestCase: V2AddlRequestTests_SPEC2_11_ActionAttr_attributes6 */
  /* Details: "During action processing, the LIFECYCLE_PHASE */
  /* (\"javax.portlet.lifecycle_phase\") attribute will contain the */
  /* string \"ACTION_PHASE\"" */
  TestResult tr2 = tcd.getTestResultFailed(V2ADDLREQUESTTESTS_SPEC2_11_ACTIONATTR_ATTRIBUTES6);
  if (portletReq.getAttribute(PortletRequest.LIFECYCLE_PHASE).equals("ACTION_PHASE")) {
    tr2.setTcSuccess(true);
  }
  tr2.writeTo(writer);

  portletReq.getPortletSession().setAttribute(
      RESULT_ATTR_PREFIX + "AddlRequestTests_SPEC2_11_ActionAttr", writer.toString(),
      APPLICATION_SCOPE);
}
 
Example 17
Source File: DispatcherTests_SPEC2_19_IncludeServletRender.java    From portals-pluto with Apache License 2.0 3 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   new StringWriter();

}
 
Example 18
Source File: DispatcherTests4_SPEC2_19_ForwardServletRender.java    From portals-pluto with Apache License 2.0 3 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   new StringWriter();

}
 
Example 19
Source File: AddlPortletTests_SPEC2_9_WindowStates.java    From portals-pluto with Apache License 2.0 3 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp)
    throws PortletException, IOException {

  portletResp.setRenderParameters(portletReq.getParameterMap());
  long tid = Thread.currentThread().getId();
  portletReq.setAttribute(THREADID_ATTR, tid);


}
 
Example 20
Source File: DispatcherTests4_SPEC2_19_IncludeJSPRender.java    From portals-pluto with Apache License 2.0 3 votes vote down vote up
@Override
public void processAction(ActionRequest portletReq, ActionResponse portletResp) throws PortletException, IOException {

   portletResp.setRenderParameters(portletReq.getParameterMap());
   long tid = Thread.currentThread().getId();
   portletReq.setAttribute(THREADID_ATTR, tid);

   new StringWriter();

}