001 /**
002 * Copyright 2004-2013 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 */
016 package org.kuali.hr.time.base.web;
017
018 import javax.servlet.http.HttpServletRequest;
019
020 import org.apache.commons.lang.StringUtils;
021 import org.kuali.rice.kns.util.ActionFormUtilMap;
022 import org.kuali.rice.kns.util.WebUtils;
023 import org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase;
024
025 public class TkDocumentForm extends KualiDocumentFormBase {
026
027 /**
028 *
029 */
030 private static final long serialVersionUID = 1L;
031
032 private String documentId;
033
034 private String methodToCall;
035
036 public String getMethodToCall() {
037 return methodToCall;
038 }
039
040 public void setMethodToCall(String methodToCall) {
041 this.methodToCall = methodToCall;
042 }
043
044 public String getDocumentId() {
045 return documentId;
046 }
047
048 public void setDocumentId(String documentId) {
049 this.documentId = documentId;
050 }
051
052 @Override
053 public boolean isPropertyEditable(String propertyName) {
054 return true;
055 }
056
057 @Override
058 public boolean isPropertyNonEditableButRequired(String propertyName) {
059 return true;
060 }
061
062 @Override
063 public void populate(HttpServletRequest request) {
064 super.populate(request);
065 ((ActionFormUtilMap) getActionFormUtilMap()).setCacheValueFinderResults(false);
066
067 if (this.getMethodToCall() == null || StringUtils.isEmpty(this.getMethodToCall())) {
068 setMethodToCall(WebUtils.parseMethodToCall(this, request));
069 }
070 }
071 }