001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.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/ecl2.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 */
016package org.kuali.rice.kns.web.struts.form;
017
018import javax.servlet.http.HttpServletRequest;
019
020import org.apache.commons.lang.StringUtils;
021import org.apache.struts.action.ActionMapping;
022import org.kuali.rice.krad.util.KRADConstants;
023
024/**
025 * Feedback form which is used to collect feedback from a user and
026 * then email it to a feedback mailing list
027 */
028public class KualiFeedbackHandlerForm extends KualiForm {
029
030        private static final long serialVersionUID = -7641833777580490471L;
031
032        private boolean cancel = false;
033        private String description;
034        private String documentId = ""; 
035        private String componentName;
036
037        /**
038         * @see org.kuali.rice.kns.web.struts.pojo.PojoForm#populate(javax.servlet.http.HttpServletRequest)
039         */
040        @Override
041        public void populate(HttpServletRequest request) {
042                super.populate(request);
043                // ie explorer needs this.
044                if(StringUtils.isNotBlank(request.getParameter(KRADConstants.CANCEL_METHOD + ".x")) &&
045           StringUtils.isNotBlank(request.getParameter(KRADConstants.CANCEL_METHOD + ".y"))){
046                            this.setCancel(true);
047                }                
048        }
049
050        public void reset(ActionMapping mapping, HttpServletRequest request) {
051
052                this.setMethodToCall(null);
053                this.setRefreshCaller(null);
054                this.setAnchor(null);
055                this.setCurrentTabIndex(0);
056
057                this.cancel = false;
058                this.documentId = null;
059                this.description = null;
060                this.componentName = null;
061        }
062
063        public boolean isCancel() {
064                return cancel;
065        }
066
067        public void setCancel(boolean cancel) {
068                this.cancel = cancel;
069        }
070
071        public String getDescription() {
072                return description;
073        }
074
075        public void setDescription(String description) {
076                this.description = description;
077        }
078
079        public String getDocumentId() {
080                return documentId;
081        }
082
083        public void setDocumentId(String documentId) {
084                this.documentId = documentId;
085        }
086
087        public String getComponentName() {
088                return componentName;
089        }
090
091        public void setComponentName(String componentName) {
092                this.componentName = componentName;
093        }
094}