|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.rice.kns.util.WebUtils
public class WebUtils
General helper methods for handling requests.
Field Summary | |
---|---|
private static String |
APPLICATION_IMAGE_URL_PROPERTY_PREFIX
|
private static KualiConfigurationService |
configurationService
|
private static String |
DEFAULT_IMAGE_URL_PROPERTY_NAME
|
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. |
private static String |
IMAGE_COORDINATE_CLICKED_X_EXTENSION
|
private static String |
IMAGE_COORDINATE_CLICKED_Y_EXTENSION
|
static String |
KEY_KUALI_FORM_IN_SESSION
|
private static org.apache.log4j.Logger |
LOG
|
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 |
containsSensitiveDataPatternMatch(String fieldValue)
|
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 |
private static Map |
getFileParametersForMultipartRequest(javax.servlet.http.HttpServletRequest request,
org.apache.struts.upload.MultipartRequestHandler multipartHandler)
|
static String |
getFullyMaskedValue(String className,
String fieldName,
Object formObject,
String propertyName)
|
static int |
getIndexOfCoordinateExtension(String parameter)
|
static KualiConfigurationService |
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)
|
private static String |
getMethodToCallSettingAttribute(org.apache.struts.action.ActionForm form,
javax.servlet.http.HttpServletRequest request,
String string)
Parses out the methodToCall command and also sets the request attribute for the methodToCall. |
private static KualiMultipartRequestHandler |
getMultipartHandler(javax.servlet.http.HttpServletRequest request,
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)
|
private static boolean |
isMethodToCall(String string)
Checks if a string signifies a methodToCall string |
static boolean |
isProductionEnvironment()
|
static boolean |
isPropertyEditable(Set<String> editableProperties,
String propertyName)
|
private static void |
logArray(org.apache.log4j.Logger logger,
org.apache.log4j.Level level,
String arrayName,
Object[] array)
|
private static void |
logCollection(org.apache.log4j.Logger logger,
org.apache.log4j.Level level,
String collectionName,
Collection c)
|
private static void |
logMap(org.apache.log4j.Logger logger,
org.apache.log4j.Level level,
String mapName,
Map m)
|
private static void |
logObject(org.apache.log4j.Logger logger,
org.apache.log4j.Level level,
String objectName,
Object o)
|
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 |
private static void |
logThing(org.apache.log4j.Logger logger,
org.apache.log4j.Level level,
String thingName,
Object thing)
|
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 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 |
---|
private static final org.apache.log4j.Logger LOG
private static final String IMAGE_COORDINATE_CLICKED_X_EXTENSION
private static final String IMAGE_COORDINATE_CLICKED_Y_EXTENSION
private static final String APPLICATION_IMAGE_URL_PROPERTY_PREFIX
private static final String DEFAULT_IMAGE_URL_PROPERTY_NAME
public static final String FILE_UPLOAD_LIMIT_EXCEEDED_EXCEPTION_ALREADY_THROWN
FileUploadLimitExceededException
has already been thrown for the request.
private static KualiConfigurationService configurationService
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
-
private static boolean isMethodToCall(String string)
string
- the string to check
private static String getMethodToCallSettingAttribute(org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, String string)
form
- the ActionFormrequest
- the request to set the attribute onstring
- the methodToCall string
public static void logRequestContents(org.apache.log4j.Logger logger, org.apache.log4j.Level level, javax.servlet.http.HttpServletRequest request)
request
- logger
- private static void logArray(org.apache.log4j.Logger logger, org.apache.log4j.Level level, String arrayName, Object[] array)
private static void logCollection(org.apache.log4j.Logger logger, org.apache.log4j.Level level, String collectionName, Collection c)
private static void logMap(org.apache.log4j.Logger logger, org.apache.log4j.Level level, String mapName, Map m)
private static void logObject(org.apache.log4j.Logger logger, org.apache.log4j.Level level, String objectName, Object o)
private static void logThing(org.apache.log4j.Logger logger, org.apache.log4j.Level level, String thingName, Object thing)
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)
private static KualiMultipartRequestHandler getMultipartHandler(javax.servlet.http.HttpServletRequest request, org.apache.struts.action.ActionForm form) throws javax.servlet.ServletException
javax.servlet.ServletException
private static Map getFileParametersForMultipartRequest(javax.servlet.http.HttpServletRequest request, org.apache.struts.upload.MultipartRequestHandler multipartHandler)
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 boolean containsSensitiveDataPatternMatch(String fieldValue)
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 boolean isProductionEnvironment()
public static KualiConfigurationService getKualiConfigurationService()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |