Package javax.portlet.faces

Examples of javax.portlet.faces.BridgeException


      }
    }

  public void processEventException(FacesContext facesContext, BridgeRequestScope windowState, Exception e)
    throws BridgeException {
      throw new BridgeException("Error processing faces lifecycle from event request", e);
       
    }
View Full Code Here


        setupErrorParameters(context,e);
        windowState.setViewId(errorPage);
        windowState.saveRequestParameters(context);
        windowState.saveBeans(context);
      } else {
        throw new BridgeException("Error processing render lifecycle", e);
      }
   
    }
View Full Code Here

    .getInitParameter("org.ajax4jsf.xmlparser.ORDER");
  if (null != parsersParameter) {
      try {
          configureParsers(wrappedContext, parsersParameter);
        } catch (ServletException e) {
          throw new BridgeException(e.getMessage());
        }
  }
  }
View Full Code Here

    if (null == config) {
      throw new NullPointerException(
          "No PortletConfig at the bridge initialization");
    }
    if (initialized) {
      throw new BridgeException("JSF portlet bridge already initialized");
    }
    String portletName = config.getPortletName();
    if (log.isLoggable(Level.FINE)) {
      log.fine("Start portletbridge initialization for " + portletName);
    }

    this.portletConfig = config;
    PortletContext portletContext = config.getPortletContext();
  
    WebXML webXml = new WebXML();      
        webXml.parse(portletContext);
        this.filterInitParams = webXml.getFilterInitParams();

    initFaces(portletContext);
    // add locales to faces application
    transferLocales(config);
    // Register exception handler.
    exceptionHandler = createExceptionHandler();
    // Parse web.xml for a Faces Servlet mappings.
    this.facesServletMappings = webXml.getFacesServletMappings();
    
    errorPages = webXml.getErrorViews();
    // Get all excluded request attributes names.
    this.excludedAttributes = new HashSet<ExcludedRequestAttribute>();
    String bridgeParametersPrefix = Bridge.BRIDGE_PACKAGE_PREFIX
        + portletName + ".";
    List<String> excluded = (List<String>) portletContext
        .getAttribute(bridgeParametersPrefix
            + Bridge.EXCLUDED_REQUEST_ATTRIBUTES);
    if (null != excluded) {
      for (String name : excluded) {
        excludedAttributes.add(new ExcludedRequestAttribute(name));
      }
    }
    String maxScopesParameter = portletContext.getInitParameter(Bridge.MAX_MANAGED_REQUEST_SCOPES);
    if (null != maxScopesParameter) {
      numberOfRequestScopes = Integer.parseInt(maxScopesParameter);
    }

    FacesConfig facesConfig = new FacesConfig();
    facesConfig.parse(portletContext);
    excluded = facesConfig.getExcludedAttributes();
    if (null != excluded) {
      for (String name : excluded) {
        excludedAttributes.add(new ExcludedRequestAttribute(name));
      }
    }
    publicParameterMapping = facesConfig.getParameterMapping();
    // Get preserve action parameters flag
    Boolean preserveParams = (Boolean) portletContext
        .getAttribute(bridgeParametersPrefix
            + Bridge.PRESERVE_ACTION_PARAMS);
    this.preserveActionParams = Boolean.TRUE.equals(preserveParams);
    // Get devault view's Map.
    this.defaultViewIdMap = (Map<String, String>) portletContext
        .getAttribute(bridgeParametersPrefix
            + Bridge.DEFAULT_VIEWID_MAP);
    if (null == this.defaultViewIdMap || 0 == this.defaultViewIdMap.size()) {
      throw new BridgeException("No JSF view id's defined in portlet");
    }
    // Event Handler
    eventHandler = (BridgeEventHandler) portletContext
        .getAttribute(bridgeParametersPrefix
            + Bridge.BRIDGE_EVENT_HANDLER);
View Full Code Here

      FacesContext context = new InitFacesContext(application,
          portletContext);
      strategy.init(context, renderKitFactory);
      context.release();
    } catch (FacesException e) {
      throw new BridgeException("JSF Initialization error", e);
    }
  }
View Full Code Here

    }
    if (null == response) {
      throw new NullPointerException("Response parameter is null");
    }
    if (!isInitialized()) {
      throw new BridgeException("JSF Portlet bridge is not initialized");
    }
  }
View Full Code Here

            }
        } catch (Exception e) {
          throwBridgeException(e);
        }
        } else {
          throw new BridgeException("Unable to serve resource");
        }

      } else {
        // FACES REQUEST.
        ResourceResponse wrappedResponse = strategy
View Full Code Here

    }
  }

  private void throwBridgeException(Exception e) throws BridgeException {
    if (!(e instanceof BridgeException)) {
      e = new BridgeException(e);
    }
    throw (BridgeException) e;
  }
View Full Code Here

    try {
      PortalActionURL viewIdUrl = new PortalActionURL(viewId);
      viewIdUrl.addParameter(Bridge.PORTLET_MODE_PARAMETER, mode);
      return viewIdUrl.toString();
    } catch (MalformedURLException e) {
      throw new BridgeException("Malformed ViewId", e);
    }
  }
View Full Code Here

  public static PortletStateHolder getInstance(FacesContext context) {
    ExternalContext externalContext = context.getExternalContext();
    PortletStateHolder stateHolder = (PortletStateHolder) externalContext
        .getApplicationMap().get(STATE_HOLDER);
    if (null == stateHolder) {
      throw new BridgeException(
          "Jsf portletbridge bridge not initialized");
    }
    return stateHolder;
  }
View Full Code Here

TOP

Related Classes of javax.portlet.faces.BridgeException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.