|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.MediaManager
public class 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.
Nested Class Summary | |
---|---|
(package private) class |
MediaManager.OrderedProps
COPIED FROM XALAN SOURCE Stores the keys and values from a file (similar to a properties file) and can return the first value which has a key contained in its string. |
Field Summary | |
---|---|
private static org.apache.commons.logging.Log |
log
|
private static MediaManager |
MEDIAMANAGER
|
protected MediaManager.OrderedProps |
mediaProps
|
private static java.lang.String |
mediaPropsUrl
|
protected MediaManager.OrderedProps |
mimeProps
|
private static java.lang.String |
mimePropsUrl
|
static java.lang.String |
NULL_USER_AGENT
A user agent string to use when the user-agent header value itself is null. |
private static boolean |
omitDoctype
As of uPortal 2.5.1, this property is "no" (meaning false) in the distributed portal.properties. |
private static boolean |
outputIndenting
|
protected MediaManager.OrderedProps |
serializerProps
|
private static java.lang.String |
serializerPropsUrl
|
static java.lang.String |
UNKNOWN
|
Constructor Summary | |
---|---|
private |
MediaManager()
Constructs a MediaManager |
private |
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. |
static MediaManager |
getMediaManager()
7/25/05 - UP-1181 - change MediaManager into a singleton Returns the default MediaManager singleton |
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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
protected MediaManager.OrderedProps mediaProps
protected MediaManager.OrderedProps mimeProps
protected MediaManager.OrderedProps serializerProps
private static boolean outputIndenting
private static boolean omitDoctype
private static final java.lang.String mediaPropsUrl
private static final java.lang.String mimePropsUrl
private static final java.lang.String serializerPropsUrl
private static final MediaManager MEDIAMANAGER
public static final java.lang.String NULL_USER_AGENT
public static final java.lang.String UNKNOWN
Constructor Detail |
---|
private MediaManager()
private 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 static MediaManager getMediaManager()
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |