Package javax.portlet

Examples of javax.portlet.EventRequest


     */
    @Test
    public void testEventPortletRequest() throws NoSuchFieldException, IllegalAccessException {
        ApplicationContext applicationContext = createMock(ApplicationContext.class);
        PortletContext portletContext = createMock(PortletContext.class);
        EventRequest request = createMock(EventRequest.class);
        EventResponse response = createMock(EventResponse.class);

        replay(applicationContext, portletContext, request, response);
        EventPortletRequest req = new EventPortletRequest(applicationContext,
                portletContext, request, response);
View Full Code Here


        PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
        PortletInvokerService invoker = getContainerServices().getPortletInvokerService();

        PortletRequestContext requestContext = rcService.getPortletEventRequestContext(this, request, response, portletWindow);
        PortletEventResponseContext responseContext = rcService.getPortletEventResponseContext(this, request, response, portletWindow);
        EventRequest portletRequest = envService.createEventRequest(requestContext, responseContext, event);
        EventResponse portletResponse = envService.createEventResponse(responseContext);

        FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.EVENT_PHASE);

        List<Event> events = null;
View Full Code Here

    public void testProcessEvent() throws Exception
    {
        assertTrue(scriptPortlet instanceof EventPortlet);
       
        Map<String, String> values = new HashMap<String, String>();
        EventRequest request = createNiceMock(EventRequest.class);
        EventResponse response = createNiceMock(EventResponse.class);
       
        Event event = createNiceMock(Event.class);
        QName qname = new QName("unknown");
       
        expect(event.getQName()).andReturn(qname);
        expect(request.getEvent()).andReturn(event);
        expect(request.getAttribute("values")).andReturn(values);
       
        replay(event);
        replay(request);
        replay(response);
       
View Full Code Here

    private String name;

    public String execute() throws Exception {

        if (request instanceof EventRequest) {
            EventRequest req = (EventRequest) request;
            EventResponse res = (EventResponse) response;
            res.setRenderParameter("eventName", (String) req.getEvent().getValue());
            return "forward";
        } else {
            name = request.getParameter("eventName");
        }
View Full Code Here

        PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
        PortletInvokerService invoker = getContainerServices().getPortletInvokerService();

        PortletRequestContext requestContext = rcService.getPortletEventRequestContext(this, request, response, portletWindow);
        PortletEventResponseContext responseContext = rcService.getPortletEventResponseContext(this, request, response, portletWindow);
        EventRequest portletRequest = envService.createEventRequest(requestContext, responseContext, event);
        EventResponse portletResponse = envService.createEventResponse(responseContext);

        FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.EVENT_PHASE);

        List<Event> events = null;
View Full Code Here

            }

            // The request methode is Event: call Portlet.processEvent(..)
            else if (methodId == PortletInvokerService.METHOD_EVENT)
            {
                EventRequest eventRequest = (EventRequest) portletRequest;
                EventResponse eventResponse = (EventResponse) portletResponse;
                filterManager.processFilter(eventRequest, eventResponse,
                        eventPortlet, portletContext);
            }
            // The requested method is ADMIN: call handlers.
View Full Code Here

   {
      RenderRequest rreq = getRenderRequest();
      RenderResponse rresp = getRenderResponse();
      ActionRequest areq = getActionRequest();
      ActionResponse aresp = getActionResponse();
      EventRequest ereq = getEventRequest();
      EventResponse eresp = getEventResponse();
      ResourceRequest rsreq = getResourceRequest();
      ResourceResponse rsresp = getResourceResponse();
      PortletConfig portletConfig = getConfig();
      PortletSession portletSession = getSession();
View Full Code Here

      }

      //Event only
      if (actionCount == 1 && eventCount == 1)
      {
         EventRequest eventRequest = (EventRequest)portletRequest;

         //SPEC:249
         request.setCharacterEncoding("utf8");
         assertNull(request.getCharacterEncoding());
         assertNull(request.getContentType());
         assertNull(request.getInputStream());
         assertNull(request.getReader());

         //SPEC:250
         assertEquals(0, request.getContentLength());

         //SPEC:251
         assertEquals(eventRequest.getMethod(), request.getMethod());
      }

      //SPEC:252
      assertEquals(portletRequest.getProperty("myheader"), request.getHeader("myheader"));
      List rheaders = Collections.list(request.getHeaders("myheader"));
View Full Code Here

      }

      //Event only
      if (actionCount == 1 && eventCount == 1)
      {
         EventRequest eventRequest = (EventRequest)portletRequest;

         //SPEC:191
         request.setCharacterEncoding("utf8");
         assertNull(request.getCharacterEncoding());
         assertNull(request.getContentType());
         assertNull(request.getInputStream());
         assertNull(request.getReader());

         //SPEC:192
         assertEquals(0, request.getContentLength());

         //SPEC:193
         assertEquals(eventRequest.getMethod(), request.getMethod());
      }

      //SPEC:194
      assertEquals(portletRequest.getProperty("myheader"), request.getHeader("myheader"));
      List rheaders = Collections.list(request.getHeaders("myheader"));
View Full Code Here

                    portletInstance.render(renderRequest, renderResponse);
                }
            }
            else if (PortletWindow.Action.EVENT.equals(window.getAction()))
            {
                EventRequest eventRequest = (EventRequest)window.getPortletRequest();
                EventResponse eventResponse =  (EventResponse)window.getPortletResponse();
               
                if (filterManager != null)
                {
                    filterManager.processFilter(eventRequest, eventResponse, portletInstance, portletConfig.getPortletContext());
View Full Code Here

TOP

Related Classes of javax.portlet.EventRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.