View Javadoc

1   /**
2    * Copyright 2005-2012 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.rule.PromptBeforeValidation;
20  import org.kuali.rice.krad.document.Document;
21  import org.kuali.rice.krad.rules.rule.BusinessRule;
22  import org.kuali.rice.krad.rules.rule.event.KualiDocumentEventBase;
23  
24  /**
25   * Event for handling warnings/questions before rules are called.
26   * 
27   * 
28   */
29  public class PromptBeforeValidationEvent extends KualiDocumentEventBase {
30      private static final Logger LOG = Logger.getLogger(PromptBeforeValidationEvent.class);
31  
32      boolean performQuestion;
33      String actionForwardName;
34      String questionId;
35      String questionText;
36      String questionType;
37      String questionCaller;
38      String questionContext;
39  
40  
41      /**
42       * @param description
43       * @param errorPathPrefix
44       * @param document
45       */
46      public PromptBeforeValidationEvent(String description, String errorPathPrefix, Document document) {
47  
48          super(description, errorPathPrefix);
49          this.document = document;
50  
51          LOG.debug(description);
52  
53          performQuestion = false;
54      }
55  
56  
57      /**
58       * @return Returns the actionForwardName.
59       */
60      public String getActionForwardName() {
61          return actionForwardName;
62      }
63  
64      /**
65       * @param actionForwardName The actionForwardName to set.
66       */
67      public void setActionForwardName(String actionForwardName) {
68          this.actionForwardName = actionForwardName;
69      }
70  
71      /**
72       * @return Returns the performQuestion.
73       */
74      public boolean isPerformQuestion() {
75          return performQuestion;
76      }
77  
78      /**
79       * @param performQuestion The performQuestion to set.
80       */
81      public void setPerformQuestion(boolean performQuestion) {
82          this.performQuestion = performQuestion;
83      }
84  
85      /**
86       * @return Returns the questionCaller.
87       */
88      public String getQuestionCaller() {
89          return questionCaller;
90      }
91  
92      /**
93       * @param questionCaller The questionCaller to set.
94       */
95      public void setQuestionCaller(String questionCaller) {
96          this.questionCaller = questionCaller;
97      }
98  
99      /**
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 }