Package com.liferay.faces.bridge.context

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


          }
          else {

            // FACES-1496: Need to get the BridgeContext from the ThreadLocal in order to prevent memory
            // leaks with Mojarra.
            BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
            PortletContainer portletContainer = bridgeContext.getPortletContainer();
            long ifModifiedHeaderInMilliSeconds = portletContainer.getHttpServletRequestDateHeader(
                HEADER_IF_MODIFIED_SINCE);
            ifModifiedHeaderInSeconds = (long) (ifModifiedHeaderInMilliSeconds / 1000);

            if (logger.isDebugEnabled()) {
View Full Code Here


    // append extension-mapped suffixes which have no meaning in a portlet environment.
    if (wrappedRequestPath != null) {

      if (wrappedRequestPath.contains(ResourceHandler.RESOURCE_IDENTIFIER)) {

        BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
        BridgeConfig bridgeConfig = bridgeContext.getBridgeConfig();

        List<ConfiguredServletMapping> configuredFacesServletMappings =
          bridgeConfig.getConfiguredFacesServletMappings();

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

    boolean ajaxRequest = facesContext.getPartialViewContext().isAjaxRequest();
    List<UIComponent> resourcesForAddingToHead = new ArrayList<UIComponent>();
    List<UIComponent> resourcesForRelocatingToBody = new ArrayList<UIComponent>();
    ExternalContext externalContext = facesContext.getExternalContext();
    PortletRequest portletRequest = (PortletRequest) externalContext.getRequest();
    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletContainer portletContainer = bridgeContext.getPortletContainer();

    // Determine whether or not the portlet container is able to add script resources to the head.
    boolean portletContainerAbleToAddScriptResourceToHead = portletContainer.isAbleToAddScriptResourceToHead();

    // Determine whether or not this might be a Liferay runtime portlet (which does not have the ability to add
View Full Code Here

    BridgeWriteBehindResponse bridgeWriteBehindResponse = null;

    if ((bridgeWriteBehindRenderResponseClass == null) || (bridgeWriteBehindResourceResponseClass == null)) {

      BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
      BridgeConfig bridgeConfig = bridgeContext.getBridgeConfig();

      if (bridgeWriteBehindRenderResponseClass == null) {
        String className = bridgeConfig.getWriteBehindRenderResponseWrapper();
        bridgeWriteBehindRenderResponseClass = loadClass(className, BridgeWriteBehindResponseRenderImpl.class);
      }
View Full Code Here

    try {

      // Get the UploadedFile from the request attribute map.
      ContextMapFactory contextMapFactory = (ContextMapFactory) FactoryExtensionFinder.getFactory(
          ContextMapFactory.class);
      BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
      Map<String, List<UploadedFile>> uploadedFileMap = contextMapFactory.getUploadedFileMap(bridgeContext);

      if (uploadedFileMap != null) {

        // Use reflection to create a dynamic proxy class that implements the RichFaces UploadedFile interface.
View Full Code Here

  public void buildView(FacesContext facesContext, UIViewRoot uiViewRoot) throws IOException {

    // Set a flag on the BridgeContext indicating that JSP AFTER_VIEW_CONTENT processing has been activated. The
    // flag is referenced by {@link ExternalContextImpl#getRequest()} and {@link ExternalContextImpl#getResponse()}
    // and is unset by {@link ExternalContextImpl#dispatch(String)}.
    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    bridgeContext.setProcessingAfterViewContent(true);

    logger.debug("Activated JSP AFTER_VIEW_CONTENT feature");

    // Have the wrapped VDL build the view.
    super.buildView(facesContext, uiViewRoot);
View Full Code Here

  @Override
  protected int getBufferSize(FacesContext facesContext) {

    if (bufferSize == null) {

      BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
      PortletConfig portletConfig = bridgeContext.getPortletConfig();
      bufferSize = PortletConfigParam.ResourceBufferSize.getIntegerValue(portletConfig);
    }

    return bufferSize;
  }
View Full Code Here

  }

  @Override
  protected boolean isAbleToSetHttpStatusCode(FacesContext facesContext) {

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletContainer portletContainer = bridgeContext.getPortletContainer();

    return portletContainer.isAbleToSetHttpStatusCode();
  }
View Full Code Here

    logger.debug("fromAction=[{0}] outcome=[{1}]", fromAction, outcome);

    NavigationCase navigationCase = getNavigationCase(facesContext, fromAction, outcome);

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();

    // Ask the wrapped NavigationHandler to perform the navigation.
    wrappedNavigationHandler.handleNavigation(facesContext, fromAction, outcome);

    if (navigationCase != null) {

      // Hack for http://jira.icesoft.org/browse/ICE-7996
      Iterator<FacesMessage> itr = facesContext.getMessages();

      while (itr.hasNext()) {
        FacesMessage facesMessage = itr.next();

        if (facesMessage.getDetail().contains("Unable to find matching navigation case")) {
          logger.warn("Removed bogus FacesMessage caused by http://jira.icesoft.org/browse/ICE-7996");
          itr.remove();
        }
      }

      // If the navigation-case is NOT a redirect, then directly encode the {@link PortletMode} and {@link
      // WindowState} to the response. Don't need to worry about the redirect case here because that's handled in
      // the BridgeContext#redirect(String) method. It would be nice to handle the redirect case here but it needs
      // to stay in BridgeContext#redirect(String) since it's possible for developers to call
      // ExternalContext.redirect(String) directly from their application.
      if (!navigationCase.isRedirect()) {

        String toViewId = navigationCase.getToViewId(facesContext);

        if (toViewId != null) {

          PortletResponse portletResponse = bridgeContext.getPortletResponse();

          if (portletResponse instanceof StateAwareResponse) {

            BridgeActionURL bridgeActionURL = bridgeContext.encodeActionURL(toViewId);

            try {

              BridgeNavigationCase bridgeNavigationCase = new BridgeNavigationCaseImpl(navigationCase);
              String portletMode = bridgeNavigationCase.getPortletMode();
View Full Code Here

    if ((fromPortletMode != null) && !fromPortletMode.equals(toPortletMode)) {
      logger.debug("fromPortletMode=[{0}] toPortletMode=[{1}]", fromPortletMode, toPortletMode);

      String currentViewId = facesContext.getViewRoot().getViewId();
      BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
      Map<String, String> defaultViewIdMap = bridgeContext.getDefaultViewIdMap();
      String portletModeViewId = defaultViewIdMap.get(toPortletMode.toString());

      if ((currentViewId != null) && (portletModeViewId != null)) {

        if (!currentViewId.equals(portletModeViewId)) {
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.