husted      2002/11/23 11:05:49

  Modified:    scaffold/src/java/org/apache/commons/scaffold/util
                        ProcessBeanBase.java ProcessBean.java
  Added:       scaffold/src/java/org/apache/commons/scaffold/util
                        MessagesImpl.java Messages.java MessageImpl.java
                        Message.java BizServiceImpl.java BizService.java
                        BizResponseImpl.java BizResponse.java
                        BizRequestImpl.java BizRequest.java
  Log:
  + BizService*: Initial verions based on code (as opposed to data) portions of 
ProcessBean.
  + BizResponse*: initial versions based on ProcessResult*.
  + BizRequest*: Initial versions based on DTO portion of ProcessBean*.
  + Message,MessageImpl;Messages,MessageImpl: Initial versions (based on Struts 
ActionError?).
  + ProcessBean,ProcessBeanBase: Add parameter property.
  
  Revision  Changes    Path
  1.9       +17 -1     
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/ProcessBeanBase.java
  
  Index: ProcessBeanBase.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/ProcessBeanBase.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ProcessBeanBase.java      23 Nov 2002 02:45:55 -0000      1.8
  +++ ProcessBeanBase.java      23 Nov 2002 19:05:49 -0000      1.9
  @@ -107,6 +107,22 @@
       }
   
   
  +    /**
  +     * The parameter
  +     */
  +    private String parameter = null;
  +
  +
  +    public String getParameter() {
  +        return (this.parameter);
  +    }
  +
  +
  +    public void setParameter(String parameter) {
  +        this.parameter = parameter;
  +    }
  +
  +
   // --------------------------------------------------------- Public Methods
   
   
  
  
  
  1.6       +13 -1     
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/ProcessBean.java
  
  Index: ProcessBean.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/ProcessBean.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ProcessBean.java  21 Nov 2002 02:06:16 -0000      1.5
  +++ ProcessBean.java  23 Nov 2002 19:05:49 -0000      1.6
  @@ -87,6 +87,18 @@
       public void setRemoteServer(Object server);
   
   
  +    /**
  +     * Return the parameter.
  +     */
  +    public String getParameter();
  +
  +
  +    /**
  +     * Set the parameter.
  +     * @param parameter The new parameter
  +     */
  +    public void setParameter(String parameter);
  +    
   
   // ------------------------------------------------------- Public Methods
   
  
  
  
  1.1                  
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/MessagesImpl.java
  
  Index: MessagesImpl.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/MessagesImpl.java,v
 1.1 2002/11/23 19:05:49 husted Exp $
   * $Revision: 1.1 $
   * $Date: 2002/11/23 19:05:49 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Struts", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.commons.scaffold.util;
  
  
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Comparator;
  import java.util.Iterator;
  import java.util.HashMap;
  import java.util.List;
  
  // ------------------------------------------------------------------------ 78
  
  public class MessagesImpl implements Serializable,Messages {
  
        /**
         * The accumulated set of <code>Message</code> objects (represented
         * as an ArrayList) for each property, keyed by property name.
         */
        protected HashMap messages = new HashMap();
  
        /**
         * The current number of the property/key being added.  This is used
         * to maintain the order messages are added.
        */
        protected int iCount = 0;
  
        // --------------------------------------------------------- Public Methods
  
        /**
         * Create an empty <code>Messages</code> object.
         */
        public MessagesImpl() {
                super();
        }
  
        /**
         * Create an <code>AMessages</code> object initialized with the given 
         * messages.
         * 
         * @param messages The messages to be initially added to this object.
         * @since Struts 1.1
         */
        public MessagesImpl(Messages messages) {
                super();
                this.add(messages);
        }
  
  
        // See interface for JavaDoc
        public void add(String property, Message message) {
  
                MessageItem item = (MessageItem) messages.get(property);
                List list = null;
  
                if (item == null) {
                        list = new ArrayList();
                        item = new MessageItem(list, iCount++);
  
                        messages.put(property, item);
                } else {
                        list = item.getList();
                }
  
                list.add(message);
  
        }
  
  
        // See interface for JavaDoc
        public void add(Message message) {
                
                add(Messages.GLOBAL_MESSAGE_KEY,message);
        }
  
  
        // See interface for JavaDoc
        public void add(Messages messages) {
                // loop over properties
                Iterator props = messages.properties();
                while (props.hasNext()) {
                        String property = (String) props.next();
  
                        // loop over messages for each property
                        Iterator msgs = messages.get(property);
                        while (msgs.hasNext()) {
                                Message msg = (Message) msgs.next();
                                this.add(property, msg);
                        }
  
                }
        }
  
        // See interface for JavaDoc
        public void clear() {
  
                messages.clear();
  
        }
  
        // See interface for JavaDoc
        public boolean empty() {
                return (this.isEmpty());
        }
        
        // See interface for JavaDoc
        public boolean isEmpty(){
                return (messages.isEmpty());    
        }
  
        // See interface for JavaDoc
        public Iterator get() {
  
                if (messages.size() == 0) {
                        return (Collections.EMPTY_LIST.iterator());
                }
  
                ArrayList results = new ArrayList();
                ArrayList actionItems = new ArrayList();
  
                for (Iterator i = messages.values().iterator(); i.hasNext();) {
                        actionItems.add(i.next());
                }
  
                // Sort MessageItems based on the initial order the
                // property/key was added to Messages.
                Collections.sort(actionItems, new Comparator() {
                        public int compare(Object o1, Object o2) {
                                return ((MessageItem) o1).getOrder() - ((MessageItem) 
o2).getOrder();
                        }
                });
  
                for (Iterator i = actionItems.iterator(); i.hasNext();) {
                        MessageItem ami = (MessageItem) i.next();
  
                        for (Iterator messages = ami.getList().iterator(); 
messages.hasNext();) {
                                results.add(messages.next());
                        }
                }
  
                return (results.iterator());
  
        }
  
        // See interface for JavaDoc
        public Iterator get(String property) {
  
                MessageItem item = (MessageItem) messages.get(property);
  
                if (item == null) {
                        return (Collections.EMPTY_LIST.iterator());
                } else {
                        return (item.getList().iterator());
                }
                
        }
  
        // See interface for JavaDoc
        public Iterator properties() {
  
                return (messages.keySet().iterator());
  
        }
  
        // See interface for JavaDoc
        public int size() {
  
                int total = 0;
  
                for (Iterator i = messages.values().iterator(); i.hasNext();) {
                        MessageItem ami = (MessageItem) i.next();
                        total += ami.getList().size();
                }
  
                return (total);
  
        }
  
        // See interface for JavaDoc
        public int size(String property) {
  
                MessageItem ami = (MessageItem) messages.get(property);
  
                if (ami == null)
                        return (0);
                else
                        return (ami.getList().size());
  
        }
  
        // See interface for JavaDoc
        protected class MessageItem implements Serializable {
  
                /**
                 * The list of <code>Message</code>s.
                 */
                protected List list = null;
  
                /**
                 * The position in the list of messages.
                 */
                protected int iOrder = 0;
  
                public MessageItem(List list, int iOrder) {
                        this.list = list;
                        this.iOrder = iOrder;
                }
  
                public List getList() {
                        return list;
                }
  
                public void setList(List list) {
                        this.list = list;
                }
  
                public int getOrder() {
                        return iOrder;
                }
  
                public void setOrder(int iOrder) {
                        this.iOrder = iOrder;
                }
  
        }
  
  } // end MessagesImpl
  
  
  
  1.1                  
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/Messages.java
  
  Index: Messages.java
  ===================================================================
  package org.apache.commons.scaffold.util;
  
  
  import java.util.Iterator;
  
  /**
   * <p>
   * A class that encapsulates messages. Messages can be either global
   * or they are specific to a particular bean property.
   * </p>
   * <p>
   * Each individual message is described by an <code>Message</code>
   * object, which contains a message key (to be looked up in an appropriate
   * message resources database), and up to four placeholder arguments used for
   * parametric substitution in the resulting message.
   * </p>
   * <p>
   * <strong>IMPLEMENTATION NOTE</strong> - It is assumed that these objects
   * are created and manipulated only within the context of a single thread.
   * Therefore, no synchronization is required for access to internal
   * collections.
   * </p>
   * @author David Geary
   * @author Craig R. McClanahan
   * @author David Winterfeldt
   * @author David Graham
   * @author Ted Husted
   * @version $Revision: 1.1 $ $Date: 2002/11/23 19:05:49 $
   */
  public interface Messages {
  
        public static final String GLOBAL_MESSAGE_KEY = "GLOBAL_MESSAGE";
  
        /**
         * Add a message to the set of messages for the specified property.  An
         * order of the property/key is maintained based on the initial addition
         * of the property/key.
         *
         * @param property  Property name (or Messages.GLOBAL_MESSAGE_KEY)
         * @param message   The message to be added
         */
        public void add(String property, Message message);
  
        /**
         * Add a message to the set of messages for the "global" property.  An
         * order of the property/key is maintained based on the initial addition
         * of the property/key.
         *
         * @param message   The message to be added
         */
        public void add(Message message);
  
        /**
         * Adds the messages from the given <code>Messages</code> object to
         * this set of messages. The messages are added in the order they are returned 
from
         * the properties() method. If a message's property is already in the current 
         * <code>Messages</code> object it is added to the end of the list for that
         * property. If a message's property is not in the current list it is added to 
the end 
         * of the properties.
         * 
         * @param messages The <code>Messages</code> object to be added.
         */
        public void add(Messages messages);
  
        /**
         * Clear all messages recorded by this object.
         */
        public void clear();
  
        /**
         * Return <code>true</code> if there are no messages recorded
         * in this collection, or <code>false</code> otherwise.
         * @deprecated Use isEmpty instead.
         */
        public boolean empty();
        
        /**
         * Return <code>true</code> if there are no messages recorded
         * in this collection, or <code>false</code> otherwise.
         */
        public boolean isEmpty();
  
        /**
         * Return the set of all recorded messages, without distinction
         * by which property the messages are associated with.  If there are
         * no messages recorded, an empty enumeration is returned.
         */
        public Iterator get();
  
        /**
         * Return the set of messages related to a specific property.
         * If there are no such messages, an empty enumeration is returned.
         *
         * @param property Property name (or ActionMessages.GLOBAL_MESSAGE_KEY)
         */
        public Iterator get(String property);
  
        /**
         * Return the set of property names for which at least one message has
         * been recorded.  If there are no messages, an empty Iterator is returned.
         * If you have recorded global messages, the String value of
         * <code>Messages.GLOBAL_MESSAGE</code> will be one of the returned
         * property names.
         */
        public Iterator properties();
  
        /**
         * Return the number of messages recorded for all properties (including
         * global messages).  <strong>NOTE</strong> - it is more efficient to call
         * <code>empty()</code> if all you care about is whether or not there are
         * any messages at all.
         */
        public int size();
  
        /**
         * Return the number of messages associated with the specified property.
         *
         * @param property Property name (or Messages.GLOBAL_MESSAGE_KEY
         */
        public int size(String property);
  
  } // end Messages
  
  
  
   /*
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
    *    any, must include the following acknowlegement:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
    *    from this software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache"
    *    nor may "Apache" appear in their names without prior written
    *    permission of the Apache Group.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
    */
  
  
  
  
  1.1                  
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/MessageImpl.java
  
  Index: MessageImpl.java
  ===================================================================
  /*
   * $Header: 
/home/cvs/jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/MessageImpl.java,v
 1.1 2002/11/23 19:05:49 husted Exp $
   * $Revision: 1.1 $
   * $Date: 2002/11/23 19:05:49 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Struts", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  
  package org.apache.commons.scaffold.util;
  
  
  import java.io.Serializable;
  
  // ------------------------------------------------------------------------ 78
  
  public class MessageImpl implements Serializable,Message {
  
  
  // -------------------------------------------------------------- Constructors
  
  
      /**
       * Construct an action message with no replacement values.
       *
       * @param key Message key for this message
       */
      public MessageImpl(String key) {
  
          this.key = key;
          this.values = null;
  
      }
  
  
      /**
       * Construct an action message with the specified replacement values.
       *
       * @param key Message key for this message
       * @param value0 First replacement value
       */
      public MessageImpl(String key, Object value0) {
  
          this.key = key;
          this.values = new Object[] { value0 };
  
      }
  
  
      /**
       * Construct an action message with the specified replacement values.
       *
       * @param key Message key for this message
       * @param value0 First replacement value
       * @param value1 Second replacement value
       */
      public MessageImpl(String key, Object value0, Object value1) {
  
          this.key = key;
          this.values = new Object[] { value0, value1 };
  
      }
  
  
      /**
       * Construct an action message with the specified replacement values.
       *
       * @param key Message key for this message
       * @param value0 First replacement value
       * @param value1 Second replacement value
       * @param value2 Third replacement value
       */
      public MessageImpl(String key, Object value0, Object value1,
                         Object value2) {
  
          this.key = key;
          this.values = new Object[] { value0, value1, value2 };
  
      }
  
  
      /**
       * Construct an action message with the specified replacement values.
       *
       * @param key Message key for this message
       * @param value0 First replacement value
       * @param value1 Second replacement value
       * @param value2 Third replacement value
       * @param value3 Fourth replacement value
       */
      public MessageImpl(String key, Object value0, Object value1,
                         Object value2, Object value3) {
  
          this.key = key;
          this.values = new Object[] { value0, value1, value2, value3 };
      }
  
  
      /**
       * Construct an action message with the specified replacement values.
       *
       * @param key Message key for this message
       * @param values Array of replacement values
       */
      public MessageImpl(String key, Object[] values) {
  
          this.key = key;
          this.values = values;
  
      }
  
  
  // -------------------------------------------------------- Instance Variables
  
  
      /**
       * The message key for this message.
       */
      protected String key = null;
  
  
      /**
       * The replacement values for this mesasge.
       */
      protected Object values[] = null;
  
  
      // --------------------------------------------------------- Public Methods
  
  
        // See interface for JavaDoc
      public String getKey() {
  
          return (this.key);
  
      }
  
  
        // See interface for JavaDoc
      public Object[] getValues() {
  
          return (this.values);
  
      }
  
  
  } // end MessageImpl
  
  
  
  1.1                  
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/Message.java
  
  Index: Message.java
  ===================================================================
  package org.apache.commons.scaffold.util;
  
  
  /**
   * An encapsulation of an individual message stored in a Messages object, consisting
   * of a message key (to be used to look up message text in an appropriate
   * message resources database) plus up to four placeholder objects that can
   * be used for parametric replacement in the message text.
   * @author Craig R. McClanahan
   * @author David Winterfeldt
   * @author Ted Husted
   * @version $Revision: 1.1 $ $Date: 2002/11/23 19:05:49 $
   */
  
  public interface Message {
  
      /**
       * Get the message key for this message.
       */
      public String getKey();
  
      /**
       * Get the replacement values for this message.
       */
      public Object[] getValues();
  
  } // end Message
  
  
  
   /*
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
    *    any, must include the following acknowlegement:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
    *    from this software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache"
    *    nor may "Apache" appear in their names without prior written
    *    permission of the Apache Group.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
    */
  
  
  
  1.1                  
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/BizServiceImpl.java
  
  Index: BizServiceImpl.java
  ===================================================================
  package org.apache.commons.scaffold.util;
  
  
  /**
   * Sample business service object.
   * Returns copy of request object. 
   * 
   * @author Ted Husted
   * @version $Revision: 1.1 $ $Date: 2002/11/23 19:05:49 $
   */
  public class BizServiceImpl implements BizService {
  
      /**
       * Sample business service method.
       * Returns copy of request object. 
       *
       * @exception Throws Exception on any error. 
       * A <code>ChainedException</code> is recommended.. 
       * @param request The bean containing the runtime parameters for 
       * this service.
       */
       public BizResponse process(BizRequest request) throws Exception {
                 
                BizResponse response = new BizResponseImpl(request);
        response.setSingleForm(true);
                return response;
         }
  
  } // end BizService
  
  
  
   /*
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
    *    any, must include the following acknowlegement:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
    *    from this software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache"
    *    nor may "Apache" appear in their names without prior written
    *    permission of the Apache Group.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
    */
  
  
  
  
  1.1                  
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/BizService.java
  
  Index: BizService.java
  ===================================================================
  package org.apache.commons.scaffold.util;
  
  
  /**
   * A business service facade. 
   * @author Ted Husted
   * @version $Revision: 1.1 $ $Date: 2002/11/23 19:05:49 $
   */
  public interface BizService {
  
      /**
       * Perform the business logic for this service, by retrieving any 
       * runtime properties from the <code>BizRequest</code> bean. 
       *
       * @exception Throws Exception on any error. 
       * A <code>ChainedException</code> is recommended.. 
       * @param request The bean containing the runtime parameters for 
       * this service.
       */
       public BizResponse process(BizRequest request) throws Exception;
  
  } // end BizService
  
  
  
   /*
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
    *    any, must include the following acknowlegement:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
    *    from this software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache"
    *    nor may "Apache" appear in their names without prior written
    *    permission of the Apache Group.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
    */
  
  
  
  
  1.1                  
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/BizResponseImpl.java
  
  Index: BizResponseImpl.java
  ===================================================================
  package org.apache.commons.scaffold.util;
  
  
  import java.io.Serializable;
  import org.apache.commons.scaffold.lang.Tokens;
  
  
  public class BizResponseImpl implements Serializable,BizResponse {
  
  
  // ----------------------------------------------------------- Properties
  
      /**
       * The attribute name for the result [null].
       */
      private String name = null;
  
  
        // See interface for JavaDoc
      public String getName() {
          return this.name;
      }
  
  
        // See interface for JavaDoc
      public void setName(String name) {
          this.name = name;
      }
  
  
      /**
       * Field to store the scope property [request].
       */
      private String scope = Tokens.REQUEST;
  
  
        // See interface for JavaDoc
      public String getScope() {
          return this.scope;
      }
  
  
        // See interface for JavaDoc
      public void setScope(String scope) {
          this.scope = scope;
      }
  
  
      /**
       * Field to store single-form state [false].
       */
      private boolean singleForm = false;
  
  
        // See interface for JavaDoc
      public boolean isSingleForm() {
          return this.singleForm;
      }
  
  
        // See interface for JavaDoc
      public void setSingleForm(boolean singleForm) {
          this.singleForm = singleForm;
      }
  
  
      /**
       * Field to store exposed property [true].
       */
      private boolean exposed = true;
  
  
        // See interface for JavaDoc
      public boolean isExposed() {
          return this.exposed;
      }
  
  
        // See interface for JavaDoc
      public void setExposed(boolean exposed) {
          this.exposed = exposed;
      }
  
  
      /**
       * Field to store the data property [null].
       */
      private Object data = null;
  
  
        // See interface for JavaDoc
      public Object getData() {
          return this.data;
      }
  
  
        // See interface for JavaDoc
      public void setData(Object data) {
          this.data = data;
      }
  
  
        // See interface for JavaDoc
      public boolean isData() {
          return (getData()!=null);
      }
  
  
      /**
       * Field to store the aggregate state  [false].
       */
      protected boolean aggregate = false;
  
  
        // See interface for JavaDoc
      public boolean isAggregate() {
          return aggregate;
      }
  
  
        // See interface for JavaDoc
      public void setAggregate(boolean aggregate) {
          this.aggregate = aggregate;
      }
  
  
      /**
       * Field to store the message property [ArrayList].
       */
      private Messages messages = new MessagesImpl();
  
  
        // See interface for JavaDoc
      public boolean isMessages() {
  
          Messages messages = getMessages();
  
          if (null==messages) return false;
  
          return !(messages.isEmpty());
  
      } // end isMessages()
  
  
        // See interface for JavaDoc
      public void addMessage(Message message, String property) {
         Messages messages = getMessages();
         messages.add(property,message);
      }
  
  
        // See interface for JavaDoc
      public void addMessage(Message message) {
         addMessage(message, Messages.GLOBAL_MESSAGE_KEY);
      }
  
  
        // See interface for JavaDoc
      public Messages getMessages() {
          return this.messages;
      }
  
  
        // See interface for JavaDoc
      public void setMessages(Messages messages) {
          this.messages = messages;
      }
  
  
      /**
       * Field to store dispatch property [null].
       */
      private String dispatch = null;
  
  
        // See interface for JavaDoc
      public String getDispatch() {
          return (this.dispatch);
      }
  
  
        // See interface for JavaDoc
      public void setDispatch(String dispatch) {
          this.dispatch = dispatch;
      }
  
  
        // See interface for JavaDoc
      public boolean isDispatch() {
          return (getDispatch()!=null);
      }
  
  
      /**
       * Field to store dispatchPath property [false].
       */
      private boolean dispatchPath = false;
  
  
        // See interface for JavaDoc
      public boolean isDispatchPath() {
          return this.dispatchPath;
      }
  
  
        // See interface for JavaDoc
      public void setDispatchPath(boolean dispatchPath) {
          this.dispatchPath = dispatchPath;
      }
  
  
      /**
       * Our scroller object for paging through lists.
       */
      protected Scroller scroller = null;
  
  
        // See interface for JavaDoc
      public void setScroller(Scroller scroller){
          this.scroller = scroller;
      }
  
  
        // See interface for JavaDoc
      public Scroller getScroller() {
          return this.scroller;
      }
  
  
  // ----------------------------------------------------------- Constructors
  
  
      /**
       * Default constructor.
       */
      public BizResponseImpl() {
          super();
      }
  
  
      /**
       * Convenience constructor to set result object.
       *
       * @param data The default data object
       */
      public BizResponseImpl(Object data) {
  
          super();
          setData(data);
  
      } // end BizResponseImpl
  
  
      /**
       * Convenience constructor to set result object
       * and singleForm status.
       *
       * @param data The default data object
       */
      public BizResponseImpl(Object data, boolean singleForm) {
  
          super();
          setData(data);
          setSingleForm(singleForm);
  
      } // end BizResponseImpl
  
  
      /**
       * Convenience constructor to set forwarding advice.
       *
       * @param dispatch  The default dispatch advice
       */
      public BizResponseImpl(String dispatch) {
  
          super();
          setDispatch(dispatch);
  
      } // end BizResponseImpl
  
  } // end BizResponseImpl
  
  
  /*
   *
   *    Copyright (c) 2002 Synthis Corporation.
   *    430 10th Street NW, Suite S-108, Atlanta GA 30318, U.S.A.
   *    All rights reserved.
   *
   *    This software is licensed to you free of charge under
   *    the Apache Software License, so long as this copyright
   *    statement, list of conditions, and comments,  remains
   *    in the source code.  See bottom of file for more
   *    license information.
   *
   *    This software was written to support code generation
   *    for the Apache Struts J2EE architecture by Synthis'
   *    visual application modeling tool Adalon.
   *
   *    For more information on Adalon and Struts code
   *    generation please visit http://www.synthis.com
   *
   */
  
  
   /*
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 2001 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
    *    any, must include the following acknowlegement:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
    *    from this software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache"
    *    nor may "Apache" appear in their names without prior written
    *    permission of the Apache Group.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
    */
  
  
  
  
  1.1                  
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/BizResponse.java
  
  Index: BizResponse.java
  ===================================================================
  package org.apache.commons.scaffold.util;
  
  import java.util.List;
  
  // ----------------------------------------------------------------------
  
  /**
   * Convenient wrapper for the result of a business process.
   * <p>
   * The <b>result</b> property returns any object generated by the
   * process that is to be returned to the presentation tier.
   *
   * The <b>messages</b> property is a list of any confirmation
   * messages to be displayed by the presentation tier.
   * These may be keys into a resource bundle, or literal text,
   * depending on whether the application is localized.
   *
   * The <b>dispatchPath</b> property returns any special advice regarding
   * the next step in the workflow. Null indicates the nominal "success"
   * path should be followed.
   *
   * The <b>data</b> property is any actual data returned from storage.
   * This may be a single record or a collection of records
   * (see <code>isSingleForm()</code>).
   *
   * @author Ted Husted
   * @version $Revision: 1.1 $ $Date: 2002/11/23 19:05:49 $
   */
  public interface BizResponse {
  
      /**
       * Return the attribute name for the result object.
       * <p>
       * Typically, this will be set by the caller but is provided
       * in case a special name must be used or a way is needed to
       * distingish between result objects.
       *
       * @return the name
       */
      public String getName();
  
  
      /**
       * Set the attribute name for this result object.
       *
       * @param name The new name
       */
      public void setName(String name);
  
  
      /**
       * Return the scope under which to store this result object.
       *
       * @return the scope
       */
      public String getScope();
  
  
      /**
       * Set the scope under which to store this result object.
       *
       * @param scope The new scope
       */
      public void setScope(String scope);
  
  
  
      /**
       * Return the single-form state:
       * list of 0 or more records=FALSE, exactly one record=TRUE.
       *
       * @returns True if this is a single record
       */
      public boolean isSingleForm();
  
  
      /**
       * Set the single-form state:
       * list of 0 or more records=FALSE, exactly one record=TRUE.
       *
       * @param Set to true for single form.
       */
      public void setSingleForm(boolean singleForm);
  
  
      /**
       * Return the exposed state.
       *
       * @return True if the result should be exposed
       */
      public boolean isExposed();
  
  
      /**
       * Indicates whether the result should be exposed
       * to the rest of the application through a context.
       *
       * @param multiple The new exposed
       */
      public void setExposed(boolean exposed);
  
  
      /**
       * Return the data object.
       *
       * @returns The data object
       */
      public Object getData();
  
  
      /**
       * Assign a new data object.
       *
       * @param data The new data object
       */
      public void setData(Object data);
  
  
      /**
       * Return whether data object has been set.
       *
       * @returns True if this result contains a data object
       */
      public boolean isData();
  
  
      /**
       * Return whether the result of this ProcessResult is a collection of
       * contains other ProcessResult objects to be handled individually.
       * This allows processes to be combined on the business tier and
       * returned to controller as a single operation.
       *
       * @returns True if this ProcessResult contains other ProcessResults
       * objects
       */
      public boolean isAggregate();
  
  
      /**
       * Assign a new container state.
       *
       * @param aggregate Set to true for aggregate result
       */
      public void setAggregate(boolean aggregate);
  
  
      /**
       * Return the messages list.
       *
       * @returns The message list
       */
      public Messages getMessages();
  
  
      /**
       * Return whether there are any messages queued.
       *
       * @returns True if there are messages queued.
       */
      public boolean isMessages();
  
  
      /**
       * Add a message to the list.
       * Instantiate messages if it does not already exist.
       */
      public void addMessage(Message message, String property);
  
  
      /**
       * Add a message to the list.
       * Instantiate messages if it does not already exist.
       */
      public void addMessage(Message message);
  
  
      /**
       * The dispatch property can be used to re-route control to an non-default 
location,
       * either as a system path or via a logical name (e.g ActionForward).
       *
       * @see <code>setDispatchPath()</code>
       *
       * @returns The dispatch advice
       */
      public String getDispatch();
  
  
      /**
       * Field to store dispatch property.
       */
      public void setDispatch(String dispatch);
  
  
      /**
       * Return whether dispatch advice has been set.
       *
       * @returns True if dispatch advice has been set.
       */
      public boolean isDispatch();
  
  
      /**
       * Return whether dispatch advice is suppose to be a
       * true path or a logical name (e.g. ActionForward)
       *
       * @returns True if dispatch advice is an actual path
       */
      public boolean isDispatchPath();
  
  
      /**
       * Indicates whether dispatch advice (if any) is suppose to be a
       * path or a logical name (e.g. ActionForward).
       *
       * @param dispatchPath The new dispatch advice
       */
      public void setDispatchPath(boolean dispatchPath);
  
  } // end BizResponse
  
  
  /*
   *
   *    Copyright (c) 2002 Synthis Corporation.
   *    430 10th Street NW, Suite S-108, Atlanta GA 30318, U.S.A.
   *    All rights reserved.
   *
   *    This software is licensed to you free of charge under
   *    the Apache Software License, so long as this copyright
   *    statement, list of conditions, and comments,  remains
   *    in the source code.  See bottom of file for more
   *    license information.
   *
   *    This software was written to support code generation
   *    for the Apache Struts J2EE architecture by Synthis'
   *    visual application modeling tool Adalon.
   *
   *    For more information on Adalon and Struts code
   *    generation please visit http://www.synthis.com
   *
   */
  
  
   /*
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
    *    any, must include the following acknowlegement:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
    *    from this software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache"
    *    nor may "Apache" appear in their names without prior written
    *    permission of the Apache Group.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
    */
  
  
  
  
  1.1                  
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/BizRequestImpl.java
  
  Index: BizRequestImpl.java
  ===================================================================
  package org.apache.commons.scaffold.util;
  
  
  // ------------------------------------------------------------------------ 78
  
  import java.io.Serializable;
  import java.util.Locale;
  
  public abstract class BizRequestImpl implements Serializable, BizRequest {
  
  
      /**
       * The locale for this bean instance, if any.
       */
      private Locale locale = null;
  
  
        // See interface for JavaDoc
      public Locale getSessionLocale() {
          return this.locale;
      }
  
  
        // See interface for JavaDoc
      public void setSessionLocale(Locale locale) {
          this.locale = locale;
      }
  
  
      /**
       * The remoteNode for this bean instance, if any.
       */
      private Integer remoteNode = null;
  
  
        // See interface for JavaDoc
      public Integer getRemoteNode() {
          return this.remoteNode;
      }
  
  
        // See interface for JavaDoc
      public void setRemoteNode(Integer remoteNode) {
          this.remoteNode = remoteNode;
      }
  
  
      /**
       * Set the remoteNode using a String in
       * the format usually given
       * by the REMOTE_ADDR CGI variable, or
       * ServletRequest.getRemoteAddr().
       * NOTE: <b>not implemented; returns 0</b>.
       * @returns An Integer value based on RemoteAddr string.
       */
      public void setRemoteHost(String remoteHost) {
  
          setRemoteNode(new Integer(0)); // :FIXME: 
  
      }
  
  
      /**
       * Return the String representation
       * of an IP address expressed
       * as an Integer, into the format usually given
       * by the REMOTE_ADDR CGI variable, or
       * ServletRequest.getRemoteAddr().
       * NOTE: <b>not implemented; returns zeros.</b>
       * @returns An Integer value based on RemoteAddr string.
       */
      public String getRemoteHost() {
  
          return new String("000.000.000.000"); // :FIXME: 
  
      }
  
  
      /**
       * The remote server object for this bean instance, if any.
       * This is often an application-scope object that can be used
       * to process a JDBC query or equivalent.
       * By default, the ProcessAction will set this to any
       * application scope object found under the key "REMOTE_SERVER",
       * or to null.
       */
      private Object server = null;
  
  
        // See interface for JavaDoc
      public Object getRemoteServer() {
          return this.server;
      }
  
  
        // See interface for JavaDoc
      public void setRemoteServer(Object server) {
          this.server = server;
      }
  
  
      /**
       * The parameter
       */
      private String parameter = null;
  
  
        // See interface for JavaDoc
      public String getParameter() {
          return (this.parameter);
      }
  
  
        // See interface for JavaDoc
      public void setParameter(String parameter) {
          this.parameter = parameter;
      }
  
  
        // See interface for JavaDoc
      public Messages validate(String parameter){ 
                
                return null;
        }
  
  } // end BizRequestImpl
  
  
  /*
   *
   *    Copyright (c) 2002 Synthis Corporation.
   *    430 10th Street NW, Suite S-108, Atlanta GA 30318, U.S.A.
   *    All rights reserved.
   *
   *    This software is licensed to you free of charge under
   *    the Apache Software License, so long as this copyright
   *    statement, list of conditions, and comments,  remains
   *    in the source code.  See bottom of file for more
   *    license information.
   *
   *    This software was written to support code generation
   *    for the Apache Struts J2EE architecture by Synthis'
   *    visual application modeling tool Adalon.
   *
   *    For more information on Adalon and Struts code
   *    generation please visit http://www.synthis.com
   *
   */
  
  
  
   /*
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 2001 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
    *    any, must include the following acknowlegement:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
    *    from this software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache"
    *    nor may "Apache" appear in their names without prior written
    *    permission of the Apache Group.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
    */
  
  
  
  
  1.1                  
jakarta-commons-sandbox/scaffold/src/java/org/apache/commons/scaffold/util/BizRequest.java
  
  Index: BizRequest.java
  ===================================================================
  package org.apache.commons.scaffold.util;
  
  
  import java.util.Locale;
  
  /**
   * Simple helper bean that can be used to encapsulate the runtime 
   * properties needed by a business process.
   * @author Ted Husted
   * @version $Revision: 1.1 $ $Date: 2002/11/23 19:05:49 $
   */
  public interface BizRequest {
  
      /**
       * The session attribute key for our session locale object ["SESSION_LOCALE"].
       * (Suggestion only, may be overridden by presentation framework
       */
      public static String SESSION_LOCALE_KEY = "SESSION_LOCALE";
  
      /**
       * Return the locale for this bean instance.
       * @return the locale
       */
      public Locale getSessionLocale();
  
      /**
       * Set the locale for this bean instance.
       * @param locale The new locale
       */
      public void setSessionLocale(Locale locale);
      
      /**
       * Return the network address of the client for this bean instance.
       * @return the network address.
       */
      public Integer getRemoteNode();
  
      /**
       * Set the network address of the client for this bean instance.
       * @param remoteNode The new remoteNode.
       */
      public void setRemoteNode(Integer remoteNode);
  
      /**
       * The session attribute key for our remote server object ["REMOTE_SERVER"].
       * (Suggestion only, may be overridden by presentation framework
       */
      public static String REMOTE_SERVER_KEY = "REMOTE_SERVER";
  
      /**
       * The remote server object for this bean instance, if any.
       * <p>
       * This is often an application-scope object that can be used
       * to process a JDBC query or equivalent.
       * By default, the <code>ProcessAction</code> will set this to any
       * application scope object found under the key
       * <code>BaseAction.REMOTE_SERVER</code> or to null.
       *
       * @return the remote server
       */
      public Object getRemoteServer();
  
      /**
       * Set the remote server
       *
       * @param server The new server
       */
      public void setRemoteServer(Object server);
  
      /**
       * Return the parameter.
       */
      public String getParameter();
  
      /**
       * Set the parameter.
       * @param parameter The new parameter
       */
      public void setParameter(String parameter);
  
      /**
       * Validate the properties that have been set for this business request,
       * and return an <code>Messages</code> object that encapsulates any
       * validation errors that have been found.  If no errors are found,
       * return <code>null</code> or an <code>Messages</code> object with
       * no recorded error messages.
       * @param parameter A general purpose parameter 
       */
      public Messages validate(String parameter);
  
  
  } // end BizRequest
  
  
  
  /*
   *
   *    Copyright (c) 2002 Synthis Corporation.
   *    430 10th Street NW, Suite S-108, Atlanta GA 30318, U.S.A.
   *    All rights reserved.
   *
   *    This software is licensed to you free of charge under
   *    the Apache Software License, so long as this copyright
   *    statement, list of conditions, and comments,  remains
   *    in the source code.  See bottom of file for more
   *    license information.
   *
   *    This software was written to support code generation
   *    for the Apache Struts J2EE architecture by Synthis'
   *    visual application modeling tool Adalon.
   *
   *    For more information on Adalon and Struts code
   *    generation please visit http://www.synthis.com
   *
   */
  
  
   /*
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 2002 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * 1. Redistributions of source code must retain the above copyright
    *    notice, this list of conditions and the following disclaimer.
    *
    * 2. Redistributions in binary form must reproduce the above copyright
    *    notice, this list of conditions and the following disclaimer in
    *    the documentation and/or other materials provided with the
    *    distribution.
    *
    * 3. The end-user documentation included with the redistribution, if
    *    any, must include the following acknowlegement:
    *       "This product includes software developed by the
    *        Apache Software Foundation (http://www.apache.org/)."
    *    Alternately, this acknowlegement may appear in the software itself,
    *    if and wherever such third-party acknowlegements normally appear.
    *
    * 4. The names "The Jakarta Project", "Scaffold", and "Apache Software
    *    Foundation" must not be used to endorse or promote products derived
    *    from this software without prior written permission. For written
    *    permission, please contact [EMAIL PROTECTED]
    *
    * 5. Products derived from this software may not be called "Apache"
    *    nor may "Apache" appear in their names without prior written
    *    permission of the Apache Group.
    *
    * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
    * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    * SUCH DAMAGE.
    * ====================================================================
    *
    * This software consists of voluntary contributions made by many
    * individuals on behalf of the Apache Software Foundation.  For more
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
    */
  
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to