Java 类javax.portlet.ProcessEvent 实例源码

项目:OEPv2    文件:DossierProcPortlet.java   
@ProcessEvent(qname = "{http://org.oep.com/events}ipc-dossierdangky")
public void dossierDangkyEvent(ActionRequest request,
        ActionResponse response) {

    /**
     * Get sample text from UI
     */

    String dossierProcId = ParamUtil
            .getString(request, "dossierProcId", "");
    QName qName = new QName("http://org.oep.com/events",
            "ipc-dossierdangky");
    response.setRenderParameter("tabs1",
            ParamUtil.getString(request, "tabs1"));
    response.setEvent(qName, dossierProcId);
}
项目:portals-pluto    文件:TestCompanionPortlet.java   
@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());
}
项目:portals-pluto    文件:TestCompanionPortlet.java   
@ProcessEvent(name = ComplexPayloadEventTest.COMPLEX_PAYLOAD_EVENT)
public void processComplexPayload(EventRequest request, 
        EventResponse response) throws PortletException, IOException {

    StringBuilder feedback = new StringBuilder();
    feedback.append("Complex Payload Event received.");

    boolean failed = false;
    ComposedObject value = (ComposedObject) request.getEvent().getValue();
    if (!ComplexPayloadEventTest.TEST_COLOR.equals(value.getColor())) {
        feedback.append("  Color DID NOT match expected value.");
        failed = true;
    }
    if (!ComplexPayloadEventTest.TEST_POINT.equals(value.getPoint())) {
        feedback.append("  Point DID NOT match expected value.");
        failed = true;
    }
    if (!failed) {
        feedback.append("  Payload matched expected values.");
    }

    response.setRenderParameter(EVENT_INFO_PARAM, feedback.toString());
}
项目:portals-pluto    文件:AnnotationTests_ProcessEvent_ApiEvent_event.java   
@ProcessEvent(qname = "{" + TCKNAMESPACE + "}AnnotationTests_ProcessEvent_ApiEvent")
public void handleEvnt(EventRequest req, EventResponse resp)
    throws PortletException, IOException {

  StringWriter writer = new StringWriter();

  JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails();

  /* TestCase: V2AnnotationTests_ProcessEvent_ApiEvent_qname */
  /* Details: "Method qname(): On an event request, the method is */
  /* executed if the Event qname matches the qname field" */
  TestResult tr0 = tcd.getTestResultFailed(V2ANNOTATIONTESTS_PROCESSEVENT_APIEVENT_QNAME);
  tr0.setTcSuccess(true);
  tr0.writeTo(writer);
  req.getPortletSession().setAttribute(
      Constants.RESULT_ATTR_PREFIX + "AnnotationTests_ProcessEvent_ApiEvent", writer.toString(),
      APPLICATION_SCOPE);

  LOGGER.trace("Resulting String: {}", writer);
}
项目:portals-pluto    文件:AnnotationTests_ProcessEvent_ApiEvent_event.java   
@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);

}
项目:portals-pluto    文件:AddlPortletTests_SPEC2_5_RenderGenericPortlet_event.java   
@ProcessEvent(qname = "AddlPortletTests_SPEC2_5_RenderGenericPortlet")
public void processEvent(EventRequest portletReq, EventResponse portletResp)
    throws PortletException, IOException {
  JSR286SpecTestCaseDetails tcd = new JSR286SpecTestCaseDetails();

  /* TestCase: V2AddlPortletTests_SPEC2_5_RenderGenericPortlet_eventDispatching1 */
  /* Details: "The GenericPortlet processEvent method will dispatch the */
  /* request to a subclass method annotated with the tag */
  /* @ProcessEvent(qname=<eventname>), where <eventname> */
  /* must be in the format provided by Qname.toString()" */

  Event event = portletReq.getEvent();
  String qName = event.getName();
  TestResult tr1 =
      tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_5_RENDERGENERICPORTLET_EVENTDISPATCHING1);
  if (qName.toString().equals("AddlPortletTests_SPEC2_5_RenderGenericPortlet")) {
    tr1.setTcSuccess(true);
  } else {
    tr1.appendTcDetail(
        "Failed because QName is not AddlPortletTests_SPEC2_5_RenderGenericPortlet");
  }
  portletReq.getPortletSession().setAttribute(
      Constants.RESULT_ATTR_PREFIX + "AddlPortletTests_SPEC2_5_RenderGenericPortlet_event_a",
      tr1.toString(), APPLICATION_SCOPE);
}
项目:portals-pluto    文件:AddlPortletTests_SPEC2_5_RenderGenericPortlet.java   
@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);

}
项目:OEPv2    文件:DossierProcPortlet.java   
@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);

}
项目:OEPv2    文件:DossierProcPortlet.java   
@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);

}
项目:OEPv2    文件:MenuListDomain.java   
@ProcessEvent(qname = "{http://org.oep.com/events}ipc-domainno")
public void myDomainNoEvent(ActionRequest request, ActionResponse response) {

    /**
     * Get sample text from UI
     */
    String domainno = ParamUtil.getString(request, "domainNo", "");
    QName qName = new QName("http://org.oep.com/events", "ipc-domainno");
    System.out.println("Page: " + ParamUtil.getString(request, "tabs1"));
    response.setRenderParameter("tabs1",
            ParamUtil.getString(request, "tabs1"));
    response.setEvent(qName, domainno);
}
项目:OEPv2    文件:IpcEventReceiverPortlet.java   
@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);
}
项目:liferaylms-portlet    文件:ModuleNavigation.java   
@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);
       }
   }
}
项目:liferaylms-portlet    文件:LmsActivitiesList.java   
@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);
       }
    }
}
项目:liferaylms-portlet    文件:EvaluationAvgPortlet.java   
@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);
       }
    }
}
项目:liferaylms-portlet    文件:ModuleTitle.java   
@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);
       }
   }
}
项目:liferaylms-portlet    文件:ActivityNavigatorPortlet.java   
@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.TRUE);
       }        
       else if((moduleId==0)&&(themeIdEvent.getModuleId()==ThemeIdEvent.EVALUATION_THEME_ID)){
           eventResponse.setRenderParameter(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY,StringPool.FALSE);
       }
    }
}
项目:liferaylms-portlet    文件:ModuleDescriptionPortlet.java   
@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.TRUE);
       }        
       else if((moduleId==0)&&(themeIdEvent.getModuleId()==ThemeIdEvent.EVALUATION_THEME_ID)){
           eventResponse.setRenderParameter(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY,StringPool.FALSE);
       }
    }
}
项目:liferaylms-portlet    文件:ActivityDatesPortlet.java   
@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.TRUE);
       }        
       else if((moduleId==0)&&(themeIdEvent.getModuleId()==ThemeIdEvent.EVALUATION_THEME_ID)){
           eventResponse.setRenderParameter(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY,StringPool.FALSE);
       }
    }
}
项目:portletbox    文件:TestPortlet3_23.java   
@SuppressWarnings("incomplete-switch")
@ProcessEvent(name=EVENT_NAME)
public void EventAble(EventRequest eventRequest, EventResponse eventResponse) 
      throws PortletException, IOException {
   // Get test to be performed

   String eventName = eventRequest.getEvent().getName();
   String eventTest = (String)eventRequest.getEvent().getValue();
   ThrowType tt = ThrowType.NONE;

   if (eventTest != null) {

      try {
         tt = ThrowType.valueOf(eventTest);
      }
      catch (Exception e) {
      }
   }

   eventRequest.getPortletSession().setAttribute(RENDER_PARM_NAME, "EventName=" + eventName
   // eventResponse.setRenderParameter( RENDER_PARM_NAME, "EventName=" + eventName 
         + ". Exception " + tt.toString() + " will be thrown." );

   switch(tt) {
      case PORTLET: 
         throw new PortletException("PortletException thrown from event method");
      case IO: 
         throw new IOException("IOException thrown from event method");
      case RUNTIME: 
         throw new RuntimeException("RuntimeException thrown from event method");
   }
}
项目:portals-pluto    文件:TestPortlet6.java   
@ProcessEvent(qname="{http://www.apache.org/}event1")
public void doEvent1(EventRequest request, EventResponse response) throws PortletException, IOException {
   meths.addMethod(this.getClass().getSimpleName() + "#doEvent1");
   meths.setConfigExists(getPortletConfig() != null);
}
项目:portals-pluto    文件:TestPortlet6.java   
@ProcessEvent(qname="{https://www.java.net/}event4")
public void doEvent4(EventRequest request, EventResponse response) throws PortletException, IOException {
   meths.addMethod(this.getClass().getSimpleName() + "#doEvent4");
   meths.setConfigExists(getPortletConfig() != null);
}
项目:portletbox    文件:TestPortlet3_15_Baker.java   
@ProcessEvent(name=EVENT_NAME)
public void EventBaker(EventRequest eventRequest, EventResponse eventResponse) 
      throws PortletException, IOException {
   eventResponse.setRenderParameter( RENDER_PARM_NAME, "Render Parameter set by Event"  + PORTLET_SUFFIX);
}
项目:portletbox    文件:TestPortlet3_15_Able.java   
@ProcessEvent(name=EVENT_NAME)
public void EventAble(EventRequest eventRequest, EventResponse eventResponse) 
      throws PortletException, IOException {
   eventResponse.setRenderParameter( RENDER_PARM_NAME, "Render Parameter set by Event"  + PORTLET_SUFFIX);
}