View Javadoc
1   /*
2    * This software was designed and created by Jason Carroll.
3    * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4    * The author can be reached at jcarroll@cowsultants.com
5    * ITracker website: http://www.cowsultants.com
6    * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7    *
8    * This program is free software; you can redistribute it and/or modify
9    * it only under the terms of the GNU General Public License as published by
10   * the Free Software Foundation; either version 2 of the License, or
11   * (at your option) any later version.
12   *
13   * This program is distributed in the hope that it will be useful,
14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   * GNU General Public License for more details.
17   */
18  
19  package org.itracker.web.forms;
20  
21  import org.apache.struts.action.ActionErrors;
22  import org.apache.struts.action.ActionMapping;
23  import org.apache.struts.validator.ValidatorForm;
24  import org.itracker.model.NameValuePair;
25  
26  import javax.servlet.http.HttpServletRequest;
27  import java.util.List;
28  import java.util.Map;
29  import java.util.TreeMap;
30  
31  /**
32   * This is the LoginForm Struts Form. It is used by Login form.
33   *
34   * @author ready
35   */
36  public class ConfigurationForm extends ValidatorForm {
37      /**
38       *
39       */
40      private static final long serialVersionUID = 1L;
41      String action;
42      Integer id;
43      String value;
44      Integer order;
45      String key;
46      String typeKey;
47  
48      // let's try to put String,String here:
49      Map<String, String> translations = new TreeMap<>();
50      private Map<NameValuePair, List<NameValuePair>> languages;
51  
52      /*
53        * public void reset(ActionMapping mapping, HttpServletRequest request) {
54        * action = null; id = null; value = null; order = null; key = null;
55        * translations = null; }
56        */
57      public ActionErrors validate(ActionMapping mapping,
58                                   HttpServletRequest request) {
59          ActionErrors errors = super.validate(mapping, request);
60  
61          return errors;
62      }
63  
64      public String getAction() {
65          return action;
66      }
67  
68      public void setAction(String action) {
69          this.action = action;
70      }
71  
72      public Integer getId() {
73          return id;
74      }
75  
76      public void setId(Integer id) {
77          this.id = id;
78      }
79  
80      public String getKey() {
81          return key;
82      }
83  
84      public void setKey(String key) {
85          this.key = key;
86      }
87  
88      public String getTypeKey() {
89          return typeKey;
90      }
91  
92      public void setTypeKey(String typeKey) {
93          this.typeKey = typeKey;
94      }
95  
96      public Integer getOrder() {
97          return order;
98      }
99  
100     public void setOrder(Integer order) {
101         this.order = order;
102     }
103 
104     // let's try to put String,String here:
105     public Map<String, String> getTranslations() {
106         return translations;
107     }
108 
109     // let's try to put String,String here:
110     public void setTranslations(Map<String, String> translations) {
111         this.translations = translations;
112     }
113 
114     public String getValue() {
115         return value;
116     }
117 
118     public void setValue(String value) {
119         this.value = value;
120     }
121 
122     public void setLanguages(Map<NameValuePair, List<NameValuePair>> languages) {
123         this.languages = languages;
124     }
125 
126     public Map<NameValuePair, List<NameValuePair>> getLanguages() {
127         return languages;
128     }
129 }