Ignore:
Timestamp:
2004-12-11T20:12:15+13:00 (19 years ago)
Author:
schweer
Message:

should now work even when default search returns ids of document parts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/greenstone3-extensions/gsdl-as/src/org/greenstone/gsdlas/GreenstoneCommunicator.java

    r8775 r8779  
    1111import java.net.URL;
    1212import java.util.*;
     13import java.util.regex.Matcher;
     14import java.util.regex.Pattern;
    1315
    1416import javax.xml.parsers.*;
     
    143145            String docID = node.getAttributes().getNamedItem("nodeID").getNodeValue();
    144146            // TODO what about the nodeType
    145             // TODO make sure to pass IDs of whole documents, not of parts of docs
     147            // make sure to pass IDs of whole documents, not of parts of docs
     148            Matcher matcher = Pattern.compile("(\\d{8}:\\d+)*").matcher(docID);
     149            if (matcher.matches()) {
     150                docID = matcher.group(1);
     151            }
    146152            result.add(docID);
    147153        }
     
    152158    private Element sendToGreenstone(Element message) throws Exception {
    153159        Call call = new Call();
    154         call.setTargetObjectURI("localsite");
     160        // TODO get the uri from a configuration file
     161        call.setTargetObjectURI("teevee.localsite");
    155162        call.setMethodName("process");
    156163        // set Encoding Style to use literal XML
Note: See TracChangeset for help on using the changeset viewer.