View Javadoc

1   /*
2    * Copyright 2005-2007 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kns.rule.event;
17  
18  import org.apache.log4j.Logger;
19  import org.kuali.rice.kns.document.Document;
20  import org.kuali.rice.kns.rule.BusinessRule;
21  import org.kuali.rice.kns.rule.PromptBeforeValidation;
22  
23  /**
24   * Event for handling warnings/questions before rules are called.
25   * 
26   * 
27   */
28  public class PromptBeforeValidationEvent extends KualiDocumentEventBase {
29      private static final Logger LOG = Logger.getLogger(PromptBeforeValidationEvent.class);
30  
31      boolean performQuestion;
32      String actionForwardName;
33      String questionId;
34      String questionText;
35      String questionType;
36      String questionCaller;
37      String questionContext;
38  
39  
40      /**
41       * @param description
42       * @param errorPathPrefix
43       * @param document
44       */
45      public PromptBeforeValidationEvent(String description, String errorPathPrefix, Document document) {
46  
47          super(description, errorPathPrefix);
48          this.document = document;
49  
50          LOG.debug(description);
51  
52          performQuestion = false;
53      }
54  
55  
56      /**
57       * @return Returns the actionForwardName.
58       */
59      public String getActionForwardName() {
60          return actionForwardName;
61      }
62  
63      /**
64       * @param actionForwardName The actionForwardName to set.
65       */
66      public void setActionForwardName(String actionForwardName) {
67          this.actionForwardName = actionForwardName;
68      }
69  
70      /**
71       * @return Returns the performQuestion.
72       */
73      public boolean isPerformQuestion() {
74          return performQuestion;
75      }
76  
77      /**
78       * @param performQuestion The performQuestion to set.
79       */
80      public void setPerformQuestion(boolean performQuestion) {
81          this.performQuestion = performQuestion;
82      }
83  
84      /**
85       * @return Returns the questionCaller.
86       */
87      public String getQuestionCaller() {
88          return questionCaller;
89      }
90  
91      /**
92       * @param questionCaller The questionCaller to set.
93       */
94      public void setQuestionCaller(String questionCaller) {
95          this.questionCaller = questionCaller;
96      }
97  
98      /**
99       * @return Returns the questionContext.
100      */
101     public String getQuestionContext() {
102         return questionContext;
103     }
104 
105     /**
106      * @param questionContext The questionContext to set.
107      */
108     public void setQuestionContext(String questionContext) {
109         this.questionContext = questionContext;
110     }
111 
112     /**
113      * @return Returns the questionId.
114      */
115     public String getQuestionId() {
116         return questionId;
117     }
118 
119     /**
120      * @param questionId The questionId to set.
121      */
122     public void setQuestionId(String questionId) {
123         this.questionId = questionId;
124     }
125 
126     /**
127      * @return Returns the questionText.
128      */
129     public String getQuestionText() {
130         return questionText;
131     }
132 
133     /**
134      * @param questionText The questionText to set.
135      */
136     public void setQuestionText(String questionText) {
137         this.questionText = questionText;
138     }
139 
140     /**
141      * @return Returns the questionType.
142      */
143     public String getQuestionType() {
144         return questionType;
145     }
146 
147     /**
148      * @param questionType The questionType to set.
149      */
150     public void setQuestionType(String questionType) {
151         this.questionType = questionType;
152     }
153 
154     /**
155      * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
156      */
157     public Class getRuleInterfaceClass() {
158         return PromptBeforeValidation.class;
159     }
160 
161 
162     /**
163      * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.rice.kns.rule.BusinessRule)
164      */
165     public boolean invokeRuleMethod(BusinessRule rule) {
166         return true;
167     }
168 }