|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.app.util.Util
org.dspace.app.webui.util.UIUtil
public class UIUtil
Miscellaneous UI utility methods
| Field Summary | |
|---|---|
static Logger |
log
log4j category |
| Constructor Summary | |
|---|---|
UIUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
displayDate(DCDate d,
boolean time,
boolean localTime,
javax.servlet.http.HttpServletRequest request)
Write a human-readable version of a DCDate. |
static Collection |
getCollectionLocation(javax.servlet.http.HttpServletRequest request)
Get the current collection location, that is, where the user "is". |
static Community |
getCommunityLocation(javax.servlet.http.HttpServletRequest request)
Get the current community location, that is, where the user "is". |
static java.lang.String |
getOriginalURL(javax.servlet.http.HttpServletRequest request)
Get the original request URL. |
static java.lang.String |
getRequestLogInfo(javax.servlet.http.HttpServletRequest request)
Return a string for logging, containing useful information about the current request - the URL, the method and parameters. |
static java.util.Locale |
getSessionLocale(javax.servlet.http.HttpServletRequest request)
Get the Locale for a session according to the user's language selection or language preferences. |
static Context |
obtainContext(javax.servlet.http.HttpServletRequest request)
Obtain a new context object. |
static void |
sendAlert(javax.servlet.http.HttpServletRequest request,
java.lang.Exception exception)
Send an alert to the designated "alert recipient" - that is, when a database error or internal error occurs, this person is sent an e-mail with details. |
static void |
setBitstreamDisposition(java.lang.String filename,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Evaluate filename and client and encode appropriate disposition |
static void |
storeOriginalURL(javax.servlet.http.HttpServletRequest request)
Put the original request URL into the request object as an attribute for later use. |
| Methods inherited from class org.dspace.app.util.Util |
|---|
encodeBitstreamName, encodeBitstreamName, formatFileSize, getBoolParameter, getIntParameter, getIntParameters, getSourceVersion, getSubmitButton, nonBreakSpace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Logger log
| Constructor Detail |
|---|
public UIUtil()
| Method Detail |
|---|
public static Context obtainContext(javax.servlet.http.HttpServletRequest request)
throws java.sql.SQLException
request - the HTTP request
java.sql.SQLExceptionpublic static Community getCommunityLocation(javax.servlet.http.HttpServletRequest request)
null if there is no location, i.e. "all of DSpace"
is the location.
request - current HTTP request
public static Collection getCollectionLocation(javax.servlet.http.HttpServletRequest request)
request - current HTTP request
public static void storeOriginalURL(javax.servlet.http.HttpServletRequest request)
request - the HTTP requestpublic static java.lang.String getOriginalURL(javax.servlet.http.HttpServletRequest request)
request - the HTTP request
public static java.lang.String displayDate(DCDate d,
boolean time,
boolean localTime,
javax.servlet.http.HttpServletRequest request)
d - the datetime - if true, display the time with the datelocalTime - if true, adjust for local timezone, otherwise GMTrequest - the servlet request
public static java.lang.String getRequestLogInfo(javax.servlet.http.HttpServletRequest request)
request - the request object.
public static java.util.Locale getSessionLocale(javax.servlet.http.HttpServletRequest request)
request - the request Object
public static void sendAlert(javax.servlet.http.HttpServletRequest request,
java.lang.Exception exception)
The recipient is configured via the "alert.recipient" property in
dspace.cfg. If this property is omitted, no alerts are
sent.
This method "swallows" any exception that might occur - it will just be logged. This is because this method will usually be invoked as part of an error handling routine anyway.
request - the HTTP request leading to the errorexception - the exception causing the error, or null
public static void setBitstreamDisposition(java.lang.String filename,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
filename - request - response -
java.io.UnsupportedEncodingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||