@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); }
@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); }
@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); } }
@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); } }
@RenderMode(name = "view") public void Hello(RenderRequest request, RenderResponse response) throws IOException, PortletException { PortletRequestDispatcher prDispatcher = getPortletContext().getRequestDispatcher("/jsp/hello.jsp"); prDispatcher.include(request, response); }
@RenderMode(name = "view") public void Hello(RenderRequest request, RenderResponse response) throws IOException, PortletException { PortletRequestDispatcher prDispatcher = getPortletContext().getRequestDispatcher("/jsp/counter.jsp"); prDispatcher.include(request, response); }
@RenderMode(name="config") public void doConfig(RenderRequest request, RenderResponse response) throws PortletException, IOException { meths.addMethod(this.getClass().getSimpleName() + "#doConfig"); meths.setConfigExists(getPortletConfig() != null); }
@RenderMode(name="admin") public void doAdmin(RenderRequest request, RenderResponse response) throws PortletException, IOException { meths.addMethod(this.getClass().getSimpleName() + "#doAdmin"); meths.setConfigExists(getPortletConfig() != null); }
@RenderMode(name="MyMode_nonPortalManaged_1") public void doMyMode_nonPortalManaged_1(RenderRequest request, RenderResponse response) throws PortletException, IOException { doView(request, response); }
@RenderMode(name="MyMode_nonPortalManaged_2") public void doMyMode_nonPortalManaged_2(RenderRequest request, RenderResponse response) throws PortletException, IOException { doView(request, response); }
@RenderMode(name=RENDER_NAME) public void RenderCharlie(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { writePortletText(PORTLET_SUFFIX, renderRequest, renderResponse); }
@RenderMode(name=RENDER_NAME) public void RenderBaker(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { writePortletText(PORTLET_SUFFIX, renderRequest, renderResponse); }
@RenderMode(name=RENDER_NAME) public void Render3_15(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { writePortletText(PORTLET_SUFFIX, renderRequest, renderResponse); }
@RenderMode(name=RENDER_NAME) public void RenderAble(RenderRequest renderRequest, RenderResponse renderResponse) throws PortletException, IOException { writePortletText(PORTLET_SUFFIX, renderRequest, renderResponse); }