Class WebUtils

java.lang.Object
org.kuali.rice.kns.util.WebUtils

@Deprecated public class WebUtils extends Object
Deprecated.
Only used in KNS classes, use KRAD.
General helper methods for handling requests.
  • Field Details

    • FILE_UPLOAD_LIMIT_EXCEEDED_EXCEPTION_ALREADY_THROWN

      public static final String FILE_UPLOAD_LIMIT_EXCEEDED_EXCEPTION_ALREADY_THROWN
      Deprecated.
      A request attribute name that indicates that a FileUploadLimitExceededException has already been thrown for the request.
      See Also:
    • KEY_KUALI_FORM_IN_SESSION

      public static String 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

      public static String getTabState(KualiForm form, String tabKey)
      Deprecated.
      JSTL function to return the tab state of the tab from the form.
      Parameters:
      form -
      tabKey -
      Returns:
    • incrementTabIndex

      public static void incrementTabIndex(KualiForm form, String tabKey)
      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 on
      tabStates - the map of tabKey->tabState. This map will be modified to set entries to "OPEN"
      collectionName - the name of the collection reopening
    • generateTabKey

      public static String generateTabKey(String tabTitle)
      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

      public static void registerEditableProperty(PojoFormBase form, String editablePropertyName)
      Deprecated.
    • isDocumentSession

      public static boolean isDocumentSession(org.kuali.rice.krad.document.Document document, PojoFormBase docForm)
      Deprecated.
    • isFormSessionDocument

      public static boolean isFormSessionDocument(PojoFormBase form)
      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

      public static boolean isPropertyEditable(Set<String> editableProperties, String propertyName)
      Deprecated.
    • endsWithCoordinates

      public static boolean endsWithCoordinates(String parameter)
      Deprecated.
    • getIndexOfCoordinateExtension

      public static int getIndexOfCoordinateExtension(String parameter)
      Deprecated.
    • isInquiryHiddenField

      public static boolean isInquiryHiddenField(String className, String fieldName, Object formObject, String propertyName)
      Deprecated.
    • isHiddenKimObjectType

      public static boolean isHiddenKimObjectType(String type, String configParameter)
      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

      public static void reuseErrorMapFromPreviousRequest(KualiDocumentFormBase kualiDocumentFormBase)
      Deprecated.
    • filterHtmlAndReplaceRiceMarkup

      public static String filterHtmlAndReplaceRiceMarkup(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. <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

      public static String getButtonImageUrl(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()
      Parameters:
      imageName - the name of the image to find a button for
      Returns:
      the URL where question button images are located
    • getAttachmentImageForUrl

      public static String getAttachmentImageForUrl(String contentType)
      Deprecated.
    • getDefaultButtonImageUrl

      public static String getDefaultButtonImageUrl(String imageName)
      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

      public static String preserveWhitespace(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 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

      public static String getKimGroupDisplayName(String groupId)
      Deprecated.
    • getPrincipalDisplayName

      public static String getPrincipalDisplayName(String principalId)
      Deprecated.
    • getRoleDisplayName

      public static String getRoleDisplayName(org.kuali.rice.kew.api.action.ActionRequest actionRequest)
      Deprecated.
      Takes an ActionRequest with a recipient type of RecipientType.ROLE and 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

      public static String toAbsoluteURL(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 alone
      Parameters:
      base - the url base path
      path - 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

      public static String sanitizeBackLocation(String backLocation)
      Deprecated.
    • getOptionList

      public static List getOptionList(String valuesFinderClassName, Map params)
      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 the params Map Here is an example of how the code is used from a JSP: invalid 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 its valuesFinderClassName. First locates the class in the class path. Then, creates an instance of it. A Map of key/values String instances a is used to set properties on the values finder instance. Uses the apache BeanUtils class to set properties by the name of the key in the Map. Basically, a new values finder is created. the params parameter is a Map of arbitrary values mapped to properties of the values finder class. Since this is so flexible and the ambiguity of properties referenced in the Map, 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.
      Parameters:
      valuesFinderClassName -
      params -
      Returns:
      KeyValuesFinder
      See Also:
      • BeanUtils.setProperty(Object, String, Object)
    • 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

      protected static void warn(String message, Exception e)
      Deprecated.