use of org.kuali.kfs.kns.web.struts.form.InquiryForm in project cu-kfs by CU-CommunityApps.
the class KualiInquiryAction method showAllTabs.
@Override
public ActionForward showAllTabs(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
// KULRICE-2852: Overrides showAllTabs() so that it also calls the populateSections() method.
InquiryForm inquiryForm = (InquiryForm) form;
if (inquiryForm.getBusinessObjectClassName() == null) {
LOG.error("Business object name not given.");
throw new RuntimeException("Business object name not given.");
}
BusinessObject bo = retrieveBOFromInquirable(inquiryForm);
checkBO(bo);
populateSections(mapping, request, inquiryForm, bo);
return super.showAllTabs(mapping, form, request, response);
}
use of org.kuali.kfs.kns.web.struts.form.InquiryForm in project cu-kfs by CU-CommunityApps.
the class KualiInquiryAction method toggleTab.
@Override
public ActionForward toggleTab(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
InquiryForm inquiryForm = (InquiryForm) form;
if (inquiryForm.getBusinessObjectClassName() == null) {
LOG.error("Business object name not given.");
throw new RuntimeException("Business object name not given.");
}
BusinessObject bo = retrieveBOFromInquirable(inquiryForm);
checkBO(bo);
populateSections(mapping, request, inquiryForm, bo);
return super.toggleTab(mapping, form, request, response);
}
use of org.kuali.kfs.kns.web.struts.form.InquiryForm in project cu-kfs by CU-CommunityApps.
the class KualiInquiryAction method continueWithInquiry.
public ActionForward continueWithInquiry(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
InquiryForm inquiryForm = (InquiryForm) form;
if (inquiryForm.getBusinessObjectClassName() == null) {
LOG.error("Business object name not given.");
throw new RuntimeException("Business object name not given.");
}
BusinessObject bo = retrieveBOFromInquirable(inquiryForm);
checkBO(bo);
populateSections(mapping, request, inquiryForm, bo);
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.kns.web.struts.form.InquiryForm in project cu-kfs by CU-CommunityApps.
the class KualiInquiryAction method downloadCustomBOAttachment.
public ActionForward downloadCustomBOAttachment(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
String fileName = request.getParameter(KRADConstants.BO_ATTACHMENT_FILE_NAME);
String contentType = request.getParameter(KRADConstants.BO_ATTACHMENT_FILE_CONTENT_TYPE);
String fileContentBoField = request.getParameter(KRADConstants.BO_ATTACHMENT_FILE_CONTENT_FIELD);
// require certain request properties
if (fileName != null && contentType != null && fileContentBoField != null) {
// make sure user has authorization to download attachment
checkAuthorization(form, findMethodToCall(form, request));
fileName = StringUtils.replace(fileName, " ", "_");
InquiryForm inquiryForm = (InquiryForm) form;
BusinessObject bo = retrieveBOFromInquirable(inquiryForm);
checkBO(bo);
Class clazz = bo.getClass();
Method method = clazz.getMethod("get" + StringUtils.capitalize(fileContentBoField));
byte[] fileContents = (byte[]) method.invoke(bo);
streamToResponse(fileContents, fileName, contentType, response);
} else {
if (fileName == null) {
LOG.error("Request Parameter \"" + KRADConstants.BO_ATTACHMENT_FILE_NAME + "\" not provided.");
}
if (contentType == null) {
LOG.error("Request Parameter \"" + KRADConstants.BO_ATTACHMENT_FILE_CONTENT_TYPE + "\" not provided.");
}
if (fileContentBoField == null) {
LOG.error("Request Parameter \"" + KRADConstants.BO_ATTACHMENT_FILE_CONTENT_FIELD + "\" not provided.");
}
}
return null;
}
use of org.kuali.kfs.kns.web.struts.form.InquiryForm in project cu-kfs by CU-CommunityApps.
the class KualiInquiryAction method hideAllTabs.
@Override
public ActionForward hideAllTabs(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
// KULRICE-2852: Overrides hideAllTabs() so that it also calls the populateSections() method.
InquiryForm inquiryForm = (InquiryForm) form;
if (inquiryForm.getBusinessObjectClassName() == null) {
LOG.error("Business object name not given.");
throw new RuntimeException("Business object name not given.");
}
BusinessObject bo = retrieveBOFromInquirable(inquiryForm);
checkBO(bo);
populateSections(mapping, request, inquiryForm, bo);
return super.hideAllTabs(mapping, form, request, response);
}
Aggregations