Ignore:
Timestamp:
2006-09-01T11:38:53+12:00 (18 years ago)
Author:
mdewsnip
Message:

Changed all access to the static strings through CollectionConfiguration to directly use StaticStrings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndex.java

    r12090 r12641  
    2828
    2929import java.util.*;
    30 import org.greenstone.gatherer.DebugStream;
    3130import org.greenstone.gatherer.util.StaticStrings;
    3231import org.greenstone.gatherer.util.XMLTools;
     
    5958    // Create a new element
    6059    Document document = CollectionDesignManager.collect_config.document;
    61     element = document.createElement(CollectionConfiguration.INDEX_ELEMENT);
     60    element = document.createElement(StaticStrings.INDEX_ELEMENT);
    6261    // For each source add a content element
    6362    int size = raw_sources.length;
     
    6665        String subcollection_name = subcollection.getName();
    6766        sources.add(subcollection_name);
    68         Element content_element = document.createElement(CollectionConfiguration.CONTENT_ELEMENT);
    69         content_element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, subcollection_name);
     67        Element content_element = document.createElement(StaticStrings.CONTENT_ELEMENT);
     68        content_element.setAttribute(StaticStrings.NAME_ATTRIBUTE, subcollection_name);
    7069        element.appendChild(content_element);
    7170        content_element = null;
     
    121120    if(sources == null) {
    122121        sources = new ArrayList();
    123         NodeList content_elements = element.getElementsByTagName(CollectionConfiguration.CONTENT_ELEMENT);
     122        NodeList content_elements = element.getElementsByTagName(StaticStrings.CONTENT_ELEMENT);
    124123        int content_elements_length = content_elements.getLength();
    125124        for(int i = 0; i < content_elements_length; i++) {
    126125        Element content_element = (Element) content_elements.item(i);
    127         sources.add(content_element.getAttribute(CollectionConfiguration.NAME_ATTRIBUTE));
     126        sources.add(content_element.getAttribute(StaticStrings.NAME_ATTRIBUTE));
    128127        }
    129128        content_elements = null;
     
    134133
    135134    public boolean isAssigned() {
    136     return (element != null && !element.getAttribute(CollectionConfiguration.ASSIGNED_ATTRIBUTE).equals(CollectionConfiguration.FALSE_STR));
     135    return (element != null && !element.getAttribute(StaticStrings.ASSIGNED_ATTRIBUTE).equals(StaticStrings.FALSE_STR));
    137136    }
    138137
    139138    public void setAssigned(boolean assigned) {
    140139    if(element != null) {
    141         element.setAttribute(CollectionConfiguration.ASSIGNED_ATTRIBUTE, (assigned ? CollectionConfiguration.TRUE_STR : CollectionConfiguration.FALSE_STR));
     140        element.setAttribute(StaticStrings.ASSIGNED_ATTRIBUTE, (assigned ? StaticStrings.TRUE_STR : StaticStrings.FALSE_STR));
    142141    }
    143142    }
     
    159158        int size = sources.size();
    160159        for(int i = 0; i < size; i++) {
    161         Element content_element = element.getOwnerDocument().createElement(CollectionConfiguration.CONTENT_ELEMENT);
    162         content_element.setAttribute(CollectionConfiguration.NAME_ATTRIBUTE, (String) sources.get(i));
     160        Element content_element = element.getOwnerDocument().createElement(StaticStrings.CONTENT_ELEMENT);
     161        content_element.setAttribute(StaticStrings.NAME_ATTRIBUTE, (String) sources.get(i));
    163162        element.appendChild(content_element);
    164163        content_element = null;
Note: See TracChangeset for help on using the changeset viewer.