Package com.liferay.faces.util.context.map

Examples of com.liferay.faces.util.context.map.MultiPartFormData


      // Note: ICEfaces ace:fileEntry relies on its own mechanism for handling file upload.
      if (!ICEFACES_DETECTED && (contentType != null) &&
          contentType.toLowerCase().startsWith(BridgeConstants.MULTIPART_CONTENT_TYPE_PREFIX)) {

        MultiPartFormData multiPartFormData = (MultiPartFormData) portletRequest.getAttribute(
            MULTIPART_FORM_DATA_FQCN);

        if (multiPartFormData == null) {
          facesRequestParameterMap = new FacesRequestParameterMapImpl(namespace, portletContainer,
              bridgeRequestScope, facesViewParameterMap, defaultRenderKitId);

          MultiPartFormDataProcessor multiPartFormDataProcessor = new MultiPartFormDataProcessorImpl();
          Map<String, List<UploadedFile>> uploadedFileMap = multiPartFormDataProcessor.process(
              clientDataRequest, bridgeContext.getPortletConfig(), facesRequestParameterMap);

          multiPartFormData = new MultiPartFormDataImpl(facesRequestParameterMap, uploadedFileMap);

          // Save the multipart/form-data in a request attribute so that it can be referenced later-on in the
          // JSF lifecycle by file upload component renderers.
          portletRequest.setAttribute(MULTIPART_FORM_DATA_FQCN, multiPartFormData);
        }
        else {
          facesRequestParameterMap = multiPartFormData.getFacesRequestParameterMap();
        }
      }
    }

    if (facesRequestParameterMap == null) {
View Full Code Here


  }

  @Override
  public Map<String, List<UploadedFile>> getUploadedFileMap(BridgeContext bridgeContext) {
    PortletRequest portletRequest = bridgeContext.getPortletRequest();
    MultiPartFormData multiPartFormData = (MultiPartFormData) portletRequest.getAttribute(MULTIPART_FORM_DATA_FQCN);
    Map<String, List<UploadedFile>> uploadedFileMap = multiPartFormData.getUploadedFileMap();

    return uploadedFileMap;
  }
View Full Code Here

    Map<String, List<UploadedFile>> uploadedFileMap;

    if (LIFERAY_FACES_BRIDGE_DETECTED) {
      Map<String, Object> requestAttributeMap = facesContext.getExternalContext().getRequestMap();
      MultiPartFormData multiPartFormData = (MultiPartFormData) requestAttributeMap.get(MultiPartFormData.class
          .getName());
      uploadedFileMap = multiPartFormData.getUploadedFileMap();
    }
    else {
      InputFileDecoder inputFileDecoder = getInputFileDecoder();
      uploadedFileMap = inputFileDecoder.decode(facesContext, location);
    }
View Full Code Here

TOP

Related Classes of com.liferay.faces.util.context.map.MultiPartFormData

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.