View Javadoc

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