You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jm...@apache.org on 2001/03/21 01:36:07 UTC

cvs commit: jakarta-turbine/src/java/org/apache/turbine/om Retrievable.java ComboKey.java OMTool.java Persistent.java

jmcnally    01/03/20 16:36:07

  Modified:    src/java/org/apache/turbine/om ComboKey.java OMTool.java
                        Persistent.java
  Added:       src/java/org/apache/turbine/om Retrievable.java
  Log:
  several unrelated changes
  
  Persistent.java - fix docs and regroup methods.
  
  Retrievable.java is an interface to mark an object as able to be identified by a String parameter.
  
  ComboKey.java avoid npe on a new object.
  
  OMTool.java commented out some code - still a work in progress
  
  Revision  Changes    Path
  1.7       +4 -1      jakarta-turbine/src/java/org/apache/turbine/om/ComboKey.java
  
  Index: ComboKey.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/om/ComboKey.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ComboKey.java	2001/03/06 04:56:01	1.6
  +++ ComboKey.java	2001/03/21 00:36:05	1.7
  @@ -309,7 +309,10 @@
               {
                   sb.append(SEPARATOR);    
               }
  -            keys[i].appendTo(sb);
  +            if ( keys[i] != null ) 
  +            {
  +                keys[i].appendTo(sb);                
  +            }
           }
       }
   
  
  
  
  1.2       +3 -3      jakarta-turbine/src/java/org/apache/turbine/om/OMTool.java
  
  Index: OMTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/om/OMTool.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- OMTool.java	2001/03/14 07:27:30	1.1
  +++ OMTool.java	2001/03/21 00:36:05	1.2
  @@ -73,7 +73,7 @@
    * A Pull tool to make om objects available to a template
    *
    * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
  - * @version $Id: OMTool.java,v 1.1 2001/03/14 07:27:30 jmcnally Exp $
  + * @version $Id: OMTool.java,v 1.2 2001/03/21 00:36:05 jmcnally Exp $
    */
   public class OMTool 
       implements ApplicationTool, Recyclable
  @@ -100,8 +100,8 @@
       {
           omMap = new HashMap();
           String className = TurbineResources.getString("tool.om.factory");
  -        RetrieverFactory omFactory = 
  -            (RetrieverFactory)Class.forName(className).newInstance();
  +        //        RetrieverFactory omFactory = 
  +        //            (RetrieverFactory)Class.forName(className).newInstance();
       }
   
       /**
  
  
  
  1.4       +19 -23    jakarta-turbine/src/java/org/apache/turbine/om/Persistent.java
  
  Index: Persistent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/om/Persistent.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Persistent.java	2001/03/06 04:56:01	1.3
  +++ Persistent.java	2001/03/21 00:36:06	1.4
  @@ -55,14 +55,13 @@
    */
   
   // Java Core Classes
  -import java.io.*;
  +//import java.io.*;
   
   /**
  - * This class contains attributes and methods that are used by all
  - * business objects within the system.
  + * This interface defines methods related to saving an object
    *
    * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
  - * @version $Id: Persistent.java,v 1.3 2001/03/06 04:56:01 chrise Exp $
  + * @version $Id: Persistent.java,v 1.4 2001/03/21 00:36:06 jmcnally Exp $
    */
   public interface Persistent
   {
  @@ -74,6 +73,22 @@
       public ObjectKey getPrimaryKey();
   
       /**
  +     * Sets the PrimaryKey for the object.
  +     *
  +     * @param ObjectKey The new PrimaryKey for the object.
  +     * @exception Exception, This method might throw an exceptions
  +     */
  +    public void setPrimaryKey(ObjectKey primaryKey) throws Exception;
  +
  +    /**
  +     * Sets the PrimaryKey for the object.
  +     *
  +     * @param String, the String should be of the form produced by
  +     *        ObjectKey.toString().
  +     * @exception Exception, This method might throw an exceptions
  +     */
  +    public void setPrimaryKey(String primaryKey) throws Exception;
  +    /**
        * Returns whether the object has been modified, since it was
        * last retrieved from storage.
        *
  @@ -97,25 +112,6 @@
        * @param b, the state of the object.
        */
       public void setNew(boolean b);
  -
  -    /**
  -     * Sets the PrimaryKey for the object.
  -     *
  -     * @param ObjectKey The new PrimaryKey for the object.
  -     * @exception Exception, This method will not throw any exceptions
  -     * but this allows for children to override the method more easily 
  -     */
  -    public void setPrimaryKey(ObjectKey primaryKey) throws Exception;
  -
  -    /**
  -     * Sets the PrimaryKey for the object.
  -     *
  -     * @param String, the String should be of the form produced by
  -     *        ObjectKey.toString().
  -     * @exception Exception, This method will not throw any exceptions
  -     * but this allows for children to override the method more easily 
  -     */
  -    public void setPrimaryKey(String primaryKey) throws Exception;
   
       /**
        * Sets the modified state for the object.
  
  
  
  1.1                  jakarta-turbine/src/java/org/apache/turbine/om/Retrievable.java
  
  Index: Retrievable.java
  ===================================================================
  package org.apache.turbine.om;
  
  /* ====================================================================
   * 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 acknowledgment:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Apache" and "Apache Software Foundation" and 
   *    "Apache Turbine" must not be used to endorse or promote products 
   *    derived from this software without prior written permission. For 
   *    written permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache",
   *    "Apache Turbine", nor may "Apache" appear in their name, without 
   *    prior written permission of the Apache Software Foundation.
   *
   * 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/>.
   */
  
  /**
   * This interface specifies methods for uniquely identifying an object.
   *
   * @author <a href="mailto:jmcnally@collab.net">John D. McNally</a>
   * @version $Id: Retrievable.java,v 1.1 2001/03/21 00:36:06 jmcnally Exp $
   */
  public interface Retrievable
  {
      /** 
       * get an id that differentiates this object from others
       * of its class.
       */
      public String getQueryKey(); 
  
      /** 
       * set an id that differentiates this object from others
       * of its class.
       */
      public void setQueryKey(String key) throws Exception; 
  
  }
  
  
  
  
  
  
  
  
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org