001: package org.objectweb.jonas.webapp.jonasadmin.jonasmqconnect;
002:
003: import javax.servlet.http.HttpServletRequest;
004:
005: import org.apache.struts.action.ActionErrors;
006: import org.apache.struts.action.ActionForm;
007: import org.apache.struts.action.ActionMapping;
008:
009: public class DestinationDeleteConfirmForm extends ActionForm {
010: /**
011: * debug or not
012: */
013: private boolean debug = false;
014:
015: /**
016: * printe debug msg
017: * @param s msg
018: */
019: private void debug(String s) {
020: if (debug)
021: System.out.println(s);
022: }
023:
024: // ------------------------------------------------------- Public Methods
025:
026: /**
027: * Reset all properties to their default values.
028: *
029: * @param mapping The mapping used to select this instance
030: * @param request The servlet request we are processing
031: */
032: public void reset(ActionMapping mapping, HttpServletRequest request) {
033: // selectedDestinations = null;
034: }
035:
036: /**
037: * Validate the properties that have been set from this HTTP request,
038: * and return an <code>ActionErrors</code> object that encapsulates any
039: * validation errors that have been found. If no errors are found, return
040: * <code>null</code> or an <code>ActionErrors</code> object with no
041: * recorded error messages.
042: *
043: * @param mapping The mapping used to select this instance
044: * @param request The servlet request we are processing
045: * @return List of errors
046: */
047: public ActionErrors validate(ActionMapping mapping,
048: HttpServletRequest request) {
049: ActionErrors oErrors = new ActionErrors();
050: // if ((selectedDestinations == null) ||
051: // (selectedDestinations.length == 0)) {
052: // oErrors.add("selectedDestinations",
053: // new ActionMessage(
054: // "error.joansmqconnect.resource.jms.create.selecteddestinations.empty"));
055: // }
056: // if ((deletePhysicalDestination == null) ||
057: // (selectedDestinations.length == 0)) {
058: // oErrors.add("deletePhysicalDestination",
059: // new ActionMessage(
060: // "error.joansmqconnect.resource.jms.create." +
061: // "deletephysicaldestination.empty"));
062: // }
063: return oErrors;
064: }
065:
066: // ----------------------------------------------------- Properties Methods
067:
068: /**
069: * Selected destinations in string
070: */
071: private String destinationsStr;
072:
073: /**
074: * remove Physical Destination ?
075: */
076: private String deletePhysicalDestination = null;
077:
078: /**
079: * @return the removePhysicalDestination
080: */
081: public String getDeletePhysicalDestination() {
082: debug("DestinationDeleteConfirmForm#getDeletePhysicalDestination()");
083: return deletePhysicalDestination;
084: }
085:
086: /**
087: * @param deletePhysicalDestination the removePhysicalDestination to set
088: */
089: public void setDeletePhysicalDestination(
090: String deletePhysicalDestination) {
091: debug("DestinationDeleteConfirmForm#setDeletePhysicalDestination("
092: + deletePhysicalDestination + ")");
093: this .deletePhysicalDestination = deletePhysicalDestination;
094: }
095:
096: /**
097: * get DestinationsStr
098: * @return DestinationsStr
099: */
100: public String getDestinationsStr() {
101: debug("DestinationDeleteConfirmForm#getDestinationsStr()");
102: return destinationsStr;
103: }
104:
105: /**
106: * set DestinationsStr
107: * @param destinationsStr
108: */
109: public void setDestinationsStr(String destinationsStr) {
110: debug("DestinationDeleteConfirmForm#setDestinationsStr("
111: + destinationsStr + ")");
112: this.destinationsStr = destinationsStr;
113: }
114: }
|