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: DestinationAddConfirmForm.java 10139 2007-04-02 15:16:44Z danesa $
023: * --------------------------------------------------------------------------
024: */package org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect;
025:
026: import javax.servlet.http.HttpServletRequest;
027:
028: import org.apache.struts.action.ActionErrors;
029: import org.apache.struts.action.ActionForm;
030: import org.apache.struts.action.ActionMapping;
031: import org.apache.struts.action.ActionMessage;
032:
033: /**
034: * @author Adriana Danes
035: */
036: public class DestinationAddConfirmForm extends ActionForm {
037:
038: // ------------------------------------------------------- Constants
039:
040: // ------------------------------------------------------- Properties variables
041:
042: private String name = null;
043: private String type = null;
044: private String proprieties = null;
045:
046: // ------------------------------------------------------- Public Methods
047:
048: /**
049: * Reset all properties to their default values.
050: *
051: * @param mapping The mapping used to select this instance
052: * @param request The servlet request we are processing
053: */
054: public void reset(ActionMapping mapping, HttpServletRequest request) {
055: name = null;
056: type = null;
057: }
058:
059: /**
060: * Validate the properties that have been set from this HTTP request,
061: * and return an <code>ActionErrors</code> object that encapsulates any
062: * validation errors that have been found. If no errors are found, return
063: * <code>null</code> or an <code>ActionErrors</code> object with no
064: * recorded error messages.
065: *
066: * @param mapping The mapping used to select this instance
067: * @param request The servlet request we are processing
068: * @return List of errors
069: */
070: public ActionErrors validate(ActionMapping mapping,
071: HttpServletRequest request) {
072: ActionErrors oErrors = new ActionErrors();
073: if ((getName() == null) || (getName().length() == 0)) {
074: oErrors
075: .add(
076: "name",
077: new ActionMessage(
078: "error.joansmqconnect.resource.jms.create.name.required"));
079: }
080: if (getType() == null) {
081: oErrors
082: .add(
083: "type",
084: new ActionMessage(
085: "error.joansmqconnect.resource.jms.create.type.required"));
086: }
087: return oErrors;
088: }
089:
090: // ----------------------------------------------------- Properties Methods
091:
092: public String getName() {
093: return name;
094: }
095:
096: public void setName(String name) {
097: this .name = name;
098: }
099:
100: public String getType() {
101: return type;
102: }
103:
104: public void setType(String type) {
105: this .type = type;
106: }
107:
108: /**
109: * @return the proprieties
110: */
111: public String getProprieties() {
112: return proprieties;
113: }
114:
115: /**
116: * @param proprieties the proprieties to set
117: */
118: public void setProprieties(String proprieties) {
119: this.proprieties = proprieties;
120: }
121:
122: }
|