Changeset 7186
- Timestamp:
- 2004-04-06T09:24:53+12:00 (20 years ago)
- Location:
- trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/BuildManager.java
r6895 r7186 56 56 recogniser = new TextRecogniser(docList); 57 57 recogniserManager.addRecogniser(recogniser); 58 recogniser = new JPEGRecogniser(docList); 59 recogniserManager.addRecogniser(recogniser); 60 recogniser = new ExtXMLRecogniser(docList); 61 recogniserManager.addRecogniser(recogniser); 58 62 recogniser = new MetadataRecogniser(docList); 59 63 recogniserManager.addRecogniser(recogniser); … … 62 66 this.extractorManager = new ExtractorManager(this.docList); 63 67 this.extractorManager.addExtractor(new IndexExtractor()); 68 this.extractorManager.addExtractor(new ExtXMLExtractor()); 64 69 this.extractorManager.addExtractor(new MetaXMLExtractor()); 65 70 -
trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/CollectionManager.java
r6896 r7186 67 67 68 68 class CollectionClassifier 69 { Filefile;69 { URL file; 70 70 String type; 71 71 List fields; 72 72 String sort; 73 73 74 public CollectionClassifier( String type, Node node)74 public CollectionClassifier(URL parentURL, String type, Node node) 75 75 { this.type = type; 76 76 this.fields = new ArrayList(); … … 90 90 continue; 91 91 92 this.file = new File(urlString); 92 try { 93 URL url = new URL(parentURL, urlString); 94 this.file = url; 95 System.out.println(url); 96 } 97 catch (java.net.MalformedURLException malEx) { 98 System.out.println(malEx); 99 } 93 100 } 94 101 else if (name.equals("field")) { 95 102 String fieldName = DOMUtils.getNodeChildText(children.item(c)); 103 System.out.println("Adding field " + fieldName); 96 104 this.fields.add(fieldName.toString()); 97 105 } … … 109 117 return null; 110 118 } 119 System.out.println(this.type.toLowerCase()); 111 120 if (this.type.toLowerCase().equals("hierarchy")) { 112 121 return new HierarchyClassifier(this.file, this.fields, this.sort); … … 180 189 this.buildDocNo = 1; 181 190 } 182 public void setBuildManager(BuildManager build_man) { 183 this.buildManager = build_man; 184 } 185 186 private void configureBrowsers(Node node) 191 192 public void setBuildManager(BuildManager build_man) 193 { this.buildManager = build_man; 194 } 195 196 private void configureBrowsers(Node node, File etcFile) 187 197 { CollectionClassifier classifier = null; 198 URL etcURL = null; 199 200 try { 201 etcURL = new URL("file://"+etcFile.toString()); 202 } 203 catch (java.net.MalformedURLException malEx) { 204 System.out.println(malEx); 205 } 188 206 189 207 NodeList children = node.getChildNodes(); … … 206 224 207 225 String type = attribute.getNodeValue(); 208 classifier = new CollectionClassifier( type, children.item(c));226 classifier = new CollectionClassifier(etcURL, type, children.item(c)); 209 227 210 228 System.out.println("Found classifier " + type); … … 251 269 252 270 // the name is a plugin element 253 if (name.equals(GSXML.SEARCH_ELEM)) { 271 272 if (name.equals("doctype")) { 273 System.out.println("document type"); 274 NamedNodeMap typeAttributes = children.item(c).getAttributes(); 275 Node typeAttribute = typeAttributes.getNamedItem("type"); 276 String documentType = null; 277 278 NodeList childNodes = children.item(c).getChildNodes(); 279 for (int n = 0; n < childNodes.getLength(); n ++) 280 { if (childNodes.item(n).getNodeType() == org.w3c.dom.Node.TEXT_NODE) 281 { String label = childNodes.item(n).getNodeValue(); 282 label.trim(); 283 if (label.length() > 0) { 284 documentType = label; 285 System.out.println("Document type " + documentType); 286 } 287 } 288 } 289 } 290 else if (name.equals(GSXML.SEARCH_ELEM)) { 254 291 // pick up attributes from the <search> tag now... 255 292 NamedNodeMap searchAttributes = children.item(c).getAttributes(); … … 283 320 } 284 321 else if (name.equals(GSXML.BROWSE_ELEM)) 285 { this.configureBrowsers(children.item(c) );322 { this.configureBrowsers(children.item(c), collectionConfig); 286 323 } 287 324 // TODO: other elements - make a factory-method approach here...
Note:
See TracChangeset
for help on using the changeset viewer.