Search in sources :

Example 6 with PortletModeException

use of javax.portlet.PortletModeException in project liferay-faces-bridge-impl by liferay.

the class ApplicantBacking method initPortletURLs.

protected void initPortletURLs() {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    Object response = externalContext.getResponse();
    if (response instanceof MimeResponse) {
        MimeResponse mimeResponse = (MimeResponse) response;
        PortletURL portletURL = mimeResponse.createRenderURL();
        try {
            portletURL.setPortletMode(PortletMode.VIEW);
            viewModeURL = portletURL.toString();
            portletURL.setPortletMode(PortletMode.EDIT);
            editModeURL = portletURL.toString();
            portletURL.setPortletMode(PortletMode.HELP);
            helpModeURL = portletURL.toString();
        } catch (PortletModeException e) {
            logger.error(e);
        }
    }
}
Also used : FacesContext(javax.faces.context.FacesContext) ExternalContext(javax.faces.context.ExternalContext) MimeResponse(javax.portlet.MimeResponse) PortletURL(javax.portlet.PortletURL) PortletModeException(javax.portlet.PortletModeException)

Aggregations

PortletModeException (javax.portlet.PortletModeException)6 ExternalContext (javax.faces.context.ExternalContext)2 PortletMode (javax.portlet.PortletMode)2 PortletURL (javax.portlet.PortletURL)2 WindowStateException (javax.portlet.WindowStateException)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 FacesContext (javax.faces.context.FacesContext)1 MimeResponse (javax.portlet.MimeResponse)1 PortletPreferences (javax.portlet.PortletPreferences)1 PortletRequest (javax.portlet.PortletRequest)1 PortletSecurityException (javax.portlet.PortletSecurityException)1 StateAwareResponse (javax.portlet.StateAwareResponse)1 WindowState (javax.portlet.WindowState)1 BridgeException (javax.portlet.faces.BridgeException)1 ActionMapping (org.springframework.web.portlet.bind.annotation.ActionMapping)1