Project

General

Profile

« Previous | Next » 

Revision 5944

Added by berkley about 13 years ago

fixed replication bug where systemmetadata was not getting procssed correctly

View differences:

ReplicationHandler.java
415 415
      //process guid
416 416
      logReplication.debug("Processing guid information from docinfoHash: " + docinfoHash.toString());
417 417
      String guid = docinfoHash.get("guid");
418
      String docName = docinfoHash.get("docName");
418
      String docName = docinfoHash.get("docname");
419 419
      System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%guid passed from docinfo hash: " + guid);
420 420
      IdentifierManager idman = IdentifierManager.getInstance();
421
      
422
      System.out.println("docname: " + docName);
423
      
421 424
      if(guid != null && !idman.identifierExists(guid))
422 425
      { //if the guid was passed in, put it in the identifiers table
423 426
        logReplication.debug("Creating guid/docid mapping for docid " + 
424 427
          docinfoHash.get("docid") + " and guid: " + guid);
425
        System.out.println("docname: " + docName);
426
        if(docName.trim().equals("systemMetadata"))
427
        {
428
            System.out.println("creating mapping for systemMetadata: guid: " + guid + " localId: " + docinfoHash.get("docid"));
429
            idman.createSystemMetadataMapping(guid, docinfoHash.get("docid"));
430
            Long dateUploadedLong = new Long(docinfoHash.get("date_uploaded"));
431
            Long dateModifiedLong = new Long(docinfoHash.get("modified_date"));
432
            idman.insertAdditionalSystemMetadataFields(
433
                    dateUploadedLong.longValue(), 
434
                    docinfoHash.get("rights_holder"),
435
                    docinfoHash.get("checksum"), 
436
                    docinfoHash.get("checksum_algorithm"), 
437
                    docinfoHash.get("origin_member_node"),
438
                    docinfoHash.get("authoritive_member_node"), 
439
                    dateModifiedLong.longValue(),
440
                    docinfoHash.get("submitter"),
441
                    docinfoHash.get("guid"),
442
                    docinfoHash.get("objectFormat"),
443
                    new Long(docinfoHash.get("size")).longValue());
444
        }
445
        else
446
        {
447
            System.out.println("creating mapping: guid: " + guid + " localId: " + docinfoHash.get("docid"));
448
            idman.createMapping(guid, docinfoHash.get("docid"));
449
        }
428
        
429
        
430
        System.out.println("creating mapping: guid: " + guid + " localId: " + docinfoHash.get("docid"));
431
        idman.createMapping(guid, docinfoHash.get("docid"));
450 432
      }
451 433
      else
452 434
      {
453 435
        logReplication.debug("No guid information was included with the replicated document");
454 436
      }
455 437
      
438
      //handle systemMetadata
439
      if(docName.trim().equals("systemMetadata"))
440
      {
441
          System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!creating mapping for systemMetadata: guid: " + guid + " localId: " + docinfoHash.get("docid"));
442
          idman.createSystemMetadataMapping(guid, docinfoHash.get("docid"));
443
          System.out.println("1");
444
          Long dateUploadedLong = new Long(docinfoHash.get("date_uploaded"));
445
          System.out.println("2");
446
          Long dateModifiedLong = new Long(docinfoHash.get("date_modified"));
447
          System.out.println("3");
448
          idman.insertAdditionalSystemMetadataFields(
449
                  dateUploadedLong.longValue(), 
450
                  docinfoHash.get("rights_holder"),
451
                  docinfoHash.get("checksum"), 
452
                  docinfoHash.get("checksum_algorithm"), 
453
                  docinfoHash.get("origin_member_node"),
454
                  docinfoHash.get("authoritive_member_node"), 
455
                  dateModifiedLong.longValue(),
456
                  docinfoHash.get("submitter"),
457
                  docinfoHash.get("guid"),
458
                  docinfoHash.get("objectFormat"),
459
                  new Long(docinfoHash.get("size")).longValue());
460
          System.out.println("4");
461
      }
462
      
456 463
      if(guid != null)
457 464
      {
458 465
          if(!docName.trim().equals("systemMetadata"))

Also available in: Unified diff