[metacat-cvs] metacat/src/edu/ucsb/nceas/metacat/advancedsearch AdvancedSearchBean.java

Duane Costa costa at ecoinformatics.org
Tue Nov 22 14:45:37 PST 2005


costa       05/11/22 14:45:37

  Modified:    src/edu/ucsb/nceas/metacat/advancedsearch
                        AdvancedSearchBean.java
  Log:
  Modify the bean's get() methods that return String values to trim white space off the string prior to returning it. This is so that input fields that contain only white space will not be treated as valid search values.
  
  Revision  Changes    Path
  1.2       +11 -11    metacat/src/edu/ucsb/nceas/metacat/advancedsearch/AdvancedSearchBean.java
  
  Index: AdvancedSearchBean.java
  ===================================================================
  RCS file: /cvs/metacat/src/edu/ucsb/nceas/metacat/advancedsearch/AdvancedSearchBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AdvancedSearchBean.java	16 Nov 2005 17:57:33 -0000	1.1
  +++ AdvancedSearchBean.java	22 Nov 2005 22:45:37 -0000	1.2
  @@ -4,8 +4,8 @@
    *             Regents of the University of California and the
    *             National Center for Ecological Analysis and Synthesis
    *   '$Author: costa $'
  - *     '$Date: 2005/11/16 17:57:33 $'
  - * '$Revision: 1.1 $'
  + *     '$Date: 2005/11/22 22:45:37 $'
  + * '$Revision: 1.2 $'
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
  @@ -75,7 +75,7 @@
      * @return Returns the creatorOrganization.
      */
     public String getCreatorOrganization() {
  -    return creatorOrganization;
  +    return creatorOrganization == null ? null : creatorOrganization.trim();
     }
     
     
  @@ -91,7 +91,7 @@
      * @return Returns the creatorSurname.
      */
     public String getCreatorSurname() {
  -    return creatorSurname;
  +    return creatorSurname == null ? null : creatorSurname.trim();
     }
     
     
  @@ -107,7 +107,7 @@
      * @return Returns the dateField. Possible values: "PUBLICATION", "COLLECTION" 
      */
     public String getDateField() {
  -    return dateField;
  +    return dateField == null ? null : dateField.trim();
     }
     
     
  @@ -123,7 +123,7 @@
      * @return Returns the endDate.
      */
     public String getEndDate() {
  -    return endDate;
  +    return endDate == null ? null : endDate.trim();
     }
     
     
  @@ -139,7 +139,7 @@
      * @return Returns the locationName.
      */
     public String getLocationName() {
  -    return locationName;
  +    return locationName == null ? null : locationName.trim();
     }
     
     
  @@ -147,7 +147,7 @@
      * @return Returns the namedTimescale.
      */
     public String getNamedTimescale() {
  -    return namedTimescale;
  +    return namedTimescale == null ? null : namedTimescale.trim();
     }
     
     
  @@ -187,7 +187,7 @@
      * @return Returns the startDate.
      */
     public String getStartDate() {
  -    return startDate;
  +    return startDate == null ? null : startDate.trim();
     }
     
     
  @@ -221,7 +221,7 @@
      * @return Returns the subjectValue.
      */
     public String getSubjectValue() {
  -    return subjectValue;
  +    return subjectValue == null ? null : subjectValue.trim();
     }
     
     
  @@ -229,7 +229,7 @@
      * @return Returns the taxon.
      */
     public String getTaxon() {
  -    return taxon;
  +    return taxon == null ? null : taxon.trim();
     }
     
     
  
  
  


More information about the Metacat-cvs mailing list