Changeset 382
- Timestamp:
- 11/10/08 14:07:37 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/greenstone/Greenstone3Connection.java
r376 r382 11 11 import java.util.Collections; 12 12 import java.util.HashMap; 13 import java.util.HashSet; 13 14 import java.util.Iterator; 14 15 import java.util.List; … … 47 48 public class Greenstone3Connection { 48 49 /** an ordered list of {@link Query} objects */ 49 private List queryList;50 private List<Query> queryList; 50 51 51 52 /** … … 60 61 * with each item being NULL. 61 62 */ 62 private Map allKeywords; 63 64 /** 65 * a HashMap keyed on the author names found for all documents returned in 66 * this session. Each item in the map is itself a HashMap, keyed on document 67 * IDs with each item being NULL. 68 */ 69 private Map allAuthors; 63 private Map<String, Set<String>> allKeywords; 64 65 /** 66 * a set of authors names 67 */ 68 private Map<String, Set<String>> allAuthors; 70 69 71 70 /** … … 74 73 * document IDs with each item being NULL. 75 74 */ 76 private Map allDates;75 private Map<String, Set<String>> allDates; 77 76 78 77 /** … … 81 80 * IDs with each item being NULL. 82 81 */ 83 private Map allJournals;82 private Map<String, Set<String>> allJournals; 84 83 85 84 /** … … 88 87 * IDs with each item being NULL. 89 88 */ 90 private Map allBooktitles;89 private Map<String, Set<String>> allBooktitles; 91 90 92 91 /** the <i>hostname</i> where the Greenstone 3 server is running */ … … 155 154 this.SOAPrequestHeader = "POST /greenstone3/services/localsite HTTP/1.1\nHost: 130.217.220.10:8111\nSOAPAction: hcibib/PROCESSNAME\nContent-Type: text/xml;charset=utf-8\nContent-Length: "; 156 155 } 157 this.queryList = Collections.synchronizedList(new ArrayList ());156 this.queryList = Collections.synchronizedList(new ArrayList<Query>()); 158 157 this.allResults = Collections 159 158 .synchronizedMap(new HashMap<String, ResultDocument>()); 160 this.allKeywords = Collections.synchronizedMap(new HashMap()); 161 this.allAuthors = Collections.synchronizedMap(new HashMap()); 162 this.allDates = Collections.synchronizedMap(new HashMap()); 163 this.allJournals = Collections.synchronizedMap(new HashMap()); 164 this.allBooktitles = Collections.synchronizedMap(new HashMap()); 159 this.allKeywords = Collections.synchronizedMap(new HashMap<String, Set<String>>()); 160 this.allAuthors = Collections 161 .synchronizedMap(new HashMap<String, Set<String>>()); 162 this.allDates = Collections.synchronizedMap(new HashMap<String, Set<String>>()); 163 this.allJournals = Collections.synchronizedMap(new HashMap<String, Set<String>>()); 164 this.allBooktitles = Collections.synchronizedMap(new HashMap<String, Set<String>>()); 165 165 } 166 166 … … 572 572 String s = keywords[i].trim().toLowerCase(); 573 573 resultDocument.addKeyword(s); 574 if (allKeywords.containsKey(s)) { 575 HashMap docMap = (HashMap) allKeywords.get(s); 576 docMap.put(docID, null); 577 allKeywords.put(s, docMap); 578 } else { 579 HashMap docMap = new HashMap(); 580 docMap.put(docID, null); 581 allKeywords.put(s, docMap); 574 Set<String> docSet = allKeywords.get(metadataval); 575 if (docSet == null) { 576 docSet = new HashSet<String>(); 582 577 } 578 docSet.add(docID); 579 allKeywords.put(metadataval, docSet); 583 580 } 584 581 } else if (metadata.compareTo("Creator") == 0) { … … 606 603 // System.err.println(s); 607 604 resultDocument.addAuthor(s); 608 if (allAuthors.containsKey(s)) { 609 HashMap docMap = (HashMap) allAuthors.get(s); 610 docMap.put(docID, null); 611 allAuthors.put(s, docMap); 612 } else { 613 HashMap docMap = new HashMap(); 614 docMap.put(docID, null); 615 allAuthors.put(s, docMap); 605 606 Set<String> docSet = allAuthors.get(s); 607 if (docSet == null) { 608 docSet = new HashSet<String>(); 616 609 } 610 docSet.add(docID); 611 allAuthors.put(s, docSet); 617 612 } 618 613 } else if (metadata.compareTo("Title") == 0) { … … 620 615 } else if (metadata.compareTo("Booktitle") == 0) { 621 616 resultDocument.setBooktitle(metadataval); 622 if (allBooktitles.containsKey(metadataval)) { 623 HashMap docMap = (HashMap) allBooktitles.get(metadataval); 624 docMap.put(docID, null); 625 allBooktitles.put(metadataval, docMap); 626 } else { 627 HashMap docMap = new HashMap(); 628 docMap.put(docID, null); 629 allBooktitles.put(metadataval, docMap); 617 618 Set<String> docSet = allBooktitles.get(metadataval); 619 if (docSet == null) { 620 docSet = new HashSet<String>(); 630 621 } 622 docSet.add(docID); 623 allBooktitles.put(metadataval, docSet); 631 624 } else if (metadata.compareTo("Date") == 0) { 632 625 resultDocument.setDate(metadataval.replaceAll("[^0-9]", "")); 633 if (allDates.containsKey(metadataval)) { 634 HashMap docMap = (HashMap) allDates.get(metadataval); 635 docMap.put(docID, null); 636 allDates.put(metadataval, docMap); 637 } else { 638 HashMap docMap = new HashMap(); 639 docMap.put(docID, null); 640 allDates.put(metadataval, docMap); 626 Set<String> docSet = allDates.get(metadataval); 627 if (docSet == null) { 628 docSet = new HashSet<String>(); 641 629 } 630 docSet.add(docID); 631 allDates.put(metadataval, docSet); 642 632 } else if (metadata.compareTo("Pages") == 0) { 643 633 resultDocument.setPages(metadataval); 644 634 } else if (metadata.compareTo("Journal") == 0) { 645 635 resultDocument.setJournal(metadataval); 646 if (allJournals.containsKey(metadataval)) { 647 HashMap docMap = (HashMap) allJournals.get(metadataval); 648 docMap.put(docID, null); 649 allJournals.put(metadataval, docMap); 650 } else { 651 HashMap docMap = new HashMap(); 652 docMap.put(docID, null); 653 allJournals.put(metadataval, docMap); 636 Set<String> docSet = allJournals.get(metadataval); 637 if (docSet == null) { 638 docSet = new HashSet<String>(); 654 639 } 640 docSet.add(docID); 641 allJournals.put(metadataval, docSet); 655 642 } else if (metadata.compareTo("Volume") == 0) { 656 643 resultDocument.setVolume(metadataval); -
trunk/src/org/expeditee/io/HTMLWriter.java
r376 r382 12 12 import org.expeditee.items.Picture; 13 13 import org.expeditee.items.Text; 14 15 import sun.awt.image.ToolkitImage;16 14 17 15 public class HTMLWriter extends AbstractHTMLWriter {
Note:
See TracChangeset
for help on using the changeset viewer.