1 16 package org.apache.cocoon.woody.formmodel; 17 18 import org.apache.cocoon.woody.util.DomHelper; 19 import org.w3c.dom.Element ; 20 21 28 public class UploadDefinitionBuilder extends AbstractWidgetDefinitionBuilder { 29 30 public WidgetDefinition buildWidgetDefinition(Element widgetElement) throws Exception { 31 String mimeTypes = DomHelper.getAttribute(widgetElement, "mime-types", null); 32 boolean required = DomHelper.getAttributeAsBoolean(widgetElement, "required", false); 33 34 UploadDefinition uploadDefinition = new UploadDefinition(required, mimeTypes); 35 setLocation(widgetElement, uploadDefinition); 36 setId(widgetElement, uploadDefinition); 37 38 setDisplayData(widgetElement, uploadDefinition); 39 setValidators(widgetElement, uploadDefinition); 40 41 return uploadDefinition; 42 } 43 } 44 | Popular Tags |