Package com.liferay.faces.bridge.context

Examples of com.liferay.faces.bridge.context.BridgeContext


        // order to ensure that it only happens once.
        synchronized (subscribeToEventsAtRuntime) {

          // Need to check again within the synchronization block, just in case.
          if (subscribeToEventsAtRuntime) {
            BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
            BridgeConfig bridgeConfig = bridgeContext.getBridgeConfig();
            List<ConfiguredSystemEventListener> configuredSystemEventListeners =
              bridgeConfig.getConfiguredSystemEventListeners();

            if (configuredSystemEventListeners != null) {
View Full Code Here


  @Override
  public String getRedirectURL(FacesContext facesContext, String viewId, Map<String, List<String>> parameters,
    boolean includeViewParams) {

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletPhase portletRequestPhase = BridgeUtil.getPortletRequestPhase();

    // Determine whether or not it is necessary to work-around the patch applied to Mojarra in JAVASERVERFACES-3023
    boolean workaroundMojarra = (MOJARRA_DETECTED) &&
      ((portletRequestPhase == Bridge.PortletPhase.ACTION_PHASE) ||
        (portletRequestPhase == Bridge.PortletPhase.EVENT_PHASE));

    if (workaroundMojarra) {
      bridgeContext.getAttributes().put(RESPONSE_CHARACTER_ENCODING, StringPool.UTF8);
    }

    String redirectURL = super.getRedirectURL(facesContext, viewId, parameters, includeViewParams);

    if (workaroundMojarra) {
      bridgeContext.getAttributes().remove(RESPONSE_CHARACTER_ENCODING);
    }

    return redirectURL;
  }
View Full Code Here

  protected Map<String, List<UploadedFile>> getUploadedFileMap(FacesContext facesContext) {

    ContextMapFactory contextMapFactory = (ContextMapFactory) FactoryExtensionFinder.getFactory(
        ContextMapFactory.class);
    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();

    return contextMapFactory.getUploadedFileMap(bridgeContext);
  }
View Full Code Here

  protected Map<String, List<UploadedFile>> getUploadedFileMap(FacesContext facesContext) {

    ContextMapFactory contextMapFactory = (ContextMapFactory) FactoryExtensionFinder.getFactory(
        ContextMapFactory.class);
    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();

    return contextMapFactory.getUploadedFileMap(bridgeContext);
  }
View Full Code Here

      }
      else if (varName.equals(HTTP_SESSION_SCOPE)) {

        // Determines whether or not methods annotated with the &#064;PreDestroy annotation are preferably
        // invoked over the &#064;BridgePreDestroy annotation.
        BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
        ContextMapFactory contextMapFactory = (ContextMapFactory) FactoryExtensionFinder.getFactory(
            ContextMapFactory.class);
        value = contextMapFactory.getSessionScopeMap(bridgeContext, PortletSession.APPLICATION_SCOPE);
      }
      else if (varName.equals(MUTABLE_PORTLET_PREFERENCES_VALUES)) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        PortletRequest portletRequest = getPortletRequest(facesContext);

        if (portletRequest != null) {
          value = new MutablePreferenceMap(portletRequest.getPreferences());
        }
      }
      else if (varName.equals(PORTLET_CONFIG)) {
        BridgeContext bridgeContext = BridgeContext.getCurrentInstance();

        if (bridgeContext != null) {
          value = bridgeContext.getPortletConfig();
        }
      }
      else if (varName.equals(PORTLET_SESSION)) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        value = facesContext.getExternalContext().getSession(true);
View Full Code Here

  // Logger
  private static final Logger logger = LoggerFactory.getLogger(IPCPhaseListener.class);

  public void afterPhase(PhaseEvent phaseEvent) {

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    FacesContext facesContext = phaseEvent.getFacesContext();

    PhaseId phaseId = phaseEvent.getPhaseId();

    if (phaseId == PhaseId.RESTORE_VIEW) {
View Full Code Here

View Full Code Here

    if ((phase != null) && (phase != PortletPhase.RENDER_PHASE)) {

      // If the attribute being added is not excluded, then invoke all methods on the attribute value (class
      // instance) that are annotated with the BridgeRequestScopeAttributeAdded annotation.
      String attributeName = servletRequestAttributeEvent.getName();
      BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
      BridgeConfig bridgeConfig = bridgeContext.getBridgeConfig();
      Set<String> excludedRequestScopeAttributes = bridgeConfig.getExcludedRequestAttributes();

      if (!excludedRequestScopeAttributes.contains(attributeName)) {

        Object attributeValue = servletRequestAttributeEvent.getValue();
View Full Code Here

  // Private Data Members
  private PhaseId phaseId = PhaseId.RESTORE_VIEW;

  public void afterPhase(PhaseEvent phaseEvent) {

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();

    if (VIEW_PARAMETERS_ENABLED == null) {

      synchronized (phaseId) {

        if (VIEW_PARAMETERS_ENABLED == null) {
          VIEW_PARAMETERS_ENABLED = isViewParametersEnabled(bridgeContext);
        }
      }
    }

    // If the JSF 2 "View Parameters" feature is not enabled, then ensure that only the RESTORE_VIEW phase executes.
    if (!VIEW_PARAMETERS_ENABLED && (bridgeContext.getPortletRequestPhase() == Bridge.PortletPhase.RENDER_PHASE)) {
      phaseEvent.getFacesContext().renderResponse();
    }
  }
View Full Code Here

  // serialVersionUID
  private static final long serialVersionUID = 3383713726298508807L;

  public void afterPhase(PhaseEvent phaseEvent) {
    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletContainer portletContainer = bridgeContext.getPortletContainer();
    PhaseId phaseId = portletContainer.getPhaseId();

    if ((phaseId != null) && ((phaseId == PhaseId.ANY_PHASE) || (phaseId == phaseEvent.getPhaseId()))) {
      portletContainer.afterPhase(phaseEvent);
    }
View Full Code Here

TOP

Related Classes of com.liferay.faces.bridge.context.BridgeContext

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.