| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| KNSFileTag | 
  | 
  | 6.0;6 | 
| 1 |  /* | |
| 2 |   * Copyright 2007-2008 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.krad.web.taglib.html; | |
| 17 | ||
| 18 |  import javax.servlet.jsp.JspException; | |
| 19 | ||
| 20 |  import org.apache.commons.lang.StringUtils; | |
| 21 |  import org.apache.struts.action.ActionForm; | |
| 22 |  import org.apache.struts.taglib.html.FileTag; | |
| 23 |  import org.kuali.rice.krad.util.WebUtils; | |
| 24 |  import org.kuali.rice.krad.web.struts.pojo.PojoForm; | |
| 25 | ||
| 26 |  /** | |
| 27 |   * This is a description of what this class does - wliang don't forget to fill this in.  | |
| 28 |   *  | |
| 29 |   * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 30 |   * | |
| 31 |   */ | |
| 32 | 0 |  public class KNSFileTag extends FileTag { | 
| 33 | ||
| 34 |          /** | |
| 35 |           * @see org.apache.struts.taglib.html.BaseFieldTag#doEndTag() | |
| 36 |           */ | |
| 37 | @Override  | |
| 38 | public int doEndTag() throws JspException {  | |
| 39 | 0 |                  int returnVal = super.doEndTag(); | 
| 40 | 0 |                  if (!getDisabled() && !getReadonly()) { | 
| 41 | 0 |                  String name = prepareName(); | 
| 42 | 0 |                  if (StringUtils.isNotBlank(name)) { | 
| 43 | 0 |                          ActionForm form = WebUtils.getKualiForm(pageContext); | 
| 44 | 0 |                      if(form!=null && form instanceof PojoForm) { | 
| 45 | 0 |                              ((PojoForm) form).registerEditableProperty(name); | 
| 46 | }  | |
| 47 | }  | |
| 48 | }  | |
| 49 | 0 |                  return returnVal; | 
| 50 | }  | |
| 51 | ||
| 52 | }  |