Changeset 14049
- Timestamp:
- 2007-05-03T09:33:03+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/collection/BasicCollectionConfiguration.java
r10345 r14049 43 43 import org.greenstone.gatherer.util.Codec; 44 44 import org.greenstone.gatherer.util.StaticStrings; 45 import org.greenstone.gatherer.util.XMLTools; 45 46 import org.w3c.dom.*; 46 47 … … 54 55 private String maintainer = ""; 55 56 private String name = ""; 57 private String is_public = ""; 56 58 57 59 private String site = null; // used for gs3 colls … … 145 147 ///ystem.err.println("maintainer = " + maintainer); 146 148 ///ystem.err.println("description = " + description); 149 150 if(filename.endsWith(".xml")) { 151 152 Document xml_file_doc = XMLTools.parseXMLFile(file); 153 Element root = xml_file_doc.getDocumentElement(); 154 155 Node metadataListNode = XMLTools.getChildByTagNameIndexed(root, StaticStrings.METADATALIST_STR, 0); 156 Node displayItemListNode = XMLTools.getChildByTagNameIndexed(root, StaticStrings.DISPLAYITEMLIST_STR, 0); 157 String []strings = {creator, 158 maintainer, 159 is_public, 160 name, 161 description}; 162 String []att_names = {StaticStrings.COLLECTIONMETADATA_CREATOR_STR, 163 StaticStrings.COLLECTIONMETADATA_MAINTAINER_STR, 164 StaticStrings.COLLECTIONMETADATA_PUBLIC_STR, 165 StaticStrings.NAME_STR, 166 StaticStrings.DESCRIPTION_STR}; 167 for (int i=0; i<strings.length; i++) { 168 Element e = XMLTools.getNamedElement((Element)metadataListNode, 169 StaticStrings.METADATA_STR, StaticStrings.NAME_ATTRIBUTE, att_names[i]); 170 if (i >=3) { 171 e = XMLTools.getNamedElement((Element)displayItemListNode, 172 StaticStrings.DISPLAYITEM_STR, StaticStrings.NAME_ATTRIBUTE, att_names[i]); 173 } 174 if (e == null) { 175 continue; 176 } 177 strings[i] = XMLTools.getNodeText(e); 178 } 179 180 } 147 181 } 148 182 catch(Exception error) { … … 150 184 DebugStream.printStackTrace(error); 151 185 } 186 152 187 } 153 188 … … 189 224 return name; 190 225 } 226 227 public String getIsPublic() { 228 return is_public; 229 } 191 230 192 231 /** Retrieve the short name for this collection which, given this current file is in <col_name>/etc/collect.cfg, is the name of this file's parent file's parent.
Note:
See TracChangeset
for help on using the changeset viewer.