- Timestamp:
- 2006-09-01T11:38:53+12:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/SubcollectionIndex.java
r12090 r12641 28 28 29 29 import java.util.*; 30 import org.greenstone.gatherer.DebugStream;31 30 import org.greenstone.gatherer.util.StaticStrings; 32 31 import org.greenstone.gatherer.util.XMLTools; … … 59 58 // Create a new element 60 59 Document document = CollectionDesignManager.collect_config.document; 61 element = document.createElement( CollectionConfiguration.INDEX_ELEMENT);60 element = document.createElement(StaticStrings.INDEX_ELEMENT); 62 61 // For each source add a content element 63 62 int size = raw_sources.length; … … 66 65 String subcollection_name = subcollection.getName(); 67 66 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); 70 69 element.appendChild(content_element); 71 70 content_element = null; … … 121 120 if(sources == null) { 122 121 sources = new ArrayList(); 123 NodeList content_elements = element.getElementsByTagName( CollectionConfiguration.CONTENT_ELEMENT);122 NodeList content_elements = element.getElementsByTagName(StaticStrings.CONTENT_ELEMENT); 124 123 int content_elements_length = content_elements.getLength(); 125 124 for(int i = 0; i < content_elements_length; i++) { 126 125 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)); 128 127 } 129 128 content_elements = null; … … 134 133 135 134 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)); 137 136 } 138 137 139 138 public void setAssigned(boolean assigned) { 140 139 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)); 142 141 } 143 142 } … … 159 158 int size = sources.size(); 160 159 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)); 163 162 element.appendChild(content_element); 164 163 content_element = null;
Note:
See TracChangeset
for help on using the changeset viewer.