Project

General

Profile

« Previous | Next » 

Revision 7041

use revision provided in the docid when looking up guid. had been using latest revision which I think incorrectly reports on the log history.
noticed this when looking at: https://redmine.dataone.org/issues/2444

View differences:

src/edu/ucsb/nceas/metacat/dataone/D1NodeService.java
90 90
import edu.ucsb.nceas.metacat.dataone.hazelcast.HazelcastService;
91 91
import edu.ucsb.nceas.metacat.properties.PropertyService;
92 92
import edu.ucsb.nceas.metacat.replication.ForceReplicationHandler;
93
import edu.ucsb.nceas.metacat.util.DocumentUtil;
93 94
import edu.ucsb.nceas.metacat.util.SystemUtil;
94 95
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
95 96

  
......
436 437
        if (docid == null || docid.trim().equals("") || docid.trim().equals("null")) {
437 438
          continue;
438 439
        }
439
        docid = docid.substring(0, docid.lastIndexOf("."));
440
        identifier.setValue(im.getGUID(docid, im.getLatestRevForLocalId(docid)));
440
        String docidNoRev = DocumentUtil.getSmartDocId(docid);
441
        //docid = docid.substring(0, docid.lastIndexOf("."));
442
        int rev = DocumentUtil.getRevisionFromAccessionNumber(docid);
443
        //int rev = im.getLatestRevForLocalId(docid);
444
        String guid = im.getGUID(docidNoRev, rev);
445
        identifier.setValue(guid);
441 446
      } catch (Exception ex) { 
442 447
        // try to get the pid, if that doesn't
443 448
        // work, just use the local id

Also available in: Unified diff