|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.kns.util.WebUtils
public class WebUtils
General helper methods for handling requests.
Field Summary | |
---|---|
static String |
FILE_UPLOAD_LIMIT_EXCEEDED_EXCEPTION_ALREADY_THROWN
A request attribute name that indicates that a FileUploadLimitExceededException has already been thrown for the
request. |
static String |
KEY_KUALI_FORM_IN_SESSION
|
Constructor Summary | |
---|---|
WebUtils()
|
Method Summary | |
---|---|
static boolean |
canAddNoteAttachment(Document document)
|
static boolean |
canDeleteNoteAttachment(Document document,
String attachmentTypeCode,
String authorUniversalIdentifier)
|
static boolean |
canFullyUnmaskField(String businessObjectClassName,
String fieldName,
KualiForm form)
|
static boolean |
canPartiallyUnmaskField(String businessObjectClassName,
String fieldName,
KualiForm form)
|
static boolean |
canViewNoteAttachment(Document document,
String attachmentTypeCode)
|
static boolean |
endsWithCoordinates(String parameter)
|
static String |
filterHtmlAndReplaceRiceMarkup(String inputString)
Excapes out HTML to prevent XSS attacks, and replaces the following strings to allow for a limited set of HTML tags [X] and [/X], where X represents any 1 or 2 letter string may be used to specify the equivalent tag in HTML (i.e. |
static String |
generateTabKey(String tabTitle)
Generates a String from the title that can be used as a Map key. |
static String |
getButtonImageUrl(String imageName)
Determines and returns the URL for question button images; looks first for a property "application.custom.image.url", and if that is missing, uses the image url returned by getDefaultButtonImageUrl() |
static String |
getDefaultButtonImageUrl(String imageName)
Generates a default button image URL, in the form of: ${kr.externalizable.images.url}buttonsmall_${imageName}.gif |
static String |
getFullyMaskedValue(String className,
String fieldName,
Object formObject,
String propertyName)
|
static int |
getIndexOfCoordinateExtension(String parameter)
|
static ConfigurationService |
getKualiConfigurationService()
|
static org.apache.struts.action.ActionForm |
getKualiForm(javax.servlet.http.HttpServletRequest request)
|
static org.apache.struts.action.ActionForm |
getKualiForm(javax.servlet.jsp.PageContext pageContext)
|
static long |
getMaxUploadSize(org.apache.struts.action.ActionForm form)
|
static void |
getMultipartParameters(javax.servlet.http.HttpServletRequest request,
org.apache.struts.action.ActionServletWrapper servletWrapper,
org.apache.struts.action.ActionForm form,
org.apache.struts.action.ActionMapping mapping)
|
static String |
getPartiallyMaskedValue(String className,
String fieldName,
Object formObject,
String propertyName)
|
static String |
getTabState(KualiForm form,
String tabKey)
JSTL function to return the tab state of the tab from the form. |
static void |
incrementTabIndex(KualiForm form,
String tabKey)
|
static boolean |
isDocumentSession(Document document,
PojoFormBase docForm)
|
static boolean |
isFormSessionDocument(PojoFormBase form)
|
static boolean |
isHiddenKimObjectType(String type,
String configParameter)
|
static boolean |
isInquiryHiddenField(String className,
String fieldName,
Object formObject,
String propertyName)
|
static boolean |
isPropertyEditable(Set<String> editableProperties,
String propertyName)
|
static void |
logRequestContents(org.apache.log4j.Logger logger,
org.apache.log4j.Level level,
javax.servlet.http.HttpServletRequest request)
Iterates through and logs (at the given level) all attributes and parameters of the given request onto the given Logger |
static String |
parseMethodToCall(org.apache.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request)
Checks for methodToCall parameter, and picks off the value using set dot notation. |
static String |
preserveWhitespace(String startingString)
Takes a string an converts the whitespace which would be ignored in an HTML document into HTML elements so the whitespace is preserved |
static void |
registerEditableProperty(PojoFormBase form,
String editablePropertyName)
|
static void |
reuseErrorMapFromPreviousRequest(KualiDocumentFormBase kualiDocumentFormBase)
|
static void |
saveMimeInputStreamAsFile(javax.servlet.http.HttpServletResponse response,
String contentType,
InputStream inStream,
String fileName,
int fileSize)
A file that is not of type text/plain or text/html can be output through the response using this method. |
static void |
saveMimeOutputStreamAsFile(javax.servlet.http.HttpServletResponse response,
String contentType,
ByteArrayOutputStream byteArrayOutputStream,
String fileName)
A file that is not of type text/plain or text/html can be output through the response using this method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String FILE_UPLOAD_LIMIT_EXCEEDED_EXCEPTION_ALREADY_THROWN
FileUploadLimitExceededException
has already been thrown for the
request.
public static String KEY_KUALI_FORM_IN_SESSION
Constructor Detail |
---|
public WebUtils()
Method Detail |
---|
public static String parseMethodToCall(org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request)
request
-
public static void logRequestContents(org.apache.log4j.Logger logger, org.apache.log4j.Level level, javax.servlet.http.HttpServletRequest request)
request
- logger
- public static void saveMimeOutputStreamAsFile(javax.servlet.http.HttpServletResponse response, String contentType, ByteArrayOutputStream byteArrayOutputStream, String fileName) throws IOException
response
- contentType
- outStream
- fileName
-
IOException
public static void saveMimeInputStreamAsFile(javax.servlet.http.HttpServletResponse response, String contentType, InputStream inStream, String fileName, int fileSize) throws IOException
response
- contentType
- outStream
- fileName
-
IOException
public static String getTabState(KualiForm form, String tabKey)
form
- tabKey
-
public static void incrementTabIndex(KualiForm form, String tabKey)
public static String generateTabKey(String tabTitle)
tabTitle
-
public static void getMultipartParameters(javax.servlet.http.HttpServletRequest request, org.apache.struts.action.ActionServletWrapper servletWrapper, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
public static long getMaxUploadSize(org.apache.struts.action.ActionForm form)
public static void registerEditableProperty(PojoFormBase form, String editablePropertyName)
public static boolean isDocumentSession(Document document, PojoFormBase docForm)
public static boolean isFormSessionDocument(PojoFormBase form)
public static org.apache.struts.action.ActionForm getKualiForm(javax.servlet.jsp.PageContext pageContext)
public static org.apache.struts.action.ActionForm getKualiForm(javax.servlet.http.HttpServletRequest request)
public static boolean isPropertyEditable(Set<String> editableProperties, String propertyName)
public static boolean endsWithCoordinates(String parameter)
public static int getIndexOfCoordinateExtension(String parameter)
public static boolean isInquiryHiddenField(String className, String fieldName, Object formObject, String propertyName)
public static boolean isHiddenKimObjectType(String type, String configParameter)
public static String getFullyMaskedValue(String className, String fieldName, Object formObject, String propertyName)
public static String getPartiallyMaskedValue(String className, String fieldName, Object formObject, String propertyName)
public static boolean canFullyUnmaskField(String businessObjectClassName, String fieldName, KualiForm form)
public static boolean canPartiallyUnmaskField(String businessObjectClassName, String fieldName, KualiForm form)
public static boolean canAddNoteAttachment(Document document)
public static boolean canViewNoteAttachment(Document document, String attachmentTypeCode)
public static boolean canDeleteNoteAttachment(Document document, String attachmentTypeCode, String authorUniversalIdentifier)
public static void reuseErrorMapFromPreviousRequest(KualiDocumentFormBase kualiDocumentFormBase)
public static String filterHtmlAndReplaceRiceMarkup(String inputString)
inputString
-
public static String getButtonImageUrl(String imageName)
imageName
- the name of the image to find a button for
public static String getDefaultButtonImageUrl(String imageName)
imageName
- the image name to generate a default button name for
public static ConfigurationService getKualiConfigurationService()
public static String preserveWhitespace(String startingString)
startingString
- The string to preserve whitespace in
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |