本文整理汇总了Java中org.kuali.rice.krad.util.KRADConstants.SENSITIVE_DATA_QUESTION_SESSION_TICKET属性的典型用法代码示例。如果您正苦于以下问题:Java KRADConstants.SENSITIVE_DATA_QUESTION_SESSION_TICKET属性的具体用法?Java KRADConstants.SENSITIVE_DATA_QUESTION_SESSION_TICKET怎么用?Java KRADConstants.SENSITIVE_DATA_QUESTION_SESSION_TICKET使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.kuali.rice.krad.util.KRADConstants
的用法示例。
在下文中一共展示了KRADConstants.SENSITIVE_DATA_QUESTION_SESSION_TICKET属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkAndWarnAboutSensitiveData
/**
* Checks if the given value matches patterns that indicate sensitive data and if configured to give a warning for sensitive data will
* prompt the user to continue
*
* @param mapping
* @param form
* @param request
* @param response
* @param fieldName - name of field with value being checked
* @param fieldValue - value to check for sensitive data
* @param caller - method that should be called back from question
* @param context - additional context that needs to be passed back with the question response
* @return ActionForward which contains the question forward, or basic forward if user select no to prompt, otherwise will return null
* to indicate processing should continue
* @throws Exception
*/
protected ActionForward checkAndWarnAboutSensitiveData(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response, String fieldName, String fieldValue, String caller, String context)
throws Exception {
KualiDocumentFormBase kualiDocumentFormBase = (KualiDocumentFormBase) form;
Document document = kualiDocumentFormBase.getDocument();
boolean containsSensitiveData = KRADUtils.containsSensitiveDataPatternMatch(fieldValue);
// check if warning is configured in which case we will prompt, or if not business rules will thrown an error
boolean warnForSensitiveData = CoreFrameworkServiceLocator.getParameterService().getParameterValueAsBoolean(
KRADConstants.KNS_NAMESPACE, ParameterConstants.ALL_COMPONENT,
KRADConstants.SystemGroupParameterNames.SENSITIVE_DATA_PATTERNS_WARNING_IND);
// determine if the question has been asked yet
Map<String, String> ticketContext = new HashMap<String, String>();
ticketContext.put(KRADPropertyConstants.DOCUMENT_NUMBER, document.getDocumentNumber());
ticketContext.put(KRADConstants.CALLING_METHOD, caller);
ticketContext.put(KRADPropertyConstants.NAME, fieldName);
boolean questionAsked = GlobalVariables.getUserSession().hasMatchingSessionTicket(
KRADConstants.SENSITIVE_DATA_QUESTION_SESSION_TICKET, ticketContext);
// start in logic for confirming the sensitive data
if (containsSensitiveData && warnForSensitiveData && !questionAsked) {
Object question = request.getParameter(KRADConstants.QUESTION_INST_ATTRIBUTE_NAME);
if (question == null || !KRADConstants.DOCUMENT_SENSITIVE_DATA_QUESTION.equals(question)) {
// question hasn't been asked, prompt to continue
return this.performQuestionWithoutInput(mapping, form, request, response,
KRADConstants.DOCUMENT_SENSITIVE_DATA_QUESTION, getKualiConfigurationService()
.getPropertyValueAsString(RiceKeyConstants.QUESTION_SENSITIVE_DATA_DOCUMENT),
KRADConstants.CONFIRMATION_QUESTION, caller, context);
}
Object buttonClicked = request.getParameter(KRADConstants.QUESTION_CLICKED_BUTTON);
if (question != null && KRADConstants.DOCUMENT_SENSITIVE_DATA_QUESTION.equals(question)) {
// if no button clicked just reload the doc
if (ConfirmationQuestion.NO.equals(buttonClicked)) {
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
// answered yes, create session ticket so we not to ask question again if there are further question requests
SessionTicket ticket = new SessionTicket(KRADConstants.SENSITIVE_DATA_QUESTION_SESSION_TICKET);
ticket.setTicketContext(ticketContext);
GlobalVariables.getUserSession().putSessionTicket(ticket);
}
}
// return null to indicate processing should continue (no redirect)
return null;
}