Java 类javax.portlet.PortletModeException 实例源码

项目:edemocracia    文件:EditPage.java   
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();
    }
项目:portals-pluto    文件:ExceptionTests_PortletModeException_ApiRender.java   
@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);

}
项目:spring4-understanding    文件:MockPortletURL.java   
@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;
}
项目:spring4-understanding    文件:MockStateAwareResponse.java   
@Override
public void setPortletMode(PortletMode portletMode) throws PortletModeException {
    if (!CollectionUtils.contains(getPortalContext().getSupportedPortletModes(), portletMode)) {
        throw new PortletModeException("PortletMode not supported", portletMode);
    }
    this.portletMode = portletMode;
}
项目:spring4-understanding    文件:MockActionResponse.java   
@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;
}
项目:spring4-understanding    文件:MockPortletURL.java   
@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;
}
项目:spring4-understanding    文件:MockStateAwareResponse.java   
@Override
public void setPortletMode(PortletMode portletMode) throws PortletModeException {
    if (!CollectionUtils.contains(getPortalContext().getSupportedPortletModes(), portletMode)) {
        throw new PortletModeException("PortletMode not supported", portletMode);
    }
    this.portletMode = portletMode;
}
项目:spring4-understanding    文件:MockActionResponse.java   
@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;
}
项目:sakai    文件:SimpleRSSPortlet.java   
/**
 * 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();
}
项目:org.portletbeans    文件:AbstractMangedBean.java   
/**
 * 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);
    }
}
项目:edemocracia    文件:ConfiguracaoPage.java   
/**
 * 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();
}
项目:class-guard    文件:MockPortletURL.java   
@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;
}
项目:class-guard    文件:MockStateAwareResponse.java   
@Override
public void setPortletMode(PortletMode portletMode) throws PortletModeException {
    if (!CollectionUtils.contains(getPortalContext().getSupportedPortletModes(), portletMode)) {
        throw new PortletModeException("PortletMode not supported", portletMode);
    }
    this.portletMode = portletMode;
}
项目:class-guard    文件:MockActionResponse.java   
@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;
}
项目:class-guard    文件:MockActionResponse.java   
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;
}
项目:portals-pluto    文件:ActionResponseWrapperChecker.java   
@Override
public void setPortletMode(PortletMode portletMode) throws PortletModeException {
   String meth = "setPortletMode";
   Object[] args = { portletMode };
   checkArgs(meth, args);
   return;

}
项目:portals-pluto    文件:EventResponseWrapperChecker.java   
@Override
public void setPortletMode(PortletMode portletMode) throws PortletModeException {
   String meth = "setPortletMode";
   Object[] args = { portletMode };
   checkArgs(meth, args);
   return;

}
项目:portals-pluto    文件:StateAwareResponseImpl.java   
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);
   }
}
项目:portals-pluto    文件:PortletURLImpl.java   
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);
   }
}
项目:sakai    文件:SimpleRSSPortlet.java   
/**
 * 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();
}
项目:class-guard    文件:MockPortletURL.java   
public void setPortletMode(PortletMode portletMode) throws PortletModeException {
    if (!CollectionUtils.contains(this.portalContext.getSupportedPortletModes(), portletMode)) {
        throw new PortletModeException("PortletMode not supported", portletMode);
    }
    this.portletMode = portletMode;
}
项目:class-guard    文件:MockStateAwareResponse.java   
public void setPortletMode(PortletMode portletMode) throws PortletModeException {
    if (!CollectionUtils.contains(getPortalContext().getSupportedPortletModes(), portletMode)) {
        throw new PortletModeException("PortletMode not supported", portletMode);
    }
    this.portletMode = portletMode;
}
项目:portals-pluto    文件:PortletURLWrapper.java   
@Override
public void setPortletMode(PortletMode portletMode) throws PortletModeException {
   ((PortletURL)wrapped).setPortletMode(portletMode);
}
项目:portals-pluto    文件:StateAwareResponseWrapper.java   
public void setPortletMode(PortletMode portletMode)
      throws PortletModeException {
   ((StateAwareResponse)response).setPortletMode(portletMode);
}
项目:portals-pluto    文件:MutableRenderStateWrapper.java   
@Override
public void setPortletMode(PortletMode portletMode) throws PortletModeException {
   ((MutableRenderState)wrapped).setPortletMode(portletMode);
}
项目:portals-pluto    文件:MockStateAwareResponse.java   
@Override
public void setPortletMode(PortletMode arg0) throws PortletModeException {
}