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  
17  package org.kuali.rice.kns.web.struts.form;
18  
19  import javax.servlet.http.HttpServletRequest;
20  
21  import org.apache.commons.lang.StringUtils;
22  import org.apache.struts.action.ActionMapping;
23  import org.kuali.rice.krad.util.KRADConstants;
24  
25  /**
26   * Feedback form which is used to collect feedback from a user and
27   * then email it to a feedback mailing list
28   */
29  public class KualiFeedbackHandlerForm extends KualiForm {
30  
31  	private static final long serialVersionUID = -7641833777580490471L;
32  
33  	private boolean cancel = false;
34  	private String description;
35  	private String documentId = ""; 
36  	private String componentName;
37  
38  	/**
39  	 * @see org.kuali.rice.kns.web.struts.pojo.PojoForm#populate(javax.servlet.http.HttpServletRequest)
40  	 */
41  	@Override
42  	public void populate(HttpServletRequest request) {
43  		super.populate(request);
44  		// ie explorer needs this.
45  		if(StringUtils.isNotBlank(request.getParameter(KRADConstants.CANCEL_METHOD + ".x")) &&
46             StringUtils.isNotBlank(request.getParameter(KRADConstants.CANCEL_METHOD + ".y"))){
47  			    this.setCancel(true);
48  		}                
49  	}
50  
51  	public void reset(ActionMapping mapping, HttpServletRequest request) {
52  
53  		this.setMethodToCall(null);
54  		this.setRefreshCaller(null);
55  		this.setAnchor(null);
56  		this.setCurrentTabIndex(0);
57  
58  		this.cancel = false;
59  		this.documentId = null;
60  		this.description = null;
61  		this.componentName = null;
62  	}
63  
64  	public boolean isCancel() {
65  		return cancel;
66  	}
67  
68  	public void setCancel(boolean cancel) {
69  		this.cancel = cancel;
70  	}
71  
72  	public String getDescription() {
73  		return description;
74  	}
75  
76  	public void setDescription(String description) {
77  		this.description = description;
78  	}
79  
80  	public String getDocumentId() {
81  		return documentId;
82  	}
83  
84  	public void setDocumentId(String documentId) {
85  		this.documentId = documentId;
86  	}
87  
88  	public String getComponentName() {
89  		return componentName;
90  	}
91  
92  	public void setComponentName(String componentName) {
93  		this.componentName = componentName;
94  	}
95  }