KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > jonasadmin > service > mail > MailFactoryForm


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: MailFactoryForm.java,v 1.4 2005/04/21 08:59:54 kemlerp Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.webapp.jonasadmin.service.mail;
27
28 import java.util.ArrayList JavaDoc;
29
30 import javax.servlet.http.HttpServletRequest JavaDoc;
31
32 import org.apache.struts.action.ActionMessage;
33 import org.apache.struts.action.ActionErrors;
34 import org.apache.struts.action.ActionForm;
35 import org.apache.struts.action.ActionMapping;
36
37 /**
38  * @author Adriana Danes
39  */

40 public class MailFactoryForm extends ActionForm {
41 // --------------------------------------------------------- Constants
42

43 // --------------------------------------------------------- Properties variables
44

45     private String JavaDoc action = null;
46
47     private String JavaDoc mailFactoryName = null;
48     private String JavaDoc jndiName = null;
49     // authentication props
50
private String JavaDoc username = null;
51     private String JavaDoc password = null;
52     // mail session props
53
private String JavaDoc sessionProps = null;
54     // mimepart datasource message props
55
private String JavaDoc to = null;
56     private String JavaDoc subject = null;
57     private String JavaDoc cc = null;
58     private String JavaDoc bcc = null;
59
60     private ArrayList JavaDoc listUsedByEjb = new ArrayList JavaDoc();
61
62 // --------------------------------------------------------- Public Methods
63

64     /**
65      * Reset all properties to their default values.
66      *
67      * @param mapping The mapping used to select this instance
68      * @param request The servlet request we are processing
69      */

70
71     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
72         action = "apply";
73     }
74
75     /**
76      * Validate the properties that have been set from this HTTP request,
77      * and return an <code>ActionErrors</code> object that encapsulates any
78      * validation errors that have been found. If no errors are found, return
79      * <code>null</code> or an <code>ActionErrors</code> object with no
80      * recorded error messages.
81      *
82      * @param mapping The mapping used to select this instance
83      * @param request The servlet request we are processing
84      * @return List of errors
85      */

86     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request) {
87         ActionErrors oErrors = new ActionErrors();
88         if (jndiName.length() == 0) {
89             oErrors.add("jndiName", new ActionMessage("error.mailservice.mailfactory.emptyjndiname"));
90         }
91         return oErrors;
92     }
93
94     public String JavaDoc getAction() {
95         return action;
96     }
97
98     public void setAction(String JavaDoc action) {
99         this.action = action;
100     }
101
102     public String JavaDoc getMailFactoryName() {
103         return mailFactoryName;
104     }
105
106     public void setMailFactoryName(String JavaDoc mailFactoryName) {
107         this.mailFactoryName = mailFactoryName;
108     }
109
110     public String JavaDoc getJndiName() {
111         return jndiName;
112     }
113
114     public void setJndiName(String JavaDoc jndiName) {
115         this.jndiName = jndiName;
116     }
117
118     public String JavaDoc getUsername() {
119         return username;
120     }
121
122     public void setUsername(String JavaDoc username) {
123         this.username = username;
124     }
125
126     public String JavaDoc getPassword() {
127         return password;
128     }
129
130     public void setPassword(String JavaDoc password) {
131         this.password = password;
132     }
133
134     public String JavaDoc getSessionProps() {
135         return sessionProps;
136     }
137
138     public void setSessionProps(String JavaDoc sessionProps) {
139         this.sessionProps = sessionProps;
140     }
141
142     public String JavaDoc getTo() {
143         return to;
144     }
145
146     public void setTo(String JavaDoc to) {
147         this.to = to;
148     }
149
150     public String JavaDoc getSubject() {
151         return subject;
152     }
153
154     public void setSubject(String JavaDoc subject) {
155         this.subject = subject;
156     }
157
158     public String JavaDoc getCc() {
159         return cc;
160     }
161
162     public void setCc(String JavaDoc cc) {
163         this.cc = cc;
164     }
165
166     public String JavaDoc getBcc() {
167         return bcc;
168     }
169
170     public void setBcc(String JavaDoc bcc) {
171         this.bcc = bcc;
172     }
173
174     /*
175     public String get() {
176         return ;
177     }
178
179     public void set(String ) {
180         this. = ;
181     }
182     */

183
184     public ArrayList JavaDoc getListUsedByEjb() {
185         return listUsedByEjb;
186     }
187
188     public void setListUsedByEjb(ArrayList JavaDoc listUsedByEjb) {
189         this.listUsedByEjb = listUsedByEjb;
190     }
191
192 }
193
Popular Tags