View Javadoc

1   /**
2    * Copyright 2004-2013 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.hr.time.base.web;
17  
18  import javax.servlet.http.HttpServletRequest;
19  
20  import org.apache.commons.lang.StringUtils;
21  import org.kuali.rice.kns.util.ActionFormUtilMap;
22  import org.kuali.rice.kns.util.WebUtils;
23  import org.kuali.rice.kns.web.struts.form.KualiDocumentFormBase;
24  
25  public class TkDocumentForm extends KualiDocumentFormBase {
26  
27  	/**
28       * 
29       */
30  	private static final long serialVersionUID = 1L;
31  
32  	private String documentId;
33  
34  	private String methodToCall;
35  
36  	public String getMethodToCall() {
37  		return methodToCall;
38  	}
39  
40  	public void setMethodToCall(String methodToCall) {
41  		this.methodToCall = methodToCall;
42  	}
43  
44  	public String getDocumentId() {
45  		return documentId;
46  	}
47  
48  	public void setDocumentId(String documentId) {
49  		this.documentId = documentId;
50  	}
51  
52  	@Override
53  	public boolean isPropertyEditable(String propertyName) {
54  		return true;
55  	}
56  
57  	@Override
58  	public boolean isPropertyNonEditableButRequired(String propertyName) {
59  		return true;
60  	}
61  
62  	@Override
63  	public void populate(HttpServletRequest request) {
64          super.populate(request);
65  		((ActionFormUtilMap) getActionFormUtilMap()).setCacheValueFinderResults(false);
66          
67  		if (this.getMethodToCall() == null || StringUtils.isEmpty(this.getMethodToCall())) {
68  			setMethodToCall(WebUtils.parseMethodToCall(this, request));
69  		}
70  	}
71  }