Project

General

Profile

« Previous | Next » 

Revision 5322

Added by berkley almost 14 years ago

added a method in IdentifierManager to get a guid from a docid and rev. added fields in the documentinfo replication document to pass the guid. now need to handle the guid and insert it into the table if its found

View differences:

ReplicationService.java
54 54
import edu.ucsb.nceas.metacat.util.DocumentUtil;
55 55
import edu.ucsb.nceas.metacat.util.MetacatUtil;
56 56
import edu.ucsb.nceas.metacat.util.SystemUtil;
57
import edu.ucsb.nceas.metacat.IdentifierManager;
58
import edu.ucsb.nceas.metacat.McdbDocNotFoundException;
57 59
import edu.ucsb.nceas.utilities.FileUtil;
58 60
import edu.ucsb.nceas.utilities.GeneralPropertyException;
59 61
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
......
526 528
			String user = (String) docinfoHash.get("user_owner");
527 529
			// Get home server of this docid
528 530
			String homeServer = (String) docinfoHash.get("home_server");
531
			String guid = (String) docinfoHash.get("guid");
532
			logReplication.debug("GUID: " + guid);
529 533
			String createdDate = (String) docinfoHash.get("date_created");
530 534
			String updatedDate = (String) docinfoHash.get("date_updated");
531 535
			logReplication.info("ReplicationService.handleForceReplicateRequest - homeServer: " + homeServer);
......
871 875
		StringBuffer sb = new StringBuffer();
872 876

  
873 877
		try {
878
		  IdentifierManager idman = IdentifierManager.getInstance();
874 879

  
875 880
			DocumentImpl doc = new DocumentImpl(docid);
876 881
			sb.append("<documentinfo><docid>").append(docid);
877
			sb.append("</docid><docname>").append(doc.getDocname());
882
			sb.append("</docid>");
883
			try
884
			{
885
			  sb.append("<guid>").append(idman.getGUID(doc.getDocID(), doc.getRev())).append("</guid>");
886
			}
887
			catch(McdbDocNotFoundException e)
888
			{
889
			  //do nothing, there was no guid for this document
890
			}
891
			sb.append("<docname>").append(doc.getDocname());
878 892
			sb.append("</docname><doctype>").append(doc.getDoctype());
879 893
			sb.append("</doctype>");
880 894
			sb.append("<user_owner>").append(doc.getUserowner());

Also available in: Unified diff