Class UifExportController

java.lang.Object
org.kuali.rice.krad.web.controller.UifControllerBase
org.kuali.rice.krad.web.controller.UifExportController

@Controller @RequestMapping("/export") public class UifExportController extends UifControllerBase
Controller that handles table export requests.
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Field Details

    • request

      @Autowired protected javax.servlet.http.HttpServletRequest request
  • Constructor Details

    • UifExportController

      public UifExportController()
  • Method Details

    • createInitialForm

      protected UifFormBase createInitialForm()
      Retrieves the session form for the form key request parameter so we can initialize a form instance of the same type the view was rendered with. Invoked to create a new form instance for the request before it is passed to the Binder/BeanWrapper.
      Specified by:
      createInitialForm in class UifControllerBase
      Returns:
      UifFormBase instance that will be used for data binding and backing the view.
    • tableCsvRetrieval

      @MethodAccessible @RequestMapping(method=GET, params="methodToCall=tableCsvRetrieval", produces="text/csv") @ResponseBody public String tableCsvRetrieval(@ModelAttribute("KualiForm") UifFormBase form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Generates exportable table data as CSV based on the rich table selected.
    • tableXlsRetrieval

      @MethodAccessible @RequestMapping(method=GET, params="methodToCall=tableXlsRetrieval", produces="application/vnd.ms-excel") @ResponseBody public String tableXlsRetrieval(@ModelAttribute("KualiForm") UifFormBase form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Generates exportable table data in xsl based on the rich table selected.
    • tableXmlRetrieval

      @MethodAccessible @RequestMapping(method=GET, params="methodToCall=tableXmlRetrieval", produces="application/xml") @ResponseBody public String tableXmlRetrieval(@ModelAttribute("KualiForm") UifFormBase form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Generates exportable table data based on the rich table selected.
    • inquiryXmlRetrieval

      @RequestMapping(method=GET, params="methodToCall=inquiryXmlRetrieval", produces="application/xml") @ResponseBody public org.springframework.web.servlet.ModelAndView inquiryXmlRetrieval(@ModelAttribute("KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
      Handles exporting the dataObject for this Inquiry to XML if it has a custom XML exporter available.
      Parameters:
      form - KualiForm
      result - interface that represents binding results
      request - the http request that was made
      response - the http response object
      Throws:
      Exception
    • retrieveTableData

      protected String retrieveTableData(@ModelAttribute("KualiForm") UifFormBase form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Generates exportable table data based on the rich table selected.

      First the lifecycle process is run to rebuild the collection group, then TableExporter is invoked to build the export data from the collection.

    • canApplyCustomExport

      protected boolean canApplyCustomExport(DataObjectEntry dataObjectEntry)
      Checks if a custom exporter can be applied.
      Parameters:
      dataObjectEntry - the data dictionary entry for the data object
      Returns:
      true if a custom exporter can be found, false otherwise
    • applyCustomExport

      protected boolean applyCustomExport(List<Object> dataObjectCollection, String dataObjectClassName, String formatType, javax.servlet.http.HttpServletResponse response)
      Applies custom export if an exporter class is defined. Will return false if no exporter class defined or if the dataObject collection is empty.
      Parameters:
      dataObjectCollection -
      dataObjectClassName -
      formatType -
      response - true if custom exporter applied else return false.
    • setAttachmentResponseHeader

      protected void setAttachmentResponseHeader(javax.servlet.http.HttpServletResponse response, String filename, String contentType)
      Creates consistent setup of attachment response header.
      Parameters:
      response - http response object
      filename - name of the return file
      contentType - return content type
    • getValidatedFormatType

      protected String getValidatedFormatType(String formatType)
      Reviews and returns a valid format type, defaults to csv.
      Parameters:
      formatType - format type to validate
      Returns:
      valid format type
    • getContentType

      protected String getContentType(String formatType)
      Reviews and returns a valid content type, defaults to text/csv.
      Parameters:
      formatType - format type to return content type for
      Returns:
      valid content type