Thread.currentThread().setContextClassLoader( pluginManager.getClassLoader( pluginId ) );
// String proxyClass = PentahoSystem.getSystemSetting( module+"/plugin.xml" ,
// "plugin/content-generators/"+contentGeneratorId,
// "content generator not found");
IParameterProvider requestParameters = new HttpRequestParameterProvider( request );
// see if this is an upload
// File uploading is a service provided by UploadFileServlet where appropriate protections
// are in place to prevent uploads that are too large.
// boolean isMultipart = ServletFileUpload.isMultipartContent(request);
// if (isMultipart) {
// requestParameters = new SimpleParameterProvider();
// // Create a factory for disk-based file items
// FileItemFactory factory = new DiskFileItemFactory();
//
// // Create a new file upload handler
// ServletFileUpload upload = new ServletFileUpload(factory);
//
// // Parse the request
// List<?> /* FileItem */items = upload.parseRequest(request);
// Iterator<?> iter = items.iterator();
// while (iter.hasNext()) {
// FileItem item = (FileItem) iter.next();
//
// if (item.isFormField()) {
// ((SimpleParameterProvider) requestParameters).setParameter(item.getFieldName(), item.getString());
// } else {
// String name = item.getName();
// ((SimpleParameterProvider) requestParameters).setParameter(name, item.getInputStream());
// }
// }
// }
response.setCharacterEncoding( LocaleHelper.getSystemEncoding() );
IMimeTypeListener listener = new HttpMimeTypeListener( request, response );
outputHandler = getOutputHandler( response, true );
outputHandler.setMimeTypeListener( listener );
IParameterProvider sessionParameters = new HttpSessionParameterProvider( session );
IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext();
Map<String, IParameterProvider> parameterProviders = new HashMap<String, IParameterProvider>();
parameterProviders.put( IParameterProvider.SCOPE_REQUEST, requestParameters );
parameterProviders.put( IParameterProvider.SCOPE_SESSION, sessionParameters );
parameterProviders.put( "headers", headerParams ); //$NON-NLS-1$