Package org.kuali.rice.kns.util
Class WebUtils
java.lang.Object
org.kuali.rice.kns.util.WebUtils
Deprecated.
Only used in KNS classes, use KRAD.
General helper methods for handling requests.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.A request attribute name that indicates that aFileUploadLimitExceededExceptionhas already been thrown for the request.static StringDeprecated. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddParametersToFinder(Map<String, Object> params, org.kuali.rice.krad.keyvalues.KeyValuesFinder finder) Deprecated.static booleancanAddNoteAttachment(org.kuali.rice.krad.document.Document document) Deprecated.static booleancanDeleteNoteAttachment(org.kuali.rice.krad.document.Document document, String attachmentTypeCode, String authorUniversalIdentifier) Deprecated.static booleancanFullyUnmaskField(String businessObjectClassName, String fieldName, KualiForm form) Deprecated.static booleancanPartiallyUnmaskField(String businessObjectClassName, String fieldName, KualiForm form) Deprecated.static booleanDeprecated.static booleancanViewNoteAttachment(org.kuali.rice.krad.document.Document document, String attachmentTypeCode) Deprecated.static booleanendsWithCoordinates(String parameter) Deprecated.static StringfilterHtmlAndReplaceRiceMarkup(String inputString) Deprecated.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 StringgenerateTabKey(String tabTitle) Deprecated.Generates a String from the title that can be used as a Map key.static StringgetAttachmentImageForUrl(String contentType) Deprecated.static StringgetButtonImageUrl(String imageName) Deprecated.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 StringgetDefaultButtonImageUrl(String imageName) Deprecated.Generates a default button image URL, in the form of: ${kr.externalizable.images.url}buttonsmall_${imageName}.gifstatic StringgetFullyMaskedValue(String className, String fieldName, Object formObject, String propertyName) Deprecated.static intgetIndexOfCoordinateExtension(String parameter) Deprecated.protected static org.kuali.rice.krad.keyvalues.KeyValuesFindergetKeyFinder(String valuesFinderClassName) Deprecated.static StringgetKimGroupDisplayName(String groupId) Deprecated.static org.kuali.rice.core.api.config.property.ConfigurationServiceDeprecated.static org.apache.struts.action.ActionFormgetKualiForm(javax.servlet.http.HttpServletRequest request) Deprecated.static org.apache.struts.action.ActionFormgetKualiForm(javax.servlet.jsp.PageContext pageContext) Deprecated.static longgetMaxUploadSize(org.apache.struts.action.ActionForm form) Deprecated.static voidgetMultipartParameters(javax.servlet.http.HttpServletRequest request, org.apache.struts.action.ActionServletWrapper servletWrapper, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping) Deprecated.static ListgetOptionList(String valuesFinderClassName, Map params) Deprecated.Returns a list of key/value pairs for displaying in an HTML option for a select list.static StringgetPartiallyMaskedValue(String className, String fieldName, Object formObject, String propertyName) Deprecated.static StringgetPrincipalDisplayName(String principalId) Deprecated.static StringgetRoleDisplayName(org.kuali.rice.kew.api.action.ActionRequest actionRequest) Deprecated.Takes anActionRequestwith a recipient type ofRecipientType.ROLEand returns the display name for the role.static StringgetTabState(KualiForm form, String tabKey) Deprecated.JSTL function to return the tab state of the tab from the form.static voidincrementTabIndex(KualiForm form, String tabKey) Deprecated.static booleanisDocumentSession(org.kuali.rice.krad.document.Document document, PojoFormBase docForm) Deprecated.static booleanDeprecated.static booleanisHiddenKimObjectType(String type, String configParameter) Deprecated.static booleanisInquiryHiddenField(String className, String fieldName, Object formObject, String propertyName) Deprecated.static booleanisPropertyEditable(Set<String> editableProperties, String propertyName) Deprecated.static voidlogRequestContents(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.Level level, javax.servlet.http.HttpServletRequest request) Deprecated.Iterates through and logs (at the given level) all attributes and parameters of the given request onto the given Loggerstatic StringparseMethodToCall(org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request) Deprecated.Checks for methodToCall parameter, and picks off the value using set dot notation.static StringpreserveWhitespace(String startingString) Deprecated.Takes a string an converts the whitespace which would be ignored in an HTML document into HTML elements so the whitespace is preservedstatic voidregisterEditableProperty(PojoFormBase form, String editablePropertyName) Deprecated.static voidDeprecated.Attempts to reopen sub tabs which would have been closed for inactive recordsstatic voidreuseErrorMapFromPreviousRequest(KualiDocumentFormBase kualiDocumentFormBase) Deprecated.static StringsanitizeBackLocation(String backLocation) Deprecated.static voidsaveMimeInputStreamAsFile(javax.servlet.http.HttpServletResponse response, String contentType, InputStream inStream, String fileName, int fileSize) Deprecated.A file that is not of type text/plain or text/html can be output through the response using this method.static voidsaveMimeOutputStreamAsFile(javax.servlet.http.HttpServletResponse response, String contentType, ByteArrayOutputStream byteArrayOutputStream, String fileName) Deprecated.A file that is not of type text/plain or text/html can be output through the response using this method.protected static org.kuali.rice.krad.keyvalues.KeyValuesFindersetupValuesFinder(String valuesFinderClassName, Map<String, Object> params) Deprecated.Initiates the values finder by itsvaluesFinderClassName.static StringtoAbsoluteURL(String base, String path) Deprecated.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 aloneprotected static voidDeprecated.
-
Field Details
-
FILE_UPLOAD_LIMIT_EXCEEDED_EXCEPTION_ALREADY_THROWN
Deprecated.A request attribute name that indicates that aFileUploadLimitExceededExceptionhas already been thrown for the request.- See Also:
-
KEY_KUALI_FORM_IN_SESSION
Deprecated.
-
-
Constructor Details
-
WebUtils
public WebUtils()Deprecated.
-
-
Method Details
-
parseMethodToCall
public static String parseMethodToCall(org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request) Deprecated.Checks for methodToCall parameter, and picks off the value using set dot notation. Handles the problem of image submits.- Parameters:
request-- Returns:
- methodToCall String
-
logRequestContents
public static void logRequestContents(org.apache.logging.log4j.Logger logger, org.apache.logging.log4j.Level level, javax.servlet.http.HttpServletRequest request) Deprecated.Iterates through and logs (at the given level) all attributes and parameters of the given request onto the given Logger- Parameters:
logger-request-
-
saveMimeOutputStreamAsFile
public static void saveMimeOutputStreamAsFile(javax.servlet.http.HttpServletResponse response, String contentType, ByteArrayOutputStream byteArrayOutputStream, String fileName) throws IOException Deprecated.A file that is not of type text/plain or text/html can be output through the response using this method.- Parameters:
response-contentType-byteArrayOutputStream-fileName-- Throws:
IOException
-
saveMimeInputStreamAsFile
public static void saveMimeInputStreamAsFile(javax.servlet.http.HttpServletResponse response, String contentType, InputStream inStream, String fileName, int fileSize) throws IOException Deprecated.A file that is not of type text/plain or text/html can be output through the response using this method.- Parameters:
response-contentType-inStream-fileName-- Throws:
IOException
-
getTabState
Deprecated.JSTL function to return the tab state of the tab from the form.- Parameters:
form-tabKey-- Returns:
-
incrementTabIndex
Deprecated. -
reopenInactiveRecords
public static void reopenInactiveRecords(List<Section> sections, Map<String, String> tabStates, String collectionName) Deprecated.Attempts to reopen sub tabs which would have been closed for inactive records- Parameters:
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 reopening
-
generateTabKey
Deprecated.Generates a String from the title that can be used as a Map key.- Parameters:
tabTitle-- Returns:
-
getMultipartParameters
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) Deprecated. -
getMaxUploadSize
public static long getMaxUploadSize(org.apache.struts.action.ActionForm form) Deprecated. -
registerEditableProperty
Deprecated. -
isDocumentSession
public static boolean isDocumentSession(org.kuali.rice.krad.document.Document document, PojoFormBase docForm) Deprecated. -
isFormSessionDocument
Deprecated. -
getKualiForm
public static org.apache.struts.action.ActionForm getKualiForm(javax.servlet.jsp.PageContext pageContext) Deprecated. -
getKualiForm
public static org.apache.struts.action.ActionForm getKualiForm(javax.servlet.http.HttpServletRequest request) Deprecated. -
isPropertyEditable
Deprecated. -
endsWithCoordinates
Deprecated. -
getIndexOfCoordinateExtension
Deprecated. -
isInquiryHiddenField
public static boolean isInquiryHiddenField(String className, String fieldName, Object formObject, String propertyName) Deprecated. -
isHiddenKimObjectType
Deprecated. -
getFullyMaskedValue
public static String getFullyMaskedValue(String className, String fieldName, Object formObject, String propertyName) Deprecated. -
getPartiallyMaskedValue
public static String getPartiallyMaskedValue(String className, String fieldName, Object formObject, String propertyName) Deprecated. -
canFullyUnmaskField
public static boolean canFullyUnmaskField(String businessObjectClassName, String fieldName, KualiForm form) Deprecated. -
canPartiallyUnmaskField
public static boolean canPartiallyUnmaskField(String businessObjectClassName, String fieldName, KualiForm form) Deprecated. -
canAddNoteAttachment
public static boolean canAddNoteAttachment(org.kuali.rice.krad.document.Document document) Deprecated. -
canViewNoteAttachment
public static boolean canViewNoteAttachment(org.kuali.rice.krad.document.Document document, String attachmentTypeCode) Deprecated. -
canViewInquiryNoteAttachment
public static boolean canViewInquiryNoteAttachment()Deprecated. -
canDeleteNoteAttachment
public static boolean canDeleteNoteAttachment(org.kuali.rice.krad.document.Document document, String attachmentTypeCode, String authorUniversalIdentifier) Deprecated. -
reuseErrorMapFromPreviousRequest
Deprecated. -
filterHtmlAndReplaceRiceMarkup
Deprecated.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. <X> and </X>)
- [font COLOR], where COLOR represents any valid html color (i.e. color name or hexcode preceeded by #) will be filtered into <font color="COLOR"/>
- [/font] will be filtered into </font>
- [table CLASS], where CLASS gives the style class to use, will be filter into <table class="CLASS"/>
- [/table] will be filtered into </table>
- [td CLASS], where CLASS gives the style class to use, will be filter into <td class="CLASS"/>
- Parameters:
inputString-- Returns:
-
getButtonImageUrl
Deprecated.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()- Parameters:
imageName- the name of the image to find a button for- Returns:
- the URL where question button images are located
-
getAttachmentImageForUrl
Deprecated. -
getDefaultButtonImageUrl
Deprecated.Generates a default button image URL, in the form of: ${kr.externalizable.images.url}buttonsmall_${imageName}.gif- Parameters:
imageName- the image name to generate a default button name for- Returns:
- the default button image url
-
getKualiConfigurationService
public static org.kuali.rice.core.api.config.property.ConfigurationService getKualiConfigurationService()Deprecated.- Returns:
- an implementation of the KualiConfigurationService
-
preserveWhitespace
Deprecated.Takes a string an converts the whitespace which would be ignored in an HTML document into HTML elements so the whitespace is preserved- Parameters:
startingString- The string to preserve whitespace in- Returns:
- A string whose whitespace has been converted to HTML elements to preserve the whitespace in an HTML document
-
getKimGroupDisplayName
Deprecated. -
getPrincipalDisplayName
Deprecated. -
getRoleDisplayName
Deprecated.Takes anActionRequestwith a recipient type ofRecipientType.ROLEand returns the display name for the role.- Parameters:
actionRequest- the action request- Returns:
- the display name for the role
- Throws:
IllegalArgumentException- if the action request is null, or the recipient type is not ROLE
-
toAbsoluteURL
Deprecated.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- Parameters:
base- the url base pathpath- the path to append to base- Returns:
- an absolute URL representing the combination of base+path, or path alone if it is already absolute
-
sanitizeBackLocation
Deprecated. -
getOptionList
Deprecated.Returns a list of key/value pairs for displaying in an HTML option for a select list. This is a customized approach to retrieving key/value data from database based on criteria specified in theparamsHere is an example of how the code is used from a JSP:Mapinvalid input: '<'jsp:useBean id="paramMap" class="java.util.HashMap"/> invalid input: '<'c:set target="${paramMap}" property="forAddedPerson" value="true" /> invalid input: '<'kul:checkErrors keyMatch="${proposalPerson}.proposalPersonRoleId" auditMatch="${proposalPerson}.proposalPersonRoleId"/> invalid input: '<'c:set var="roleStyle" value=""/> invalid input: '<'c:if test="${hasErrors==true}"> invalid input: '<'c:set var="roleStyle" value="background-color:#FFD5D5"/> invalid input: '<'/c:if> invalid input: '<'html:select property="${proposalPerson}.proposalPersonRoleId" tabindex="0" style="${roleStyle}"> invalid input: '<'c:forEach items="${krafn:getOptionList('org.kuali.coeus.propdev.impl.person.ProposalPersonRoleValuesFinder', paramMap)}" var="option"> invalid input: '<'c:choose> invalid input: '<'c:when test="${KualiForm.document.proposalPersons[personIndex].proposalPersonRoleId == option.key}"> invalid input: '<'/c:when> invalid input: '<'c:otherwise> invalid input: '<'/c:otherwise> invalid input: '<'/c:choose> invalid input: '<'/c:forEach> invalid input: '<'/html:select>- Parameters:
valuesFinderClassName-params- mapped parameters- Returns:
- List of key values
-
setupValuesFinder
protected static org.kuali.rice.krad.keyvalues.KeyValuesFinder setupValuesFinder(String valuesFinderClassName, Map<String, Object> params) Deprecated.Initiates the values finder by itsvaluesFinderClassName. First locates the class in the class path. Then, creates an instance of it. Aof key/valuesMapinstances a is used to set properties on the values finder instance. Uses the apacheStringclass to set properties by the name of the key in theBeanUtils. Basically, a new values finder is created. theMapparamsparameter is aof arbitrary values mapped to properties of the values finder class. Since this is so flexible and the ambiguity of properties referenced in theMap, a number of exceptions are caught if a property cannot be set or if the values finder cannot be instantiated. All of these exceptions are handled within the method. None of these exceptions are thrown back.Map- Parameters:
valuesFinderClassName-params-- Returns:
- KeyValuesFinder
- See Also:
-
addParametersToFinder
protected static void addParametersToFinder(Map<String, Object> params, org.kuali.rice.krad.keyvalues.KeyValuesFinder finder) Deprecated. -
getKeyFinder
protected static org.kuali.rice.krad.keyvalues.KeyValuesFinder getKeyFinder(String valuesFinderClassName) Deprecated. -
warn
Deprecated.
-