001 /** 002 * Copyright 2005-2014 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.rice.kns.rule.event; 017 018 import org.apache.log4j.Logger; 019 import org.kuali.rice.kns.rule.PromptBeforeValidation; 020 import org.kuali.rice.krad.document.Document; 021 import org.kuali.rice.krad.rules.rule.BusinessRule; 022 import org.kuali.rice.krad.rules.rule.event.KualiDocumentEventBase; 023 024 /** 025 * Event for handling warnings/questions before rules are called. 026 * 027 * 028 */ 029 public class PromptBeforeValidationEvent extends KualiDocumentEventBase { 030 private static final Logger LOG = Logger.getLogger(PromptBeforeValidationEvent.class); 031 032 boolean performQuestion; 033 String actionForwardName; 034 String questionId; 035 String questionText; 036 String questionType; 037 String questionCaller; 038 String questionContext; 039 040 041 /** 042 * @param description 043 * @param errorPathPrefix 044 * @param document 045 */ 046 public PromptBeforeValidationEvent(String description, String errorPathPrefix, Document document) { 047 048 super(description, errorPathPrefix); 049 this.document = document; 050 051 LOG.debug(description); 052 053 performQuestion = false; 054 } 055 056 057 /** 058 * @return Returns the actionForwardName. 059 */ 060 public String getActionForwardName() { 061 return actionForwardName; 062 } 063 064 /** 065 * @param actionForwardName The actionForwardName to set. 066 */ 067 public void setActionForwardName(String actionForwardName) { 068 this.actionForwardName = actionForwardName; 069 } 070 071 /** 072 * @return Returns the performQuestion. 073 */ 074 public boolean isPerformQuestion() { 075 return performQuestion; 076 } 077 078 /** 079 * @param performQuestion The performQuestion to set. 080 */ 081 public void setPerformQuestion(boolean performQuestion) { 082 this.performQuestion = performQuestion; 083 } 084 085 /** 086 * @return Returns the questionCaller. 087 */ 088 public String getQuestionCaller() { 089 return questionCaller; 090 } 091 092 /** 093 * @param questionCaller The questionCaller to set. 094 */ 095 public void setQuestionCaller(String questionCaller) { 096 this.questionCaller = questionCaller; 097 } 098 099 /** 100 * @return Returns the questionContext. 101 */ 102 public String getQuestionContext() { 103 return questionContext; 104 } 105 106 /** 107 * @param questionContext The questionContext to set. 108 */ 109 public void setQuestionContext(String questionContext) { 110 this.questionContext = questionContext; 111 } 112 113 /** 114 * @return Returns the questionId. 115 */ 116 public String getQuestionId() { 117 return questionId; 118 } 119 120 /** 121 * @param questionId The questionId to set. 122 */ 123 public void setQuestionId(String questionId) { 124 this.questionId = questionId; 125 } 126 127 /** 128 * @return Returns the questionText. 129 */ 130 public String getQuestionText() { 131 return questionText; 132 } 133 134 /** 135 * @param questionText The questionText to set. 136 */ 137 public void setQuestionText(String questionText) { 138 this.questionText = questionText; 139 } 140 141 /** 142 * @return Returns the questionType. 143 */ 144 public String getQuestionType() { 145 return questionType; 146 } 147 148 /** 149 * @param questionType The questionType to set. 150 */ 151 public void setQuestionType(String questionType) { 152 this.questionType = questionType; 153 } 154 155 /** 156 * @see org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent#getRuleInterfaceClass() 157 */ 158 public Class<? extends BusinessRule> getRuleInterfaceClass() { 159 return PromptBeforeValidation.class; 160 } 161 162 163 /** 164 * @see org.kuali.rice.krad.rules.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.rice.krad.rules.rule.BusinessRule) 165 */ 166 public boolean invokeRuleMethod(BusinessRule rule) { 167 return true; 168 } 169 }