portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wea...@apache.org
Subject cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/ojb CollectionDebugger.java CSVtoCollectionFieldConversion.java
Date Fri, 23 Jan 2004 19:33:24 GMT
weaver      2004/01/23 11:33:24

  Modified:    portal/src/java/org/apache/jetspeed/util/ojb
                        CSVtoCollectionFieldConversion.java
  Added:       portal/src/java/org/apache/jetspeed/util/ojb
                        CollectionDebugger.java
  Log:
  - CollectionDebugger can be used to debug colleciton descriptors
  - Changed to logging in the CSVCollectionFieldConversion
  
  Revision  Changes    Path
  1.3       +8 -4      jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/ojb/CSVtoCollectionFieldConversion.java
  
  Index: CSVtoCollectionFieldConversion.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/ojb/CSVtoCollectionFieldConversion.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CSVtoCollectionFieldConversion.java	7 Oct 2003 21:38:16 -0000	1.2
  +++ CSVtoCollectionFieldConversion.java	23 Jan 2004 19:33:24 -0000	1.3
  @@ -60,6 +60,8 @@
   import java.util.Collection;
   import java.util.Iterator;
   
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   import org.apache.ojb.broker.accesslayer.conversions.ConversionException;
   import org.apache.ojb.broker.accesslayer.conversions.FieldConversion;
   
  @@ -76,6 +78,8 @@
       private static final String DELIM = ",";
       private static final String QUOTE = "\"";
       
  +    private static final Log log = LogFactory.getLog(CSVtoCollectionFieldConversion.class);
  +    
       /**
        * @see org.apache.ojb.broker.accesslayer.conversions.FieldConversion#javaToSql(java.lang.Object)
        * @task Fix JDK 1.3 complient problem described in the FIXME
  @@ -107,13 +111,13 @@
                   {
                   //  FieldConversionLog.LOG.error("The string '" + value + 
                   // "' contains embeded '\"'.  It will not be converted to a CSV correctly.");
  -                  System.out.println("In CSVtoCollectionFieldConversion() - The string
'" + value + 
  +                  log.warn("In CSVtoCollectionFieldConversion() - The string '" + value
+ 
                           "' contains embeded '\"'.  It will not be converted to a CSV correctly.");
                   }
                   buffer.append(value);
                   // End of FIXME:
                   buffer.append(QUOTE);
  -                System.out.println("String encoded ");
  +                
                   if (itr.hasNext())
                   {
                       buffer.append(DELIM);
  @@ -147,13 +151,13 @@
                   while (st.nextToken() != StreamTokenizer.TT_EOF)
                   {
                       list.add(createObject(st.sval));
  -                    System.out.println("Parsed token value: "+st.sval);
  +                    log.debug("Parsed token value: "+st.sval);
                   }
               }
               catch (IOException e)
               {
                   String message = "CSV parsing failed during field conversion.";
  -             //    FieldConversionLog.LOG.error(message, e);
  +                log.error(message, e);
                   throw new ConversionException("CSV parsing failed during field conversion.",
e);
               } 
   
  
  
  
  1.1                  jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/util/ojb/CollectionDebugger.java
  
  Index: CollectionDebugger.java
  ===================================================================
  /**
   * Created on Jan 22, 2004
   *
   * 
   * @author
   */
  package org.apache.jetspeed.util.ojb;
  
  import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
  import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
  import org.apache.jetspeed.om.impl.PortletDisplayNameImpl;
  import org.apache.ojb.broker.PersistenceBroker;
  import org.apache.ojb.broker.accesslayer.QueryCustomizer;
  import org.apache.ojb.broker.metadata.CollectionDescriptor;
  import org.apache.ojb.broker.query.Criteria;
  import org.apache.ojb.broker.query.Query;
  import org.apache.ojb.broker.query.QueryByCriteria;
  import org.apache.ojb.broker.query.QueryFactory;
  
  /**
   * <p>
   * CollectionDebugger
   * </p>
   * 
   * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
   * @version $Id: CollectionDebugger.java,v 1.1 2004/01/23 19:33:24 weaver Exp $
   *
   */
  public class CollectionDebugger implements QueryCustomizer
  {
  
      /**
       * @see org.apache.ojb.broker.accesslayer.QueryCustomizer#customizeQuery(java.lang.Object,
org.apache.ojb.broker.PersistenceBroker, org.apache.ojb.broker.metadata.CollectionDescriptor,
org.apache.ojb.broker.query.QueryByCriteria)
       */
      public Query customizeQuery(Object arg0, PersistenceBroker pb, CollectionDescriptor
arg2, QueryByCriteria arg3)
      {        
          return arg3;
      }
  
      /**
       * @see org.apache.ojb.broker.metadata.AttributeContainer#addAttribute(java.lang.String,
java.lang.String)
       */
      public void addAttribute(String arg0, String arg1)
      {
          // TODO Auto-generated method stub
  
      }
  
      /**
       * @see org.apache.ojb.broker.metadata.AttributeContainer#getAttribute(java.lang.String,
java.lang.String)
       */
      public String getAttribute(String arg0, String arg1)
      {
          // TODO Auto-generated method stub
          return null;
      }
  
      /**
       * @see org.apache.ojb.broker.metadata.AttributeContainer#getAttribute(java.lang.String)
       */
      public String getAttribute(String arg0)
      {
          // TODO Auto-generated method stub
          return null;
      }
  
  }
  
  
  

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


Mime
View raw message