1 41 package com.tonbeller.wcf.ui; 42 43 import org.w3c.dom.Document ; 44 import org.w3c.dom.Element ; 45 46 import com.tonbeller.wcf.utils.XoplonNS; 47 48 public class FileUploadCtrl extends XoplonCtrl { 49 50 public static final String NODENAME = "fileUpload"; 51 52 public static boolean isFileUpload(Element elem) { 53 return elem.getNodeName().equals(NODENAME); 54 } 55 56 57 public static Element createFileUpload(Document doc) { 58 Element fu = Item.createItem(doc, NODENAME); 59 return fu; 60 } 61 62 65 public static void setFileName(Element element, String fileName) { 66 XoplonNS.setAttribute(element, "filename", fileName); 67 } 68 69 72 public static String getFileName(Element element) { 73 return XoplonNS.getAttribute(element, "filename"); 74 } 75 76 79 public static void setMaxLength(Element element, long maxLength) { 80 XoplonNS.setAttribute(element, "maxlength", String.valueOf(maxLength)); 81 } 82 83 86 public static String getMaxLength(Element element) { 87 return XoplonNS.getAttribute(element, "maxlength"); 88 } 89 90 93 public static void setAccept(Element element, String accept) { 94 XoplonNS.setAttribute(element, "accept", accept); 95 } 96 97 100 public static String getAccept(Element element) { 101 return XoplonNS.getAttribute(element, "accept"); 102 } 103 104 } | Popular Tags |