org.jasig.portal.url.processing
Class ChannelRequestParameterProcessor

java.lang.Object
  extended by org.springframework.web.multipart.commons.CommonsFileUploadSupport
      extended by org.jasig.portal.url.processing.ChannelRequestParameterProcessor
All Implemented Interfaces:
IRequestParameterProcessor, DisposableBean

public class ChannelRequestParameterProcessor
extends CommonsFileUploadSupport
implements IRequestParameterProcessor, DisposableBean

Does request parameter processing on any request that does not explicitly target a portlet. Takes care of pulling out channel parameters and handling file uploads so the data can be passed into the ChannelRuntimeData for the targeted channel.

Version:
$Revision$
Author:
Eric Dalquist

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.web.multipart.commons.CommonsFileUploadSupport
CommonsFileUploadSupport.MultipartParsingResult
 
Field Summary
protected  org.apache.commons.logging.Log logger
           
static String UPLOAD_STATUS
           
 
Constructor Summary
ChannelRequestParameterProcessor()
           
 
Method Summary
 void destroy()
          Ensures the temp files from uploads are cleaned up correctly.
protected  String determineEncoding(HttpServletRequest request)
          Determine the encoding for the given request.
 IChannelRequestParameterManager getChannelRequestParameterManager()
           
protected  Map<String,MultipartDataSource[]> getMultipartDataSources(CommonsFileUploadSupport.MultipartParsingResult parsingResult)
          Convert's Spring's MultipartFile objects to uPortal's MultipartDataSource objects.
 IPortletRequestParameterManager getPortletRequestParameterManager()
           
protected  String getTargetChannelId(IWritableHttpServletRequest request)
          Determine the targeted channel ID for the request.
 IUserInstanceManager getUserInstanceManager()
           
protected  org.apache.commons.fileupload.FileUpload newFileUpload(org.apache.commons.fileupload.FileItemFactory fileItemFactory)
           
 boolean processParameters(IWritableHttpServletRequest request, HttpServletResponse response)
          Analyze current request, process necessary URL parameters, delivering information to the appropriate components.
 void setChannelRequestParameterManager(IChannelRequestParameterManager channelRequestParameterManager)
           
 void setPortletRequestParameterManager(IPortletRequestParameterManager portletRequestParameterManager)
           
 void setUserInstanceManager(IUserInstanceManager userInstanceManager)
           
 
Methods inherited from class org.springframework.web.multipart.commons.CommonsFileUploadSupport
cleanupFileItems, getDefaultEncoding, getFileItemFactory, getFileUpload, isUploadTempDirSpecified, newFileItemFactory, parseFileItems, prepareFileUpload, setDefaultEncoding, setMaxInMemorySize, setMaxUploadSize, setUploadTempDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPLOAD_STATUS

public static final String UPLOAD_STATUS
See Also:
Constant Field Values

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

ChannelRequestParameterProcessor

public ChannelRequestParameterProcessor()
Method Detail

getUserInstanceManager

public IUserInstanceManager getUserInstanceManager()
Returns:
the userInstanceManager

setUserInstanceManager

public void setUserInstanceManager(IUserInstanceManager userInstanceManager)
Parameters:
userInstanceManager - the userInstanceManager to set

getPortletRequestParameterManager

public IPortletRequestParameterManager getPortletRequestParameterManager()
Returns:
the portletRequestParameterManager

setPortletRequestParameterManager

public void setPortletRequestParameterManager(IPortletRequestParameterManager portletRequestParameterManager)
Parameters:
portletRequestParameterManager - the portletRequestParameterManager to set

getChannelRequestParameterManager

public IChannelRequestParameterManager getChannelRequestParameterManager()
Returns:
the channelRequestParameterManager

setChannelRequestParameterManager

public void setChannelRequestParameterManager(IChannelRequestParameterManager channelRequestParameterManager)
Parameters:
channelRequestParameterManager - the channelRequestParameterManager to set

processParameters

public boolean processParameters(IWritableHttpServletRequest request,
                                 HttpServletResponse response)
Description copied from interface: IRequestParameterProcessor
Analyze current request, process necessary URL parameters, delivering information to the appropriate components. This method can also add, modify and remove parameters on the request. If the request is not yet in a state where it can be completely processed this method may return false so that it can be called again after other processors have been allowed to execute. Even if false is returned as much processing as possible should happen for each pass.

Specified by:
processParameters in interface IRequestParameterProcessor

destroy

public void destroy()
             throws Exception
Ensures the temp files from uploads are cleaned up correctly.

Specified by:
destroy in interface DisposableBean
Throws:
Exception
See Also:
DisposableBean.destroy()

getTargetChannelId

protected String getTargetChannelId(IWritableHttpServletRequest request)
Determine the targeted channel ID for the request.

Parameters:
request - Current request.
Returns:
The targeted channel ID, null if no channel is targeted.

newFileUpload

protected org.apache.commons.fileupload.FileUpload newFileUpload(org.apache.commons.fileupload.FileItemFactory fileItemFactory)
Specified by:
newFileUpload in class CommonsFileUploadSupport

determineEncoding

protected String determineEncoding(HttpServletRequest request)
Determine the encoding for the given request. Can be overridden in subclasses.

The default implementation checks the request encoding, falling back to the default encoding specified for this resolver.

Parameters:
request - current HTTP request
Returns:
the encoding for the request (never null)
See Also:
ServletRequest.getCharacterEncoding(), CommonsFileUploadSupport.setDefaultEncoding(java.lang.String)

getMultipartDataSources

protected Map<String,MultipartDataSource[]> getMultipartDataSources(CommonsFileUploadSupport.MultipartParsingResult parsingResult)
Convert's Spring's MultipartFile objects to uPortal's MultipartDataSource objects.

Parameters:
parsingResult - The results of the multipart request parsing
Returns:
A Map of String parameter names to MultipartDataSource objects


Copyright © 2010 Jasig. All Rights Reserved.