001: /*
002: * Copyright 2005-2006 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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.core.rule.event;
017:
018: import org.apache.log4j.Logger;
019: import org.kuali.core.document.Document;
020: import org.kuali.core.rule.BusinessRule;
021: import org.kuali.core.rule.PreRulesCheck;
022:
023: /**
024: * Event for handling warnings/questions before rules are called.
025: *
026: *
027: */
028: public class PreRulesCheckEvent extends KualiDocumentEventBase {
029: private static final Logger LOG = Logger
030: .getLogger(PreRulesCheckEvent.class);
031:
032: boolean performQuestion;
033: boolean returnActionFoward;
034: String actionForwardName;
035: String questionId;
036: String questionText;
037: String questionType;
038: String questionCaller;
039: String questionContext;
040:
041: /**
042: * @param description
043: * @param errorPathPrefix
044: * @param document
045: */
046: public PreRulesCheckEvent(String description,
047: String errorPathPrefix, Document document) {
048:
049: super (description, errorPathPrefix);
050: this .document = document;
051:
052: LOG.debug(description);
053:
054: performQuestion = false;
055: returnActionFoward = false;
056: }
057:
058: /**
059: * @return Returns the actionForwardName.
060: */
061: public String getActionForwardName() {
062: return actionForwardName;
063: }
064:
065: /**
066: * @param actionForwardName The actionForwardName to set.
067: */
068: public void setActionForwardName(String actionForwardName) {
069: this .actionForwardName = actionForwardName;
070: }
071:
072: /**
073: * @return Returns the performQuestion.
074: */
075: public boolean isPerformQuestion() {
076: return performQuestion;
077: }
078:
079: /**
080: * @param performQuestion The performQuestion to set.
081: */
082: public void setPerformQuestion(boolean performQuestion) {
083: this .performQuestion = performQuestion;
084: }
085:
086: /**
087: * @return Returns the questionCaller.
088: */
089: public String getQuestionCaller() {
090: return questionCaller;
091: }
092:
093: /**
094: * @param questionCaller The questionCaller to set.
095: */
096: public void setQuestionCaller(String questionCaller) {
097: this .questionCaller = questionCaller;
098: }
099:
100: /**
101: * @return Returns the questionContext.
102: */
103: public String getQuestionContext() {
104: return questionContext;
105: }
106:
107: /**
108: * @param questionContext The questionContext to set.
109: */
110: public void setQuestionContext(String questionContext) {
111: this .questionContext = questionContext;
112: }
113:
114: /**
115: * @return Returns the questionId.
116: */
117: public String getQuestionId() {
118: return questionId;
119: }
120:
121: /**
122: * @param questionId The questionId to set.
123: */
124: public void setQuestionId(String questionId) {
125: this .questionId = questionId;
126: }
127:
128: /**
129: * @return Returns the questionText.
130: */
131: public String getQuestionText() {
132: return questionText;
133: }
134:
135: /**
136: * @param questionText The questionText to set.
137: */
138: public void setQuestionText(String questionText) {
139: this .questionText = questionText;
140: }
141:
142: /**
143: * @return Returns the questionType.
144: */
145: public String getQuestionType() {
146: return questionType;
147: }
148:
149: /**
150: * @param questionType The questionType to set.
151: */
152: public void setQuestionType(String questionType) {
153: this .questionType = questionType;
154: }
155:
156: /**
157: * @return Returns the returnActionFoward.
158: */
159: public boolean isReturnActionFoward() {
160: return returnActionFoward;
161: }
162:
163: /**
164: * @param returnActionFoward The returnActionFoward to set.
165: */
166: public void setReturnActionFoward(boolean returnActionFoward) {
167: this .returnActionFoward = returnActionFoward;
168: }
169:
170: /**
171: * @see org.kuali.core.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
172: */
173: public Class getRuleInterfaceClass() {
174: return PreRulesCheck.class;
175: }
176:
177: /**
178: * @see org.kuali.core.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.core.rule.BusinessRule)
179: */
180: public boolean invokeRuleMethod(BusinessRule rule) {
181: return true;
182: }
183: }
|