Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
WebUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canAddNoteAttachment(org.kuali.rice.krad.document.Document document) |
static boolean |
canDeleteNoteAttachment(org.kuali.rice.krad.document.Document document,
String attachmentTypeCode,
String authorUniversalIdentifier) |
static boolean |
canFullyUnmaskField(String businessObjectClassName,
String fieldName,
org.kuali.rice.kns.web.struts.form.KualiForm form) |
static boolean |
canPartiallyUnmaskField(String businessObjectClassName,
String fieldName,
org.kuali.rice.kns.web.struts.form.KualiForm form) |
static boolean |
canViewNoteAttachment(org.kuali.rice.krad.document.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 |
getAttachmentImageForUrl(String contentType) |
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 String |
getKimGroupDisplayName(String groupId) |
static org.kuali.rice.core.api.config.property.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 |
getPrincipalDisplayName(String principalId) |
static String |
getRoleDisplayName(org.kuali.rice.kew.api.action.ActionRequest actionRequest)
Takes an
ActionRequest with a recipient type of
RecipientType.ROLE and returns the display name for the role. |
static String |
getTabState(org.kuali.rice.kns.web.struts.form.KualiForm form,
String tabKey)
JSTL function to return the tab state of the tab from the form.
|
static org.springframework.transaction.PlatformTransactionManager |
getTransactionManager() |
static void |
incrementTabIndex(org.kuali.rice.kns.web.struts.form.KualiForm form,
String tabKey) |
static boolean |
isDocumentSession(org.kuali.rice.krad.document.Document document,
org.kuali.rice.kns.web.struts.form.pojo.PojoFormBase docForm) |
static boolean |
isFormSessionDocument(org.kuali.rice.kns.web.struts.form.pojo.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(org.kuali.rice.kns.web.struts.form.pojo.PojoFormBase form,
String editablePropertyName) |
static void |
reopenInactiveRecords(List<org.kuali.rice.kns.web.ui.Section> sections,
Map<String,String> tabStates,
String collectionName)
Attempts to reopen sub tabs which would have been closed for inactive records
|
static void |
reuseErrorMapFromPreviousRequest(org.kuali.rice.kns.web.struts.form.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.
|
static String |
toAbsoluteURL(String base,
String path)
Returns an absolute URL which is a combination of a base part plus path,
or in the case that the path is already an absolute URL, the path alone
|
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
public WebUtils()
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
- byteArrayOutputStream
- fileName
- IOException
public static void saveMimeInputStreamAsFile(javax.servlet.http.HttpServletResponse response, String contentType, InputStream inStream, String fileName, int fileSize) throws IOException
response
- contentType
- inStream
- fileName
- IOException
public static String getTabState(org.kuali.rice.kns.web.struts.form.KualiForm form, String tabKey)
form
- tabKey
- public static void incrementTabIndex(org.kuali.rice.kns.web.struts.form.KualiForm form, String tabKey)
public static void reopenInactiveRecords(List<org.kuali.rice.kns.web.ui.Section> sections, Map<String,String> tabStates, String collectionName)
sections
- the list of Sections whose rows and fields to set the open tab state ontabStates
- the map of tabKey->tabState. This map will be modified to set entries to "OPEN"collectionName
- the name of the collection reopeningpublic 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(org.kuali.rice.kns.web.struts.form.pojo.PojoFormBase form, String editablePropertyName)
public static boolean isDocumentSession(org.kuali.rice.krad.document.Document document, org.kuali.rice.kns.web.struts.form.pojo.PojoFormBase docForm)
public static boolean isFormSessionDocument(org.kuali.rice.kns.web.struts.form.pojo.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, org.kuali.rice.kns.web.struts.form.KualiForm form)
public static boolean canPartiallyUnmaskField(String businessObjectClassName, String fieldName, org.kuali.rice.kns.web.struts.form.KualiForm form)
public static boolean canAddNoteAttachment(org.kuali.rice.krad.document.Document document)
public static boolean canViewNoteAttachment(org.kuali.rice.krad.document.Document document, String attachmentTypeCode)
public static boolean canDeleteNoteAttachment(org.kuali.rice.krad.document.Document document, String attachmentTypeCode, String authorUniversalIdentifier)
public static void reuseErrorMapFromPreviousRequest(org.kuali.rice.kns.web.struts.form.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 forpublic static String getAttachmentImageForUrl(String contentType)
public static String getDefaultButtonImageUrl(String imageName)
imageName
- the image name to generate a default button name forpublic static org.kuali.rice.core.api.config.property.ConfigurationService getKualiConfigurationService()
public static org.springframework.transaction.PlatformTransactionManager getTransactionManager()
public static String preserveWhitespace(String startingString)
startingString
- The string to preserve whitespace inpublic static String getKimGroupDisplayName(String groupId)
public static String getPrincipalDisplayName(String principalId)
public static String getRoleDisplayName(org.kuali.rice.kew.api.action.ActionRequest actionRequest)
ActionRequest
with a recipient type of
RecipientType.ROLE
and returns the display name for the role.actionRequest
- the action requestIllegalArgumentException
- if the action request is null, or the recipient type is not ROLEpublic static String toAbsoluteURL(String base, String path)
base
- the url base pathpath
- the path to append to baseCopyright © 2004–2015 The Kuali Foundation. All rights reserved.