|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.MediaManager
A tool for managing various media properties. Given a request object, MediaManager determines a client browser type (media). MediaManager also provides information on the mime type that generated response should carry.
Field Summary | |
static java.lang.String |
NULL_USER_AGENT
A user agent string to use when the user-agent header value itself is null. |
static java.lang.String |
UNKNOWN
|
Constructor Summary | |
MediaManager()
Constructs a MediaManager |
|
MediaManager(java.lang.String mediaPropsFile,
java.lang.String mimePropsFile,
java.lang.String serializerPropsFile)
Constructor that initializes all of the property tables. |
Method Summary | |
java.lang.String |
getDefaultMedia()
Return a default media type. |
java.lang.String |
getMedia(BrowserInfo bi)
Determines a media name from the browser info object. |
java.lang.String |
getMedia(javax.servlet.http.HttpServletRequest req)
Determines a media name from the request object. |
java.lang.String |
getReturnMimeType(javax.servlet.http.HttpServletRequest req)
Determines a mime name from the request object. |
java.lang.String |
getReturnMimeType(java.lang.String mediaType)
Determines a mime name from a media type name. |
BaseMarkupSerializer |
getSerializer(javax.servlet.http.HttpServletRequest req,
java.io.OutputStream out)
Automatically determines the media type from the request object, |
BaseMarkupSerializer |
getSerializer(javax.servlet.http.HttpServletRequest req,
java.io.Writer out)
Automatically determines the media type from the request object, |
BaseMarkupSerializer |
getSerializer(java.lang.String mediaType,
java.io.OutputStream out)
Another version of getSerializer() with OutputStream as one of the parameters. |
BaseMarkupSerializer |
getSerializer(java.lang.String mediaType,
java.io.Writer out)
Determines and configures a serialzier that is proper for the specified media type. |
BaseMarkupSerializer |
getSerializerByName(java.lang.String serializerName,
java.io.OutputStream out)
Gets a serializer by name which writes to the provided OutputStream |
BaseMarkupSerializer |
getSerializerByName(java.lang.String serializerName,
java.io.Writer out)
Gets a serializer by name which writes to the provided Writer |
void |
setMediaProps(java.lang.String uri)
Initializes media properties table. |
void |
setMimeProps(java.lang.String uri)
Initializes mime properties table. |
void |
setSerializerProps(java.lang.String uri)
Initializes serializer properties table. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String NULL_USER_AGENT
public static final java.lang.String UNKNOWN
Constructor Detail |
public MediaManager()
public MediaManager(java.lang.String mediaPropsFile, java.lang.String mimePropsFile, java.lang.String serializerPropsFile)
mediaPropsFile
- location of the media properties filemimePropsFile
- location of the mime properties fileserializerPropsFile
- location of the serializer properties fileMethod Detail |
public void setMediaProps(java.lang.String uri)
uri
- location of the media properties file, complete with the filenamepublic void setMimeProps(java.lang.String uri)
uri
- location of the mime properties file, complete with the filenamepublic void setSerializerProps(java.lang.String uri)
uri
- location of the serializer properties file, complete with the filenamepublic java.lang.String getMedia(javax.servlet.http.HttpServletRequest req)
req
- the request object
public java.lang.String getMedia(BrowserInfo bi)
bi
- the browser info
public java.lang.String getDefaultMedia()
public java.lang.String getReturnMimeType(javax.servlet.http.HttpServletRequest req)
req
- the request object
public java.lang.String getReturnMimeType(java.lang.String mediaType)
mediaType
- the media type name
public BaseMarkupSerializer getSerializer(java.lang.String mediaType, java.io.Writer out)
mediaType
- media nameout
- output writer
public BaseMarkupSerializer getSerializerByName(java.lang.String serializerName, java.io.OutputStream out) throws java.io.UnsupportedEncodingException
serializerName
- out
-
java.io.UnsupportedEncodingException
public BaseMarkupSerializer getSerializerByName(java.lang.String serializerName, java.io.Writer out)
serializerName
- out
-
public BaseMarkupSerializer getSerializer(java.lang.String mediaType, java.io.OutputStream out) throws java.io.UnsupportedEncodingException
mediaType
- media type stringout
- output stream
java.io.UnsupportedEncodingException
public BaseMarkupSerializer getSerializer(javax.servlet.http.HttpServletRequest req, java.io.Writer out)
req
- the request objectout
- the output writer object
public BaseMarkupSerializer getSerializer(javax.servlet.http.HttpServletRequest req, java.io.OutputStream out) throws java.io.UnsupportedEncodingException
req
- the request objectout
- the output stream object
java.io.UnsupportedEncodingException
|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |