Java 类javax.portlet.RenderMode 实例源码

项目:portals-pluto    文件:AnnotationTests_RenderMode_ApiRender.java   
@RenderMode(name = "VIEW")
public void newRender(RenderRequest req, RenderResponse resp)
    throws PortletException, IOException {
  PrintWriter writer = resp.getWriter();
  JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails();


  /* TestCase: V2AnnotationTests_RenderMode_ApiRender_name */
  /* Details: "Method name(): On a render request, the method is */
  /* executed if the portlet mode matches the name field" */

  TestResult tr0 = tcd.getTestResultFailed(V2ANNOTATIONTESTS_RENDERMODE_APIRENDER_NAME);
  tr0.setTcSuccess(true);
  tr0.writeTo(writer);

}
项目:edemocracia    文件:LoginPortlet.java   
@RenderMode(name = "VIEW")
public void preparaVisualizacao(RenderRequest request, RenderResponse response) throws PortletException, IOException {
    carregarERemoverLastPathDaSessao(request);

    ThemeDisplay td = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
    User usuario = td.getUser();
    if (!usuario.isDefaultUser()) {
        obtemNomeDoUsuario(request, td, usuario);
    } else {
        preparaUrlSubmissaoFormulario(request, response);
    }

    getPortletContext().getRequestDispatcher("/view.jsp").include(request, response);
}
项目:portals-pluto    文件:RenderStateTests_SPEC2_12_MutableRenderState.java   
@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);
   }

}
项目:portals-pluto    文件:AddlPortletTests_SPEC2_8_PortletModes.java   
@RenderMode(name = "custom1")
public void doView(RenderRequest portletReq, RenderResponse portletResp)
    throws PortletException, IOException {

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

  PrintWriter writer = portletResp.getWriter();

  JSR286SpecTestCaseDetails tcd = new JSR286SpecTestCaseDetails();

  /* TestCase: V2AddlPortletTests_SPEC2_8_PortletModes_declaringPortletModes7 */
  /* Details: "A custom portlet mode with */
  /* <portal-managed>false</portal-managed> corresponds to */
  /* the VIEW mode from the portal point of view" */
  if (portletReq.getParameter("tr6") != null && portletReq.getParameter("tr6").equals("true")) {
    TestResult tr6 =
        tcd.getTestResultFailed(V2ADDLPORTLETTESTS_SPEC2_8_PORTLETMODES_DECLARINGPORTLETMODES7);
    if (portletReq.getPortletMode().equals(new PortletMode("custom1"))) {
      tr6.setTcSuccess(true);
    } else {
      tr6.appendTcDetail("Failed because portlet mode is not VIEW but "
          + portletReq.getPortletMode().toString());
    }
    tr6.writeTo(writer);
  }
}
项目:docs-samples    文件:HelloPortlet.java   
@RenderMode(name = "view")
public void Hello(RenderRequest request, RenderResponse response) throws IOException, PortletException {
    PortletRequestDispatcher prDispatcher = getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
    prDispatcher.include(request, response);
}
项目:docs-samples    文件:HelloPortlet.java   
@RenderMode(name = "view")
public void Hello(RenderRequest request, RenderResponse response) throws IOException, PortletException {
    PortletRequestDispatcher prDispatcher = getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
    prDispatcher.include(request, response);
}
项目:docs-samples    文件:HelloPortlet.java   
@RenderMode(name = "view")
public void Hello(RenderRequest request, RenderResponse response) throws IOException, PortletException {
    PortletRequestDispatcher prDispatcher = getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
    prDispatcher.include(request, response);
}
项目:docs-samples    文件:HelloPortlet.java   
@RenderMode(name = "view")
public void Hello(RenderRequest request, RenderResponse response) throws IOException, PortletException {
    PortletRequestDispatcher prDispatcher = getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
    prDispatcher.include(request, response);
}
项目:docs-samples    文件:HelloPortlet.java   
@RenderMode(name = "view")
public void Hello(RenderRequest request, RenderResponse response) throws IOException, PortletException {
    PortletRequestDispatcher prDispatcher = getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
    prDispatcher.include(request, response);
}
项目:docs-samples    文件:CounterPortlet.java   
@RenderMode(name = "view")
public void Hello(RenderRequest request, RenderResponse response) throws IOException, PortletException {
    PortletRequestDispatcher prDispatcher = getPortletContext().getRequestDispatcher("/jsp/counter.jsp");
    prDispatcher.include(request, response);
}
项目:portals-pluto    文件:TestPortlet6.java   
@RenderMode(name="config")
public void doConfig(RenderRequest request, RenderResponse response) throws PortletException, IOException {
   meths.addMethod(this.getClass().getSimpleName() + "#doConfig");
   meths.setConfigExists(getPortletConfig() != null);
}
项目:portals-pluto    文件:TestPortlet6.java   
@RenderMode(name="admin")
public void doAdmin(RenderRequest request, RenderResponse response) throws PortletException, IOException {
   meths.addMethod(this.getClass().getSimpleName() + "#doAdmin");
   meths.setConfigExists(getPortletConfig() != null);
}
项目:portals-pluto    文件:PortletConfigPortlet.java   
@RenderMode(name="MyMode_nonPortalManaged_1")
public void doMyMode_nonPortalManaged_1(RenderRequest request, RenderResponse response) throws PortletException, IOException {
   doView(request, response);
}
项目:portals-pluto    文件:PortletConfigPortlet.java   
@RenderMode(name="MyMode_nonPortalManaged_2")
public void doMyMode_nonPortalManaged_2(RenderRequest request, RenderResponse response) throws PortletException, IOException {
   doView(request, response);
}
项目:portletbox    文件:TestPortlet3_15_Charlie.java   
@RenderMode(name=RENDER_NAME)
public void RenderCharlie(RenderRequest renderRequest, RenderResponse renderResponse) 
      throws PortletException, IOException {
   writePortletText(PORTLET_SUFFIX, renderRequest, renderResponse);
}
项目:portletbox    文件:TestPortlet3_15_Baker.java   
@RenderMode(name=RENDER_NAME)
public void RenderBaker(RenderRequest renderRequest, RenderResponse renderResponse) 
      throws PortletException, IOException {
   writePortletText(PORTLET_SUFFIX, renderRequest, renderResponse);
}
项目:portletbox    文件:TestPortlet3_15.java   
@RenderMode(name=RENDER_NAME)
public void Render3_15(RenderRequest renderRequest, RenderResponse renderResponse) 
      throws PortletException, IOException {
   writePortletText(PORTLET_SUFFIX, renderRequest, renderResponse);
}
项目:portletbox    文件:TestPortlet3_15_Able.java   
@RenderMode(name=RENDER_NAME)
public void RenderAble(RenderRequest renderRequest, RenderResponse renderResponse) 
      throws PortletException, IOException {
   writePortletText(PORTLET_SUFFIX, renderRequest, renderResponse);
}