KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > portlets > entities > struts > EntityForm


1 package com.dotmarketing.portlets.entities.struts;
2
3
4 import javax.servlet.http.HttpServletRequest JavaDoc;
5
6 import org.apache.struts.action.ActionErrors;
7 import org.apache.struts.action.ActionMapping;
8 import org.apache.struts.validator.ValidatorForm;
9
10 import com.dotmarketing.util.Logger;
11 import com.liferay.portal.util.Constants;
12
13 public class EntityForm extends ValidatorForm {
14
15     private static final long serialVersionUID = 1L;
16
17     private String JavaDoc[] categories;
18
19     /** identifier field */
20     private long inode;
21
22     /** persistent field */
23     private String JavaDoc entityName;
24
25     /** default constructor */
26     public EntityForm() {
27     }
28
29     public long getInode() {
30         return this.inode;
31     }
32
33     public void setInode(long inode) {
34         this.inode = inode;
35     }
36
37     /**
38      * Returns the entityName.
39      * @return String
40      */

41     public String JavaDoc getEntityName() {
42         return entityName;
43     }
44
45     /**
46      * Sets the entityName.
47      * @param entityName The entityName to set
48      */

49     public void setEntityName(String JavaDoc entityName) {
50         this.entityName = entityName;
51     }
52
53     /**
54      * Returns the categories.
55      * @return String[]
56      */

57     public String JavaDoc[] getCategories() {
58         return categories;
59     }
60
61     /**
62      * Sets the categories.
63      * @param categories The categories to set
64      */

65     public void setCategories(String JavaDoc[] categories) {
66         this.categories = categories;
67     }
68     
69     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request) {
70         if(request.getParameter("cmd")!=null && request.getParameter("cmd").equals(Constants.ADD)) {
71             Logger.debug(this, "Entity validation!!!!!!");
72             return super.validate(mapping, request);
73         }
74         return null;
75     }
76
77 }
78
Popular Tags