Project

General

Profile

« Previous | Next » 

Revision 1561

Added by Jing Tao over 21 years ago

Add code to handle initialize eml2 parser.

View differences:

src/edu/ucsb/nceas/metacat/MetacatReplication.java
492 492
      // Get home server of this docid
493 493
      String homeServer=(String)docinfoHash.get("home_server");
494 494
      MetaCatUtil.debugMessage("homeServer: "+homeServer, 34);
495
    
495
      // Get Document type
496
      String docType = (String)docinfoHash.get("doctype");
497
      MetaCatUtil.debugMessage("docType: "+docType, 34);
498
      String parserBase = null;
499
      // this for eml2 and we need user eml2 parser
500
      if (docType != null && 
501
          (docType.trim()).equals(DocumentImpl.EMLNAMESPACE))
502
      {
503
         MetaCatUtil.debugMessage("This is an eml2 document!", 30);
504
         parserBase = DocumentImpl.EML2;
505
      }
506
      MetaCatUtil.debugMessage("The parserBase is: "+parserBase, 30);
507
           
496 508
      // Get DBConnection from pool
497 509
      dbConn=DBConnectionPool.
498 510
              getDBConnection("MetacatReplication.handleForceReplicateRequest");
499 511
      serialNumber=dbConn.getCheckOutSerialNumber();
500 512
      // write the document to local database
501
      DocumentImplWrapper.writeReplication(dbConn, 
502
                  new StringReader(xmldoc), null, null, dbaction, docid, user, 
503
                  null, homeServer, server);
513
      DocumentImplWrapper wrapper = new DocumentImplWrapper(parserBase, false);
514
      wrapper.writeReplication(dbConn, new StringReader(xmldoc), null, null, 
515
                               dbaction, docid, user, null, homeServer, server);
504 516
              
505 517
      MetacatReplication.replLog("document " + docid + " added to DB with " +
506 518
                                 "action " + dbaction);

Also available in: Unified diff