Ignore:
Timestamp:
2010-12-07T14:27:04+13:00 (13 years ago)
Author:
kjdon
Message:

added support for specifying accumulating=false in metadata set definition. GLI then won't allow user to add multiple values for that element.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/metadata/MetadataValue.java

    r11301 r23394  
    3939    private MetadataElement metadata_element = null;
    4040    private MetadataValueTreeNode metadata_value_tree_node = null;
     41  // this will be set to true if the metadata element definition says accumulating = false.
     42  private boolean must_not_accumulate = false;
    4143    private boolean is_accumulating_metadata = false;
    4244    /** Whether this metadata applies to only one file (ie. there are no wildcards in the FileSet value) */
     
    4850    this.metadata_element = metadata_element;
    4951    this.metadata_value_tree_node = metadata_value_tree_node;
     52    if (metadata_element != null) {
     53      if (!metadata_element.isAccumulating()) {
     54        must_not_accumulate = true;
     55      }
     56    }
    5057    }
    5158
     
    122129    public void setIsAccumulatingMetadata(boolean is_accumulating_metadata)
    123130    {
     131      if (!must_not_accumulate) {
    124132    this.is_accumulating_metadata = is_accumulating_metadata;
     133      }
    125134    }
    126135
Note: See TracChangeset for help on using the changeset viewer.