Java Code Examples for javax.portlet.RenderRequest#getRenderParameters()

The following examples show how to use javax.portlet.RenderRequest#getRenderParameters() . 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: AnnotationPortletConfigTests_SPEC2_28_EventDeclaration.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {

   PrintWriter writer = portletResp.getWriter();
   ModuleTestCaseDetails tcd = new ModuleTestCaseDetails();

   RenderParameters renderParams = portletReq.getRenderParameters();
   
   /* TestCase: V3AnnotationPortletConfigTests_SPEC2_28_EventDeclaration_eventEventDeclaration1 */
   /* Details: "An event can be fired from another event method configured with  */
   /* @EventMethod annotation - publishingEvents attribute."                     */
   if(renderParams.getValue("tr0")!=null && renderParams.getValue("tr0").equals("true")){
      TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETCONFIGTESTS_SPEC2_28_EVENTDECLARATION_EVENTEVENTDECLARATION1);
      result.setTcSuccess(true);
      result.writeTo(writer);
   } else {
      ActionURL aurl = portletResp.createActionURL();
      TestButton tb = new TestButton(
            V3ANNOTATIONPORTLETCONFIGTESTS_SPEC2_28_EVENTDECLARATION_EVENTEVENTDECLARATION1,
            aurl);
      tb.writeTo(writer);
   }

}
 
Example 2
Source File: AnnotationPortletAppConfigOverrideTests_SPEC1_28_EventConfiguration2.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {

   PrintWriter writer = portletResp.getWriter();
   ModuleTestCaseDetails tcd = new ModuleTestCaseDetails();
   
   RenderParameters renderParams = portletReq.getRenderParameters();

   /* TestCase: V3AnnotationPortletAppConfigOverrideTests_SPEC1_28_EventConfiguration2_declaringEvents4 */
   /* Details: "The portlet container merges the events declared in the          */
   /* @PortletApplication annotation and deployment descriptor portlet.xml"      */
   if(renderParams.getValue("tr0_a")!=null 
         && renderParams.getValue("tr0_a").equals("true")
         && renderParams.getValue("tr0_b")!=null 
         && renderParams.getValue("tr0_b").equals("true")){
      TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_EVENTCONFIGURATION2_DECLARINGEVENTS4);
      result.setTcSuccess(true);
      result.writeTo(writer);
   } else {
      ActionURL aurl = portletResp.createActionURL();
      TestButton tb = new TestButton(
            V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_EVENTCONFIGURATION2_DECLARINGEVENTS4,
            aurl);
      tb.writeTo(writer);
   }
}
 
Example 3
Source File: AnnotationPortletAppConfigOverrideTests_SPEC1_28_PublicRenderParameters3.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {

   PrintWriter writer = portletResp.getWriter();
   ModuleTestCaseDetails tcd = new ModuleTestCaseDetails();

   RenderParameters renderParams = portletReq.getRenderParameters();
   
   /* TestCase: V3AnnotationPortletAppConfigOverrideTests_SPEC1_28_PublicRenderParameters3_declaringPRP4 */
   /* Details: "The portlet container merges the public render parameters        */
   /* declared in the @PortletApplication annotation and deployment descriptor   */
   /* portlet.xml"                                                               */
   {
      TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PUBLICRENDERPARAMETERS3_DECLARINGPRP4);
      if(renderParams.isPublic("tr0_public") 
            && renderParams.isPublic("tr1_public")
            && renderParams.isPublic("tr2_public")){
         result.setTcSuccess(true);
      }
      result.writeTo(writer);
   }

}
 
Example 4
Source File: AnnotationPortletAppConfigOverrideTests_SPEC1_28_EventConfiguration1.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {

   PrintWriter writer = portletResp.getWriter();
   ModuleTestCaseDetails tcd = new ModuleTestCaseDetails();
   
   RenderParameters renderParams = portletReq.getRenderParameters();

   /* TestCase: V3AnnotationPortletAppConfigOverrideTests_SPEC1_28_EventConfiguration1_declaringEvents3 */
   /* Details: "Same event declared in @PortletApplication and deployment
    *  descriptor portlet.xml is overridden by deployment descriptor"       */
   if(renderParams.getValue("tr0")!=null && renderParams.getValue("tr0").equals("true")){
      TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_EVENTCONFIGURATION1_DECLARINGEVENTS3);
      result.setTcSuccess(true);
      result.writeTo(writer);
   } else {
      ActionURL aurl = portletResp.createActionURL();
      TestButton tb = new TestButton(
            V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_EVENTCONFIGURATION1_DECLARINGEVENTS3,
            aurl);
      tb.writeTo(writer);
   }

}
 
Example 5
Source File: RenderStateTests_SPEC2_12_MutableRenderState.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@RenderMode(name = "custom1")
public void doView(RenderRequest portletReq, RenderResponse portletResp)
      throws PortletException, IOException {

   PrintWriter writer = portletResp.getWriter();

   ModuleTestCaseDetails tcd = new ModuleTestCaseDetails();

   /*
    * TestCase:
    * V3RenderStateTests_SPEC2_12_MutableRenderState_setPortletMode2
    */
   /*
    * Details:
    * "A custom portlet mode declared in deployment descriptor could be set."
    */
   RenderParameters renderParams = portletReq.getRenderParameters();
   if (renderParams.getValue("tr_setPortlet2") != null
         && renderParams.getValue("tr_setPortlet2").equals("true")) {
      TestResult result = tcd.getTestResultFailed(
            V3RENDERSTATETESTS_SPEC2_12_MUTABLERENDERSTATE_SETPORTLETMODE2);
      if (portletReq.getPortletMode().equals(new PortletMode("custom1"))) {
         result.setTcSuccess(true);
      } else {
         result.appendTcDetail(
               "Failed because portlet mode is not CUSTOM1 but "
                     + portletReq.getPortletMode().toString());
      }
      result.writeTo(writer);
   }
 
}
 
Example 6
Source File: AnnotationPortletAppConfigOverrideTests_SPEC1_28_PublicRenderParameters2.java    From portals-pluto with Apache License 2.0 5 votes vote down vote up
@Override
public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException {

   PrintWriter writer = portletResp.getWriter();
   ModuleTestCaseDetails tcd = new ModuleTestCaseDetails();
   
   RenderParameters renderParams = portletReq.getRenderParameters();

   /* TestCase: V3AnnotationPortletAppConfigOverrideTests_SPEC1_28_PublicRenderParameters2_declaringPRP3 */
   /* Details: "A public render parameters declared using @PortletApplication    */
   /* annotation in one portlet and deployment descriptor portlet.xml in another */
   /* portlet can be shared with each other."                                    */
   if(renderParams.isPublic("tr2_public") 
         && renderParams.getValue("tr2_public")!=null 
         && renderParams.getValue("tr2_public").equals("true")){
      TestResult result = tcd.getTestResultFailed(V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PUBLICRENDERPARAMETERS2_DECLARINGPRP3);
      result.setTcSuccess(true);
      result.writeTo(writer);
   } else {
      ActionURL aurl = portletResp.createActionURL();
      TestButton tb = new TestButton(
            V3ANNOTATIONPORTLETAPPCONFIGOVERRIDETESTS_SPEC1_28_PUBLICRENDERPARAMETERS2_DECLARINGPRP3,
            aurl);
      tb.writeTo(writer);
   }

}