View Javadoc

1   package be.dvw.administration.mvc.forms;
2   
3   import org.apache.struts.action.*;
4   import org.apache.struts.validator.ValidatorForm;
5   import org.apache.commons.logging.Log;
6   import org.apache.commons.logging.LogFactory;
7   
8   import javax.servlet.http.HttpServletRequest;
9   
10  /***
11   * Created by IntelliJ IDEA.
12   * User: Toon.Timbermont
13   * Date: Jun 11, 2005
14   * Time: 4:09:41 PM
15   * To change this template use File | Settings | File Templates.
16   */
17  public class ScoreForm extends ValidatorForm {
18  
19  	private static Log LOG = LogFactory.getLog(ScoreForm.class);
20  
21  	private String id = null;
22      private String name = null;
23  	private String price = null;
24  	private String description = null;
25  	private String composer = null;
26  
27      public String getId() {
28          return id;
29      }
30  
31      public void setId(String id) {
32          this.id = id;
33      }
34  
35  	public String getName() {
36  		return name;
37  	}
38  
39  	public void setName(String name) {
40  		this.name = name;
41  	}
42  
43  	public String getComposer()
44  	{
45  		return composer;
46  	}
47  
48  	public void setComposer(String composer)
49  	{
50  		this.composer = composer;
51  	}
52  
53  	public String getDescription() {
54  		return description;
55  	}
56  
57  	public void setDescription(String description) {
58  		this.description = description;
59  	}
60  
61  	public String getPrice() {
62  		return price;
63  	}
64  
65  	public void setPrice(String price) {
66  		this.price = price;
67  	}
68  
69  
70  // --------------------------------------------------------- Public Methods
71  
72  	/***
73  	 * Reset all properties to their default values.
74  	 *
75  	 * @param mapping The mapping used to select this instance
76  	 * @param request The servlet request we are processing
77  	 */
78  	public void reset(ActionMapping mapping, HttpServletRequest request) {
79  		this.name = null;
80  	}
81  
82  
83  	public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest)
84  	{
85  
86  		LOG.debug ("entering validation");
87  		return super.validate(actionMapping, httpServletRequest);    //To change body of overridden methods use File | Settings | File Templates.
88  		
89  	}
90  
91  
92  	/***
93  	 * Validate the properties posted in this request. If validation errors are
94  	 * found, return an <code>ActionErrors</code> object containing the errors.
95  	 * If no validation errors occur, return <code>null</code> or an empty
96  	 * <code>ActionErrors</code> object.
97  	 *
98  	 * @param mapping The current mapping (from struts-config.xml)
99  	 * @param request The servlet request object
100 	 */
101 	/*public ActionErrors validate(ActionMapping mapping,
102 	HttpServletRequest request) {
103 
104 	ActionErrors errors = new ActionErrors();
105 
106 	if ((name == null) || (name.length() < 1))
107 	errors.add( "name", new ActionMessage("scores.edit.form.field.name.error") );
108 	if ((composer == null) || (composer.length() < 1))
109 	errors.add( "composer", new ActionMessage("scores.edit.form.field.composer.error") );
110 	if ((price == null) || (price.length() < 1))
111 	errors.add( "price", new ActionMessage("scores.edit.form.field.price.error") );
112 	if ((description == null) || (description.length() < 1))
113 	errors.add( "description", new ActionMessage("scores.edit.form.field.description.error") );
114 
115 	return errors;
116 	}*/
117 
118 
119 }