/**
   * Invoked to request an inquiry view for a data object class
   *
   * <p>Checks if the data object is externalizable and we need to redirect to the appropriate
   * inquiry URL, else continues with the inquiry view display
   *
   * <p>Data object class name and values for a primary or alternate key set must be sent in the
   * request
   *
   * <p>Invokes the inquirable to perform the query for the data object record, if not found an
   * exception will be thrown. If found the object is set on the form and then the view is rendered
   */
  @RequestMapping(params = "methodToCall=start")
  @Override
  public ModelAndView start(
      @ModelAttribute("KualiForm") UifFormBase form,
      BindingResult result,
      HttpServletRequest request,
      HttpServletResponse response) {
    InquiryForm inquiryForm = (InquiryForm) form;

    // if request is not a redirect, determine if we need to redirect for an externalizable object
    // inquiry
    if (!inquiryForm.isRedirectedInquiry()) {
      Class inquiryObjectClass = null;
      try {
        inquiryObjectClass = Class.forName(inquiryForm.getDataObjectClassName());
      } catch (ClassNotFoundException e) {
        throw new RiceRuntimeException(
            "Unable to get class for name: " + inquiryForm.getDataObjectClassName());
      }

      ModuleService responsibleModuleService =
          KRADServiceLocatorWeb.getKualiModuleService()
              .getResponsibleModuleService(inquiryObjectClass);
      if (responsibleModuleService != null
          && responsibleModuleService.isExternalizable(inquiryObjectClass)) {
        String inquiryUrl =
            responsibleModuleService.getExternalizableDataObjectInquiryUrl(
                inquiryObjectClass,
                KRADUtils.convertRequestMapToProperties(request.getParameterMap()));

        Properties redirectUrlProps = new Properties();
        redirectUrlProps.put(UifParameters.REDIRECTED_INQUIRY, "true");

        // clear current form from session
        GlobalVariables.getUifFormManager().removeSessionForm(form);

        return performRedirect(form, inquiryUrl, redirectUrlProps);
      }
    }

    // initialize data object class in inquirable
    try {
      inquiryForm
          .getInquirable()
          .setDataObjectClass(Class.forName(inquiryForm.getDataObjectClassName()));
    } catch (ClassNotFoundException e) {
      LOG.error(
          "Unable to get new instance for object class: " + inquiryForm.getDataObjectClassName(),
          e);
      throw new RuntimeException(
          "Unable to get new instance for object class: " + inquiryForm.getDataObjectClassName(),
          e);
    }

    // invoke inquirable to retrieve inquiry data object
    Object dataObject =
        inquiryForm
            .getInquirable()
            .retrieveDataObject(KRADUtils.translateRequestParameterMap(request.getParameterMap()));

    inquiryForm.setDataObject(dataObject);

    return super.start(form, result, request, response);
  }