Package com.liferay.faces.bridge.context

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


      portletContainer.afterPhase(phaseEvent);
    }
  }

  public void beforePhase(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.beforePhase(phaseEvent);
    }
View Full Code Here


      if (submittedValue != null) {

        // 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);

        List<UploadedFile> uploadedFiles = uploadedFileMap.get(clientId);

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

  // Protected Data Members
  protected boolean namespacedParameters;

  public ResponseWriterBridgeCompat_2_0_Impl(ResponseWriter wrappedResponseWriter) {

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletContainer portletContainer = bridgeContext.getPortletContainer();
    boolean portletContainerNamespacesParameters = portletContainer.isNamespacedParameters();
    this.namespacedParameters = portletContainerNamespacesParameters && JSF_RUNTIME_SUPPORTS_NAMESPACING_VIEWSTATE;
  }
View Full Code Here

    facesContext.responseComplete();
  }

  public HeadResponseWriter getHeadResponseWriter(ResponseWriter wrappableResponseWriter) {

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    HeadResponseWriter headResponseWriter = new HeadResponseWriterImpl(wrappableResponseWriter,
        bridgeContext.getPortletResponse());

    return headResponseWriter;
  }
View Full Code Here

  public PortletURL createActionURL(String fromURL) throws MalformedURLException {

    try {
      logger.debug("createActionURL fromURL=[" + fromURL + "]");

      BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
      MimeResponse mimeResponse = (MimeResponse) bridgeContext.getPortletResponse();
      PortletURL actionURL = createActionURL(mimeResponse);
      copyRequestParameters(fromURL, actionURL);

      return actionURL;
    }
View Full Code Here

  public PortletURL createRedirectURL(String fromURL, Map<String, List<String>> parameters)
    throws MalformedURLException {

    PortletURL redirectURL = null;

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

    if ((portletRequestPhase == Bridge.PortletPhase.RENDER_PHASE) ||
        (portletRequestPhase == Bridge.PortletPhase.RESOURCE_PHASE)) {

      try {
        logger.debug("createRedirectURL fromURL=[" + fromURL + "]");

        MimeResponse mimeResponse = (MimeResponse) bridgeContext.getPortletResponse();
        redirectURL = mimeResponse.createRenderURL();
        copyRequestParameters(fromURL, redirectURL);

        if (parameters != null) {
          Set<String> parameterNames = parameters.keySet();
View Full Code Here

    return redirectURL;
  }

  public PortletURL createRenderURL(String fromURL) throws MalformedURLException {
    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletPhase portletRequestPhase = bridgeContext.getPortletRequestPhase();

    if ((portletRequestPhase == Bridge.PortletPhase.RENDER_PHASE) ||
        (portletRequestPhase == Bridge.PortletPhase.RESOURCE_PHASE)) {

      try {
        logger.debug("createRenderURL fromURL=[" + fromURL + "]");

        MimeResponse mimeResponse = (MimeResponse) bridgeContext.getPortletResponse();
        PortletURL renderURL = createRenderURL(mimeResponse);
        copyRequestParameters(fromURL, renderURL);

        return renderURL;
      }
View Full Code Here

    try {
      logger.debug("createResourceURL fromURL=[" + fromURL + "]");

      // Ask the portlet container to create a portlet resource URL.
      BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
      MimeResponse mimeResponse = (MimeResponse) bridgeContext.getPortletResponse();
      ResourceURL resourceURL = createResourceURL(mimeResponse);

      // If the "javax.faces.resource" token is found in the URL, then
      int tokenPos = fromURL.indexOf(ResourceConstants.JAVAX_FACES_RESOURCE);
View Full Code Here

    }
  }

  public void redirect(String url) throws IOException {

    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletResponse portletResponse = bridgeContext.getPortletResponse();

    if (portletResponse instanceof ActionResponse) {
      ActionResponse actionResponse = (ActionResponse) portletResponse;
      actionResponse.sendRedirect(url);
    }
    else if (portletResponse instanceof ResourceResponse) {
      FacesContext facesContext = FacesContext.getCurrentInstance();

      if (isJSF2PartialRequest(facesContext)) {
        redirectJSF2PartialResponse(facesContext, (ResourceResponse) portletResponse, url);
      }
      else {
        throw new UnsupportedEncodingException(
          "Can only redirect during RESOURCE_PHASE if a JSF partial/Ajax request has been triggered");
      }
    }
    else {
      throw new UnsupportedEncodingException("Unable to redirect during " +
        bridgeContext.getPortletRequestPhase());
    }
  }
View Full Code Here

  public boolean isAbleToForwardOnDispatch() {
    return true;
  }

  public String[] getHeader(String name) {
    BridgeContext bridgeContext = BridgeContext.getCurrentInstance();
    PortletRequest portletRequest = bridgeContext.getPortletRequest();
    Enumeration<String> properties = portletRequest.getProperties(name);
    List<String> propertyList = new ArrayList<String>();

    while (properties.hasMoreElements()) {
      propertyList.add(properties.nextElement());
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.