001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: MailFactoryForm.java 6599 2005-04-21 08:59:54Z kemlerp $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.webapp.jonasadmin.service.mail;
027:
028: import java.util.ArrayList;
029:
030: import javax.servlet.http.HttpServletRequest;
031:
032: import org.apache.struts.action.ActionMessage;
033: import org.apache.struts.action.ActionErrors;
034: import org.apache.struts.action.ActionForm;
035: import org.apache.struts.action.ActionMapping;
036:
037: /**
038: * @author Adriana Danes
039: */
040: public class MailFactoryForm extends ActionForm {
041: // --------------------------------------------------------- Constants
042:
043: // --------------------------------------------------------- Properties variables
044:
045: private String action = null;
046:
047: private String mailFactoryName = null;
048: private String jndiName = null;
049: // authentication props
050: private String username = null;
051: private String password = null;
052: // mail session props
053: private String sessionProps = null;
054: // mimepart datasource message props
055: private String to = null;
056: private String subject = null;
057: private String cc = null;
058: private String bcc = null;
059:
060: private ArrayList listUsedByEjb = new ArrayList();
061:
062: // --------------------------------------------------------- Public Methods
063:
064: /**
065: * Reset all properties to their default values.
066: *
067: * @param mapping The mapping used to select this instance
068: * @param request The servlet request we are processing
069: */
070:
071: public void reset(ActionMapping mapping, HttpServletRequest request) {
072: action = "apply";
073: }
074:
075: /**
076: * Validate the properties that have been set from this HTTP request,
077: * and return an <code>ActionErrors</code> object that encapsulates any
078: * validation errors that have been found. If no errors are found, return
079: * <code>null</code> or an <code>ActionErrors</code> object with no
080: * recorded error messages.
081: *
082: * @param mapping The mapping used to select this instance
083: * @param request The servlet request we are processing
084: * @return List of errors
085: */
086: public ActionErrors validate(ActionMapping mapping,
087: HttpServletRequest request) {
088: ActionErrors oErrors = new ActionErrors();
089: if (jndiName.length() == 0) {
090: oErrors.add("jndiName", new ActionMessage(
091: "error.mailservice.mailfactory.emptyjndiname"));
092: }
093: return oErrors;
094: }
095:
096: public String getAction() {
097: return action;
098: }
099:
100: public void setAction(String action) {
101: this .action = action;
102: }
103:
104: public String getMailFactoryName() {
105: return mailFactoryName;
106: }
107:
108: public void setMailFactoryName(String mailFactoryName) {
109: this .mailFactoryName = mailFactoryName;
110: }
111:
112: public String getJndiName() {
113: return jndiName;
114: }
115:
116: public void setJndiName(String jndiName) {
117: this .jndiName = jndiName;
118: }
119:
120: public String getUsername() {
121: return username;
122: }
123:
124: public void setUsername(String username) {
125: this .username = username;
126: }
127:
128: public String getPassword() {
129: return password;
130: }
131:
132: public void setPassword(String password) {
133: this .password = password;
134: }
135:
136: public String getSessionProps() {
137: return sessionProps;
138: }
139:
140: public void setSessionProps(String sessionProps) {
141: this .sessionProps = sessionProps;
142: }
143:
144: public String getTo() {
145: return to;
146: }
147:
148: public void setTo(String to) {
149: this .to = to;
150: }
151:
152: public String getSubject() {
153: return subject;
154: }
155:
156: public void setSubject(String subject) {
157: this .subject = subject;
158: }
159:
160: public String getCc() {
161: return cc;
162: }
163:
164: public void setCc(String cc) {
165: this .cc = cc;
166: }
167:
168: public String getBcc() {
169: return bcc;
170: }
171:
172: public void setBcc(String bcc) {
173: this .bcc = bcc;
174: }
175:
176: /*
177: public String get() {
178: return ;
179: }
180:
181: public void set(String ) {
182: this. = ;
183: }
184: */
185:
186: public ArrayList getListUsedByEjb() {
187: return listUsedByEjb;
188: }
189:
190: public void setListUsedByEjb(ArrayList listUsedByEjb) {
191: this.listUsedByEjb = listUsedByEjb;
192: }
193:
194: }
|