|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.servlet.ServletRequestWrapper
javax.servlet.http.HttpServletRequestWrapper
com.aoindustries.website.framework.WebSiteRequest
public class WebSiteRequest
A WebSiteSettings contains all the values that a user may customize while they view the web site.
| Field Summary | |
|---|---|
protected WebPage |
sourcePage
|
| Fields inherited from interface javax.servlet.http.HttpServletRequest |
|---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
|---|---|
WebSiteRequest(WebPage sourcePage,
javax.servlet.http.HttpServletRequest req)
|
|
| Method Summary | |
|---|---|
protected static boolean |
appendParams(java.lang.StringBuilder SB,
java.lang.Object optParam,
java.util.List<java.lang.String> finishedParams,
boolean alreadyAppended)
Appends the parameters to a URL. |
protected boolean |
appendSettings(java.util.List<java.lang.String> finishedParams,
boolean alreadyAppended,
java.lang.StringBuilder SB)
|
java.lang.String |
getParameter(java.lang.String name)
|
java.util.Enumeration |
getParameterNames()
|
java.lang.String[] |
getParameterValues(java.lang.String name)
|
java.util.Random |
getRandom()
Gets the random number generator used for this request. |
static UploadedFile |
getUploadedFile(WebSiteUser owner,
long id,
javax.servlet.ServletContext context,
LoggerAccessor loggerAccessor)
Gets a file that was uploaded given its ID. |
java.util.List<UploadedFile> |
getUploadedFiles()
|
java.lang.String |
getURL(java.lang.Class<? extends WebPage> clazz)
|
java.lang.String |
getURL(java.lang.Class<? extends WebPage> clazz,
java.lang.Object param)
Gets the absolute URL to a web page. |
java.lang.String |
getURL(java.lang.String classAndParams)
Gets a relative URL from a String containing a classname and optional parameters. |
java.lang.String |
getURL(java.lang.String url,
boolean useEncryption,
java.lang.Object optParam)
Gets the URL String with the given parameters embedded, keeping the current settings. |
java.lang.String |
getURL(java.lang.String url,
boolean useEncryption,
java.lang.Object optParam,
boolean keepSettings)
Gets the absolute URL String, optionally with the settings embedded. |
java.lang.String |
getURL(java.lang.String classname,
java.lang.String params)
Gets a relative URL given its classname and optional parameters. |
java.lang.String |
getURL(WebPage page)
Gets the absolute URL to a web page. |
java.lang.String |
getURL(WebPage page,
boolean useEncryption,
java.lang.Object optParam)
Gets the absolute URL to a web page. |
java.lang.String |
getURL(WebPage page,
java.lang.Object optParam)
Gets the absolute URL to a web page. |
WebSiteUser |
getWebSiteUser(javax.servlet.http.HttpServletResponse resp)
Gets the person who is logged in or null if no login is performed for this request. |
boolean |
isBlackBerry()
Determines if the request is for a BlackBerry browser |
boolean |
isLinux()
Determines if the request is for a Linux browser |
boolean |
isLoggedIn()
Determines if the user is currently logged in. |
boolean |
isLynx()
Determines if the request is for a Lynx browser |
boolean |
isSecure()
|
void |
logout(javax.servlet.http.HttpServletResponse resp)
Logs out the current user or does nothing if not logged in. |
void |
printFormFields(com.aoindustries.io.ChainWriter out,
int indent)
Prints the hidden variables that contain all of the current settings. |
protected static void |
printHiddenField(com.aoindustries.io.ChainWriter out,
int indent,
java.lang.String name,
java.lang.String value)
Prints the hidden variables that contain all of the current settings. |
java.io.File |
rename(java.io.File file)
|
| Methods inherited from class javax.servlet.http.HttpServletRequestWrapper |
|---|
getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole |
| Methods inherited from class javax.servlet.ServletRequestWrapper |
|---|
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameterMap, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequest, getRequestDispatcher, getScheme, getServerName, getServerPort, removeAttribute, setAttribute, setCharacterEncoding, setRequest |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.ServletRequest |
|---|
getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameterMap, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, removeAttribute, setAttribute, setCharacterEncoding |
| Field Detail |
|---|
protected final WebPage sourcePage
| Constructor Detail |
|---|
public WebSiteRequest(WebPage sourcePage,
javax.servlet.http.HttpServletRequest req)
throws java.io.IOException,
java.sql.SQLException
java.io.IOException
java.sql.SQLException| Method Detail |
|---|
public java.util.Random getRandom()
throws java.io.IOException
java.io.IOException
protected static boolean appendParams(java.lang.StringBuilder SB,
java.lang.Object optParam,
java.util.List<java.lang.String> finishedParams,
boolean alreadyAppended)
public java.lang.String getURL(java.lang.String classAndParams)
throws java.io.IOException,
java.sql.SQLException
java.io.IOException
java.sql.SQLException
public java.lang.String getURL(java.lang.String classname,
java.lang.String params)
throws java.io.IOException,
java.sql.SQLException
java.io.IOException
java.sql.SQLException
public java.lang.String getURL(java.lang.String url,
boolean useEncryption,
java.lang.Object optParam,
boolean keepSettings)
throws java.io.IOException
java.io.IOException
protected boolean appendSettings(java.util.List<java.lang.String> finishedParams,
boolean alreadyAppended,
java.lang.StringBuilder SB)
public java.lang.String getParameter(java.lang.String name)
getParameter in interface javax.servlet.ServletRequestgetParameter in class javax.servlet.ServletRequestWrapperpublic java.util.Enumeration getParameterNames()
getParameterNames in interface javax.servlet.ServletRequestgetParameterNames in class javax.servlet.ServletRequestWrapperpublic java.lang.String[] getParameterValues(java.lang.String name)
getParameterValues in interface javax.servlet.ServletRequestgetParameterValues in class javax.servlet.ServletRequestWrapper
public java.lang.String getURL(WebPage page)
throws java.io.IOException,
java.sql.SQLException
java.io.IOException
java.sql.SQLException
public java.lang.String getURL(WebPage page,
java.lang.Object optParam)
throws java.io.IOException,
java.sql.SQLException
java.io.IOException
java.sql.SQLException
public java.lang.String getURL(WebPage page,
boolean useEncryption,
java.lang.Object optParam)
throws java.io.IOException,
java.sql.SQLException
java.io.IOException
java.sql.SQLException
public java.lang.String getURL(java.lang.Class<? extends WebPage> clazz,
java.lang.Object param)
throws java.io.IOException,
java.sql.SQLException
java.io.IOException
java.sql.SQLException
public java.lang.String getURL(java.lang.Class<? extends WebPage> clazz)
throws java.io.IOException,
java.sql.SQLException
java.io.IOException
java.sql.SQLException
public java.lang.String getURL(java.lang.String url,
boolean useEncryption,
java.lang.Object optParam)
throws java.io.IOException
url - the URL from the top of the webapp, without any beginning slashuseEncryption - if true the link refers to an page that should be served over encryptionoptParam - any number of additional parameters. This parameter can accept several types of
objects. The following is a list of supported objects and a brief description of its
behavior.
Parameters should already be URL encoded and have & as separator.
String - appended to the end of the parameters, assumed to be in the
format name=value
String[] - name and value pairs, the first element of each pair is the
name, the second is the value
java.lang.IllegalArgumentException - if optParam is not a supported object
java.io.IOExceptionpublic boolean isLynx()
public boolean isBlackBerry()
public boolean isLinux()
public boolean isSecure()
isSecure in interface javax.servlet.ServletRequestisSecure in class javax.servlet.ServletRequestWrapper
public void printFormFields(com.aoindustries.io.ChainWriter out,
int indent)
throws java.io.IOException
java.io.IOException
protected static void printHiddenField(com.aoindustries.io.ChainWriter out,
int indent,
java.lang.String name,
java.lang.String value)
throws java.io.IOException
java.io.IOExceptionpublic java.util.List<UploadedFile> getUploadedFiles()
public static UploadedFile getUploadedFile(WebSiteUser owner,
long id,
javax.servlet.ServletContext context,
LoggerAccessor loggerAccessor)
throws java.lang.SecurityException
java.lang.SecurityException - if the ID is not assigned to the person logged inpublic java.io.File rename(java.io.File file)
rename in interface com.oreilly.servlet.multipart.FileRenamePolicy
public WebSiteUser getWebSiteUser(javax.servlet.http.HttpServletResponse resp)
throws java.io.IOException,
java.sql.SQLException,
com.aoindustries.security.LoginException
null if no login is performed for this request.
com.aoindustries.security.LoginException - if an invalid login attempt is made or the user credentials are not found
java.io.IOException
java.sql.SQLException
public boolean isLoggedIn()
throws java.io.IOException,
java.sql.SQLException
java.io.IOException
java.sql.SQLExceptionpublic void logout(javax.servlet.http.HttpServletResponse resp)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||