package org.appfuse.webapp.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionMapping;

/**
 * @struts.form name="fileUploadForm"
 * 
 * @author <a href="mailto:helge.tesgaard(at)gmail.com.com">Helge Tesgaard</a>
 */
public class FileUploadForm
    extends    BaseForm
    implements java.io.Serializable
{

    protected String parameter; //Dummy property. Only included to have a @struts.validator tag in this class to enshure that en entry in progressbar\build\progressbar\WEB-INF\validatore.xml is created

    /** Default empty constructor. */
    public FileUploadForm() {}


    public String getParameter()
    {
        return this.parameter;
    }
   /**
    * @struts.validator type="required"
    */

    public void setParameter( String parameter )
    {
        this.parameter = parameter;
    }

  //Start block: This block is from the file metadata\web\xdoclet-FileUploadForm.java
  private org.apache.struts.upload.FormFile file1, file2, file3, file4;

  public org.apache.struts.upload.FormFile getFile1() {
    return file1;
  }

  public void setFile1(org.apache.struts.upload.FormFile file1) {
    this.file1 = file1;
  }

  public org.apache.struts.upload.FormFile getFile2() {
    return file2;
  }

  public void setFile2(org.apache.struts.upload.FormFile file2) {
    this.file2 = file2;
  }

  public org.apache.struts.upload.FormFile getFile3() {
    return file3;
  }

  public void setFile3(org.apache.struts.upload.FormFile file3) {
    this.file3 = file3;
  }

  public org.apache.struts.upload.FormFile getFile4() {
    return file4;
  }

  public void setFile4(org.apache.struts.upload.FormFile file4) {
    this.file4 = file4;
  }

  //End block

    /**
     * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping,
     *                                                javax.servlet.http.HttpServletRequest)
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        // reset any boolean data types to false
    }

    /**
     * <code>ObjectFactory</code> - used if indexed properties exist on this form.
     *
     * @see org.apache.commons.collections.ListUtils
     */
    class ObjectFactory implements org.apache.commons.collections.Factory {
        private String name;
        /**
         * Create a new instance of the specified object
         */
        public Object create() {
	    	Class c = null;
	    	try {
		    	c = Class.forName("org.appfuse.webapp.form." + name + "Form");
	            return c.newInstance();
			} catch (Exception e) {
	            System.err.println("Error instantiating class: " + c.getName());
	            throw new RuntimeException(e);
			}
        }
        public ObjectFactory(String name) {
        	this.name = name;
        }
    }
}
