Changeset 8868


Ignore:
Timestamp:
2004-12-21T14:16:50+13:00 (19 years ago)
Author:
schweer
Message:

unify Strings used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/gs3build/notifier/NotifierManager.java

    r8772 r8868  
    1717    public void detectEvents(CollectionManager collManager) {
    1818       
     19        System.out.println("detecting events");
     20       
    1921        String collectionName = collManager.getCollectionName();
    2022        String host = "http://localhost:8080/soap/servlet/rpcrouter";
    2123       
    2224        String lastBuild = dateToSqlString(collManager.getBuildDate());
     25        System.out.println("last build was " + lastBuild);
    2326        Statement statement = collManager.getDatabase().createStatement();
    2427        try {
     
    3033            // detect modified documents. A document is modified if and only if
    3134            // AccessionDate < CollectionLastRebuiltDate (ie, it is not new) and
    32             // ModifiedDate >= IndexedDate
    33             results = statement.executeQuery("SELECT DocID FROM document WHERE DocType != 'GSMETADATA' AND AccessionDate < " + lastBuild + " AND ModifiedDate >= IndexedDate");
     35            // IndexedDate >= CollectionLastRebuiltDate
     36            results = statement.executeQuery("SELECT DocID FROM document WHERE DocType != 'GSMETADATA' AND AccessionDate < " + lastBuild + " AND IndexedDate >= " + lastBuild);
    3437            notify(collectionName, host, results, collManager.getDatabase(), collManager.getBuildDate(), "document_modified");
     38           
     39            // TODO deleted docs?
    3540        } catch (SQLException e) {
    3641            // TODO Auto-generated catch block
     
    5661           
    5762            while(results.next()) {
    58                 System.out.println("new document: " + results.getString("DocID"));
     63                System.out.println(eventType + ": " + results.getString("DocID"));
    5964               
    6065                String documentID = results.getString("DocID");
     
    7782                    writer.write("&collectionID=");
    7883                    writer.write(URLEncoder.encode(collName, "UTF-8"));
    79                     writer.write("&host_url=");
     84                    // TODO add collection name to event
     85                    writer.write("&hostID=");
    8086                    writer.write(URLEncoder.encode(hostURL, "UTF-8"));
    8187                    writer.write("&document_title=");
     
    145151     */
    146152    private String getDocumentTitle(String documentID, GS3SQLConnection database) {
     153        System.out.println("getting title for document " + documentID + " from database");
    147154        Statement statement = database.createStatement();
    148155
     
    161168            results = statement.executeQuery(sqlString);
    162169            if (results.next()) {
    163                 return results.getString(0);
     170                String title = results.getString("value");
     171                System.out.println("title is " + title);
     172                return title;
    164173            }
    165174        } catch (SQLException e) {
     175            e.printStackTrace();
    166176        }
    167177        return "";
Note: See TracChangeset for help on using the changeset viewer.