public EditPage() { // Obtém a página de visualização RenderResponse rRes = UIUtils.getRenderResponse(); PortletURL pURL = rRes.createRenderURL(); try { pURL.setPortletMode(PortletMode.VIEW); } catch (PortletModeException e) { } viewUrl = pURL.toString(); PortletPreferences pp = UIUtils.getPortletPreferences(); initFeedbackPanel(); initForm(); initMensagem(pp); initUrl(pp); initVoltar(); }
@Override public void render(RenderRequest portletReq, RenderResponse portletResp) throws PortletException, IOException { long tid = Thread.currentThread().getId(); portletReq.setAttribute(THREADID_ATTR, tid); PrintWriter writer = portletResp.getWriter(); JSR286ApiTestCaseDetails tcd = new JSR286ApiTestCaseDetails(); // Create result objects for the tests /* TestCase: V2ExceptionTests_PortletModeException_ApiRender_hasGetMode2 */ /* Details: "Returns the PortletMode object causing this exception" */ TestResult tr0 = tcd.getTestResultFailed(V2EXCEPTIONTESTS_PORTLETMODEEXCEPTION_APIRENDER_HASGETMODE2); PortletMode pm = new PortletMode("testmode"); PortletModeException pme = new PortletModeException("Unsupported Mode Causing Exception", pm); if (pme.getMode().toString().equals("testmode")) { tr0.setTcSuccess(true); } tr0.writeTo(writer); }
@Override public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (!CollectionUtils.contains(this.portalContext.getSupportedPortletModes(), portletMode)) { throw new PortletModeException("PortletMode not supported", portletMode); } this.portletMode = portletMode; }
@Override public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (!CollectionUtils.contains(getPortalContext().getSupportedPortletModes(), portletMode)) { throw new PortletModeException("PortletMode not supported", portletMode); } this.portletMode = portletMode; }
@Override public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (this.redirectedUrl != null) { throw new IllegalStateException("Cannot set PortletMode after sendRedirect has been called"); } super.setPortletMode(portletMode); this.redirectAllowed = false; }
/** * Helper to get the URL to take us to a portlet mode. * This will end up in doDispatch. * * @param response * @return */ private String getPortletModeUrl(RenderResponse response, PortletMode mode) { PortletURL url = response.createRenderURL(); try { url.setPortletMode(mode); } catch (PortletModeException e) { log.error("Invalid portlet mode: " + mode); return null; } return url.toString(); }
/** * Switches to the view mode of the portlet without storing the current preferences. */ public void view() { try { ((ActionResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse()) .setPortletMode(PortletMode.VIEW); } catch (final PortletModeException e) { throw new IllegalStateException(e); } }
/** * URL para redirecionar para visualização */ private void buildViewUrl() { RenderResponse rRes = UIUtils.getRenderResponse(); PortletURL pURL = rRes.createRenderURL(); try { pURL.setPortletMode(PortletMode.VIEW); } catch (PortletModeException e) { } viewUrl = pURL.toString(); }
public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (this.redirectedUrl != null) { throw new IllegalStateException("Cannot set PortletMode after sendRedirect has been called"); } super.setPortletMode(portletMode); this.redirectAllowed = false; }
@Override public void setPortletMode(PortletMode portletMode) throws PortletModeException { String meth = "setPortletMode"; Object[] args = { portletMode }; checkArgs(meth, args); return; }
public void setPortletMode(PortletMode portletMode) throws PortletModeException { ArgumentUtility.validateNotNull("portletMode", portletMode); if (isPortletModeAllowed(portletMode)) { checkSetStateChanged(); responseContext.setPortletMode(portletMode); } else { throw new PortletModeException("Can't set this PortletMode", portletMode); } }
public void setPortletMode(PortletMode portletMode) throws PortletModeException { ArgumentUtility.validateNotNull("portletMode", portletMode); if (isPortletModeAllowed(portletMode)) { urlProvider.setPortletMode(portletMode); } else { throw new PortletModeException("Can't set this PortletMode", portletMode); } }
public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (!CollectionUtils.contains(this.portalContext.getSupportedPortletModes(), portletMode)) { throw new PortletModeException("PortletMode not supported", portletMode); } this.portletMode = portletMode; }
public void setPortletMode(PortletMode portletMode) throws PortletModeException { if (!CollectionUtils.contains(getPortalContext().getSupportedPortletModes(), portletMode)) { throw new PortletModeException("PortletMode not supported", portletMode); } this.portletMode = portletMode; }
@Override public void setPortletMode(PortletMode portletMode) throws PortletModeException { ((PortletURL)wrapped).setPortletMode(portletMode); }
public void setPortletMode(PortletMode portletMode) throws PortletModeException { ((StateAwareResponse)response).setPortletMode(portletMode); }
@Override public void setPortletMode(PortletMode portletMode) throws PortletModeException { ((MutableRenderState)wrapped).setPortletMode(portletMode); }
@Override public void setPortletMode(PortletMode arg0) throws PortletModeException { }