private String determineDefaultPhase(Method handlerMethod) { if (void.class != handlerMethod.getReturnType()) { return PortletRequest.RENDER_PHASE; } for (Class<?> argType : handlerMethod.getParameterTypes()) { if (ActionRequest.class.isAssignableFrom(argType) || ActionResponse.class.isAssignableFrom(argType) || InputStream.class.isAssignableFrom(argType) || Reader.class.isAssignableFrom(argType)) { return PortletRequest.ACTION_PHASE; } else if (RenderRequest.class.isAssignableFrom(argType) || RenderResponse.class.isAssignableFrom(argType) || OutputStream.class.isAssignableFrom(argType) || Writer.class.isAssignableFrom(argType)) { return PortletRequest.RENDER_PHASE; } else if (ResourceRequest.class.isAssignableFrom(argType) || ResourceResponse.class.isAssignableFrom(argType)) { return PortletRequest.RESOURCE_PHASE; } else if (EventRequest.class.isAssignableFrom(argType) || EventResponse.class.isAssignableFrom(argType)) { return PortletRequest.EVENT_PHASE; } } return ""; }
/** * Trigger afterCompletion callbacks on the mapped HandlerInterceptors. * Will just invoke afterCompletion for all interceptors whose preHandle * invocation has successfully completed and returned true. * @param mappedHandler the mapped HandlerExecutionChain * @param interceptorIndex index of last interceptor that successfully completed * @param ex Exception thrown on handler execution, or null if none * @see HandlerInterceptor#afterRenderCompletion */ private void triggerAfterEventCompletion(HandlerExecutionChain mappedHandler, int interceptorIndex, EventRequest request, EventResponse response, Exception ex) throws Exception { // Apply afterCompletion methods of registered interceptors. if (mappedHandler != null) { HandlerInterceptor[] interceptors = mappedHandler.getInterceptors(); if (interceptors != null) { for (int i = interceptorIndex; i >= 0; i--) { HandlerInterceptor interceptor = interceptors[i]; try { interceptor.afterEventCompletion(request, response, mappedHandler.getHandler(), ex); } catch (Throwable ex2) { logger.error("HandlerInterceptor.afterCompletion threw exception", ex2); } } } } }
private String determineDefaultPhase(Method handlerMethod) { if (!void.class.equals(handlerMethod.getReturnType())) { return PortletRequest.RENDER_PHASE; } for (Class<?> argType : handlerMethod.getParameterTypes()) { if (ActionRequest.class.isAssignableFrom(argType) || ActionResponse.class.isAssignableFrom(argType) || InputStream.class.isAssignableFrom(argType) || Reader.class.isAssignableFrom(argType)) { return PortletRequest.ACTION_PHASE; } else if (RenderRequest.class.isAssignableFrom(argType) || RenderResponse.class.isAssignableFrom(argType) || OutputStream.class.isAssignableFrom(argType) || Writer.class.isAssignableFrom(argType)) { return PortletRequest.RENDER_PHASE; } else if (ResourceRequest.class.isAssignableFrom(argType) || ResourceResponse.class.isAssignableFrom(argType)) { return PortletRequest.RESOURCE_PHASE; } else if (EventRequest.class.isAssignableFrom(argType) || EventResponse.class.isAssignableFrom(argType)) { return PortletRequest.EVENT_PHASE; } } return ""; }
public TestResult checkExpectedEventWasFired(EventRequest request, EventResponse response) { tally(response); TestResult result = new TestResult(); result.setSpecPLT("15.2.2"); result.setDescription("Check to make sure the the " + COMPLEX_PAYLOAD_EVENT + " event was fired."); if (COMPLEX_PAYLOAD_EVENT.equals(request.getEvent().getName())) { result.setReturnCode(TestResult.PASSED); } else { result.setReturnCode(TestResult.FAILED); result.setResultMessage("Expected event name to be '" + COMPLEX_PAYLOAD_EVENT + "' but it was actually '" + request.getEvent().getName().getClass().getName() + "'"); } return result; }
public TestResult checkEventPayloadIsCorrectClass(EventRequest request, EventResponse response) { tally(response); TestResult result = new TestResult(); result.setSpecPLT("15.2.2"); result.setDescription("Check to make sure that payload is an instance" + "of " + ComposedObject.class); Object value = request.getEvent().getValue(); if (value == null) { result.setReturnCode(TestResult.FAILED); result.setResultMessage("Expected event payload type to be '" + ComposedObject.class.getName() + "' but it was null."); } else if (value instanceof ComposedObject) { result.setReturnCode(TestResult.PASSED); } else { result.setReturnCode(TestResult.FAILED); result.setResultMessage("Expected event payload type to be '" + ComposedObject.class.getName() + "' but it was actually '" + request.getEvent().getValue() + "'"); } return result; }
public TestResult checkEventPayloadIsCorrect(EventRequest request, EventResponse response) { tally(response); TestResult result = new TestResult(); result.setSpecPLT("15.2.2"); result.setDescription( "Check to make sure that the payload carries the " + "proper state information from the event."); ComposedObject value = (ComposedObject) request.getEvent().getValue(); if (!TEST_COLOR.equals(value.getColor())) { result.setReturnCode(TestResult.FAILED); result.setResultMessage("Expected payload color to be " + TEST_COLOR + " but it was " + value.getColor()); } else if (!TEST_POINT.equals(value.getPoint())) { result.setReturnCode(TestResult.FAILED); result.setResultMessage("Expected payload point to be " + TEST_POINT + " but it was " + value.getPoint()); } else { result.setReturnCode(TestResult.PASSED); } return result; }
public TestResult checkExpectedEventWasFired(EventRequest request, EventResponse response) { tally(response); TestResult result = new TestResult(); result.setSpecPLT("15.2.2"); result.setDescription("Check to make sure the the " + SIMPLE_PAYLOAD_EVENT + " event was fired."); Event event = request.getEvent(); if (event == null) { throw new NullPointerException("No event was received!"); } if (SIMPLE_PAYLOAD_EVENT.equals(event.getName())) { result.setReturnCode(TestResult.PASSED); } else { result.setReturnCode(TestResult.FAILED); result.setResultMessage("Expected event name to be '" + SIMPLE_PAYLOAD_EVENT + "' but it was actually '" + event.getName() + "'"); } return result; }
public TestResult checkEventPayloadIsCorrectClass(EventRequest request, EventResponse response) { tally(response); TestResult result = new TestResult(); result.setSpecPLT("15.2.2"); result.setDescription("Check to make sure that payload is an instance" + "of " + String.class); Event event = request.getEvent(); if (event == null) { throw new NullPointerException("No event received!"); } Object value = event.getValue(); if (value == null) { result.setReturnCode(TestResult.FAILED); result.setResultMessage("Expected event payload type to be '" + String.class.getName() + "' but it was null."); } else if (value instanceof String) { result.setReturnCode(TestResult.PASSED); } else { result.setReturnCode(TestResult.FAILED); result.setResultMessage("Expected event payload type to be '" + String.class.getName() + "' but it was actually '" + value.getClass().getName() + "'"); } return result; }
public TestResult checkEventPayloadIsCorrect(EventRequest request, EventResponse response) { tally(response); TestResult result = new TestResult(); result.setSpecPLT("15.2.2"); result.setDescription( "Check to make sure that the payload carries the " + "proper state information from the event."); String value = (String) request.getEvent().getValue(); if (!SIMPLE_VALUE_PAYLOAD.equals(value)) { result.setReturnCode(TestResult.FAILED); result.setResultMessage("Expected payload color to be " + SIMPLE_VALUE_PAYLOAD + " but it was " + value); } else { result.setReturnCode(TestResult.PASSED); } return result; }
@ProcessEvent(name = SimplePayloadEventTest.SIMPLE_PAYLOAD_EVENT) public void processSimplePayload(EventRequest request, EventResponse response) throws PortletException, IOException { StringBuilder feedback = new StringBuilder(); feedback.append("Simple Payload Event received."); if (!SimplePayloadEventTest.SIMPLE_VALUE_PAYLOAD.equals( request.getEvent().getValue())) { feedback.append(" Payload DID NOT match expected value."); } else { feedback.append(" Payload matched expected value."); } response.setRenderParameter(EVENT_INFO_PARAM, feedback.toString()); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Now do the actual dispatch String target = JSP_PREFIX + "PortletTagLibraryTests_SPEC2_26_IncludeJSPEvent" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "include"); String targ = SERVLET_PREFIX + "DispatcherTests6_SPEC2_19_FwdThenIncludeServletEvent_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = "/IncluderForwarderServlet" + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@EventMethod( portletName = "AnnotationPortletConfigTests_SPEC2_28_EventDeclaration", processingEvents = @PortletQName( localPart = "AnnotationPortletConfigTests_SPEC2_28_EventDeclaration_a", namespaceURI = "http://www.apache.org/portals/pluto/portlet-tck_3.0" ), publishingEvents = { @PortletQName( localPart = "AnnotationPortletConfigTests_SPEC2_28_EventDeclaration_b", namespaceURI = "http://www.apache.org/portals/pluto/portlet-tck_3.0" ) } ) public void processEvent_a(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { QName eventQName = new QName( "http://www.apache.org/portals/pluto/portlet-tck_3.0", "AnnotationPortletConfigTests_SPEC2_28_EventDeclaration_b"); portletResp.setEvent(eventQName, "Hi!"); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); TckParameters params = (TckParameters) portletReq.getEvent().getValue(); for (Parameter p : params.getParams()) { portletResp.setRenderParameter(p.getName(), p.getVals()); } // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherTests_SPEC2_19_IncludeServletEvent_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@EventMethod( portletName = "AnnotationPortletAppConfigOverrideTests_SPEC1_28_EventConfiguration2", processingEvents = @PortletQName( localPart = "AnnotationPortletAppConfigOverrideTests_SPEC1_28_EventConfiguration2a", namespaceURI = "http://www.apache.org/portals/pluto/portlet-tck_3.0" ) ) public void processEventa(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { Event e = portletReq.getEvent(); String eventPayload = (String) e.getValue(); if(eventPayload!=null && eventPayload.equals("a")){ MutableRenderParameters mutableRenderParameters = portletResp.getRenderParameters(); mutableRenderParameters.setValue("tr0_a", "true"); } }
@EventMethod( portletName = "AnnotationPortletAppConfigOverrideTests_SPEC1_28_PublicRenderParameters3", processingEvents = @PortletQName( localPart = "AnnotationPortletAppConfigOverrideTests_SPEC1_28_PublicRenderParameters2", namespaceURI = "http://www.apache.org/portals/pluto/portlet-tck_3.0" ) ) public void processEventb(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { Event e = portletReq.getEvent(); String eventPayload = (String) e.getValue(); if(eventPayload!=null && eventPayload.equals("Hi!")){ MutableRenderParameters mutableRenderParameters = portletResp.getRenderParameters(); mutableRenderParameters.setValue("tr2_public", "true"); } }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherReqRespTests4_SPEC2_19_IncludeServletEventResponse_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherReqRespTests4_SPEC2_19_IncludeServletEventRequest_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@ProcessEvent(name = "AnnotationTests_ProcessEvent_ApiEvent2") public void nameEvnt(EventRequest req, EventResponse resp) throws PortletException, IOException { StringWriter writer = new StringWriter(); JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails(); /* TestCase: V2AnnotationTests_ProcessEvent_ApiEvent_name */ /* Details: "Method name(): On an event request, the method is */ /* executed if the Event name matches the name field" */ TestResult tr1 = tcd.getTestResultFailed(V2ANNOTATIONTESTS_PROCESSEVENT_APIEVENT_NAME); tr1.setTcSuccess(true); tr1.writeTo(writer); req.getPortletSession().setAttribute( Constants.RESULT_ATTR_PREFIX + "AnnotationTests_ProcessEvent_ApiEvent", writer.toString(), APPLICATION_SCOPE); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Prereq for: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventRequest_getAttribute portletReq.setAttribute(ATTR_PREFIX +"V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventRequest_getAttribute", "Value1"); // Prereq for: V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventRequest_getAttributeNames portletReq.setAttribute(ATTR_PREFIX + "V2DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventRequest_getAttributeNames", "Value1"); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventRequest" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherReqRespTests3_SPEC2_19_IncludeJSPEventResponse" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Multilevel forward / include portletReq.setAttribute(ATTR_DISPATCH_ACTION, "forward"); String targ = SERVLET_PREFIX + "DispatcherTests5_SPEC2_19_IncThenForwardServletEvent_servlet" + EXTRA_PATH + "?" + QUERY_STRING; portletReq.setAttribute(ATTR_DISPATCH_TARGET, targ); // Now do the actual dispatch String target = SERVLET_INCFWD + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.include(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Prereq for: V2DispatcherTests4_SPEC2_19_ForwardJSPEvent_invoke3 portletReq = new EventRequestWrapper(portletReq); portletResp = new EventResponseWrapper(portletResp); // Now do the actual dispatch String target = JSP_PREFIX + "DispatcherTests4_SPEC2_19_ForwardJSPEvent" + JSP_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); new StringWriter(); // Prereq for: V2DispatcherTests4_SPEC2_19_ForwardServletEvent_invoke3 portletReq = new EventRequestWrapper(portletReq); portletResp = new EventResponseWrapper(portletResp); // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherTests4_SPEC2_19_ForwardServletEvent_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext().getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@EventMethod(portletName = "PortletHubTests_SPEC_23_JSAction", processingEvents = { @PortletQName(namespaceURI="http://www.apache.org/", localPart="event") }) public void doEvent(EventRequest eventReq, EventResponse eventResp) { MutableRenderParameters mrp = eventResp.getRenderParameters(); String testcase = mrp.getValue("testcase"); if (testcase == null || testcase.isEmpty()) { mrp.setValue("status", "Failed. No test case parameter present."); } else if (testcase.equals(V3PORTLETHUBTESTS_SPEC_23_JSACTION_ACTION6)) { mrp.setValue("status", "OK"); } else { mrp.setValue("status", "Failed. Unknown test case: " + testcase); } }
@ProcessEvent(name = "AddlPortletTests_SPEC2_5_RenderGenericPortlet_localPart") public void processEvent(EventRequest portletReq, EventResponse response) throws PortletException, IOException { JSR286SpecTestCaseDetails tcd = new JSR286SpecTestCaseDetails(); /* * TestCase: * V2AddlPortletTests_SPEC2_5_RenderGenericPortlet_eventDispatching2 */ /* Details: "The GenericPortlet processEvent method will dispatch the */ /* request to a subclass method annotated with the tag */ /* @ProcessEvent(name=<event_name_local_part>)" */ TestResult tr2 = tcd.getTestResultFailed( V2ADDLPORTLETTESTS_SPEC2_5_RENDERGENERICPORTLET_EVENTDISPATCHING2); tr2.setTcSuccess(true); portletReq.getPortletSession().setAttribute( RESULT_ATTR_PREFIX + "AddlPortletTests_SPEC2_5_RenderGenericPortlet_event_b", tr2.toString(), APPLICATION_SCOPE); }
@Override public void processEvent(EventRequest portletReq, EventResponse portletResp) throws PortletException, IOException { portletResp.setRenderParameters(portletReq); long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); // Now do the actual dispatch String target = SERVLET_PREFIX + "DispatcherReqRespTests2_SPEC2_19_ForwardServletEventResponse_servlet" + SERVLET_SUFFIX + "?" + QUERY_STRING; PortletRequestDispatcher rd = portletConfig.getPortletContext() .getRequestDispatcher(target); rd.forward(portletReq, portletResp); }
@Override public void handleEvent(EventRequest request, EventResponse response, Object handler) throws Exception { Object returnValue = doHandle(request, response, handler); if (returnValue != null) { throw new IllegalStateException("Invalid event method return value: " + returnValue); } }
@Override public void handleEventRequest( EventRequest request, EventResponse response) throws Exception { if (!(this.portletInstance instanceof EventPortlet)) { logger.debug("Ignoring event request for non-event target portlet: " + this.portletInstance.getClass()); return; } EventPortlet eventPortlet = (EventPortlet) this.portletInstance; // Delegate to PortletContentGenerator for checking and preparing. check(request, response); // Execute in synchronized block if required. if (isSynchronizeOnSession()) { PortletSession session = request.getPortletSession(false); if (session != null) { Object mutex = PortletUtils.getSessionMutex(session); synchronized (mutex) { eventPortlet.processEvent(request, response); return; } } } eventPortlet.processEvent(request, response); }
@Override public void handleEvent(EventRequest request, EventResponse response, Object handler) throws Exception { if (handler instanceof EventAwareController) { ((EventAwareController) handler).handleEventRequest(request, response); } else { // if no event processing method was found just keep render params response.setRenderParameters(request); } }
/** * This implementation delegates to {@link #preHandle}. */ @Override public boolean preHandleEvent(EventRequest request, EventResponse response, Object handler) throws Exception { return preHandle(request, response, handler); }
/** * This implementation delegates to {@link #afterCompletion}. */ @Override public void afterEventCompletion( EventRequest request, EventResponse response, Object handler, Exception ex) throws Exception { afterCompletion(request, response, handler, ex); }
@Override public void handleEvent(EventRequest request, EventResponse response, Object handler) throws Exception { if (handler instanceof EventPortlet) { ((EventPortlet) handler).processEvent(request, response); } else { // if no event processing method was found just keep render params response.setRenderParameters(request); } }
@ProcessEvent(qname = "{http://org.oep.com/events}ipc-domainno") public void myDomainNoEvent(EventRequest request, EventResponse response) { Event event = request.getEvent(); String domainNo = event.getValue().toString(); response.setRenderParameter("domainNo", domainNo); }
@ProcessEvent(qname = "{http://org.oep.com/events}ipc-administrationno") public void myAdministrationNoEvent(EventRequest request, EventResponse response) { Event event = request.getEvent(); // Get data from the event String administrationNo = event.getValue().toString(); response.setRenderParameter("administrationNo", administrationNo); }
@ProcessEvent(qname = "{http://proliferay.com/events}ipc-text") public void myEvent(EventRequest request, EventResponse response) { Event event = request.getEvent(); //Get data from the event //String sampleText = (String) event.getValue(); Employee employee = (Employee)event.getValue(); //Set the text in response to display in UI response.setRenderParameter("sampleText", employee.name); }
@ProcessEvent(qname = "{http://www.wemooc.com/}themeId") public void handlethemeEvent(EventRequest eventRequest, EventResponse eventResponse) { if (eventRequest.getEvent().getValue() instanceof ThemeIdEvent){ ThemeIdEvent themeIdEvent = (ThemeIdEvent) eventRequest.getEvent().getValue(); long moduleId=ParamUtil.getLong(eventRequest, "moduleId",0L); if(moduleId==themeIdEvent.getModuleId()){ eventResponse.setRenderParameter("themeId",Long.toString(themeIdEvent.getThemeId())); eventResponse.setRenderParameter(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY,StringPool.TRUE); } else if((moduleId==0)&&(themeIdEvent.getModuleId()==ThemeIdEvent.EVALUATION_THEME_ID)){ eventResponse.setRenderParameter(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY,StringPool.FALSE); } } }
@ProcessEvent(qname = "{http://www.wemooc.com/}themeId") public void handlethemeEvent(EventRequest eventRequest, EventResponse eventResponse) { if (eventRequest.getEvent().getValue() instanceof ThemeIdEvent){ ThemeIdEvent themeIdEvent = (ThemeIdEvent) eventRequest.getEvent().getValue(); long moduleId=ParamUtil.getLong(eventRequest, "moduleId",0L); if(moduleId==themeIdEvent.getModuleId()){ eventResponse.setRenderParameter("viewCurrentModule",StringPool.TRUE); } else if((moduleId==0)&&(themeIdEvent.getModuleId()==ThemeIdEvent.EVALUATION_THEME_ID)){ eventResponse.setRenderParameter("viewCurrentModule",StringPool.FALSE); } } }
@ProcessEvent(qname = "{http://www.wemooc.com/}themeId") public void handlethemeEvent(EventRequest eventRequest, EventResponse eventResponse) { if (eventRequest.getEvent().getValue() instanceof ThemeIdEvent){ ThemeIdEvent themeIdEvent = (ThemeIdEvent) eventRequest.getEvent().getValue(); long moduleId=ParamUtil.getLong(eventRequest, "moduleId",0L); if(moduleId==themeIdEvent.getModuleId()){ eventResponse.setRenderParameter(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY,StringPool.FALSE); } else if((moduleId==0)&&(themeIdEvent.getModuleId()==ThemeIdEvent.EVALUATION_THEME_ID)){ eventResponse.setRenderParameter(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY,StringPool.TRUE); } } }