Examples of BridgeActionURL


Examples of com.liferay.faces.bridge.context.url.BridgeActionURL

          PortletResponse portletResponse = bridgeContext.getPortletResponse();

          if (portletResponse instanceof StateAwareResponse) {

            BridgeActionURL bridgeActionURL = bridgeContext.encodeActionURL(toViewId);

            try {

              BridgeNavigationCase bridgeNavigationCase = new BridgeNavigationCaseImpl(navigationCase);
              String portletMode = bridgeNavigationCase.getPortletMode();

              if (portletMode != null) {
                bridgeActionURL.setParameter(Bridge.PORTLET_MODE_PARAMETER, portletMode);
              }

              String windowState = bridgeNavigationCase.getWindowState();

              if (windowState != null) {
                bridgeActionURL.setParameter(Bridge.PORTLET_WINDOWSTATE_PARAMETER, windowState);
              }

              bridgeActionURL.applyToResponse((StateAwareResponse) portletResponse);
            }
            catch (PortletModeException e) {
              logger.error(e.getMessage());
            }
            catch (WindowStateException e) {
View Full Code Here

Examples of com.liferay.faces.bridge.context.url.BridgeActionURL

    logger.debug("encodeActionURL fromURL=[{0}]", url);

    String currentFacesViewId = FacesContext.getCurrentInstance().getViewRoot().getViewId();

    BridgeActionURL bridgeActionURL = bridgeURLFactory.getBridgeActionURL(url, currentFacesViewId, this);

    // Determine the target of the specified URL, which could be a Faces-View or a
    // Non-Faces-View.
    String contextRelativeViewPath = bridgeActionURL.getContextRelativePath();
    List<String> defaultSuffixes = bridgeConfig.getConfiguredSuffixes();
    List<ConfiguredServletMapping> facesServletMappings = bridgeConfig.getConfiguredFacesServletMappings();
    FacesView targetFacesView = new FacesViewImpl(contextRelativeViewPath, defaultSuffixes, facesServletMappings);

    // If the specified URL starts with "portlet:", then
    if (bridgeActionURL.isPortletScheme()) {

      // If the "_jsfBridgeViewId" URL parameter is equal to "_jsfBridgeCurrentView" then the
      // URL is self-referencing and the "_jsfBridgeViewId" parameter muse be removed from the
      // URL.
      String facesViewIdParameter = bridgeActionURL.getParameter(Bridge.FACES_VIEW_ID_PARAMETER);

      if (Bridge.FACES_USE_CURRENT_VIEW_PARAMETER.equals(facesViewIdParameter)) {
        bridgeActionURL.setSelfReferencing(true);
        bridgeActionURL.removeParameter(Bridge.FACES_VIEW_ID_PARAMETER);
      }

      // If the "_jsfBridgeViewPath" URL parameter is equal to "_jsfBridgeCurrentView" then
      // the URL is self-referencing and the "_jsfBridgeViewPath" parameter muse be removed
      // from the URL.
      String facesViewPathParameter = bridgeActionURL.getParameter(Bridge.FACES_VIEW_PATH_PARAMETER);

      if (Bridge.FACES_USE_CURRENT_VIEW_PARAMETER.equals(facesViewPathParameter)) {
        bridgeActionURL.setSelfReferencing(true);
        bridgeActionURL.removeParameter(Bridge.FACES_VIEW_PATH_PARAMETER);
      }
    }

    // Otherwise, the specified URL must be for a path-encoded URL (either a Faces-View or
    // Non-Faces-View)
    else {

      // If the specified URL has a "javax.portlet.faces.DirectLink" parameter with a value of
      // "false", then remove it from the map of parameters as required by the Bridge Spec.
      String directLinkParam = bridgeActionURL.getParameter(Bridge.DIRECT_LINK);

      if (BooleanHelper.isFalseToken(directLinkParam)) {
        bridgeActionURL.removeParameter(Bridge.DIRECT_LINK);
      }

      if (!bridgeActionURL.isAbsolute() && !targetFacesView.isExtensionMapped() &&
          !targetFacesView.isPathMapped() && !url.startsWith(StringPool.POUND)) {
        bridgeActionURL.setParameter(Bridge.NONFACES_TARGET_PATH_PARAMETER, contextRelativeViewPath);
      }

    }

    return bridgeActionURL;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.