Project

General

Profile

« Previous | Next » 

Revision 7358

create docid-guid mapping during replication if it does not exist. we were [incorrectly] assuming that there would be SM coming with the document info that would fill this information in, but for traditional non-MN Metacat deployments there is no SM to provide a mapping. In this case we use the docid as the guid.

View differences:

ReplicationService.java
609 609
						updatedDate);
610 610
			} finally {
611 611

  
612
				//process extra access rules before dealing with the write exception (doc exist already)			
612
				//process extra access rules before dealing with the write exception (doc exist already)
613
				try {
614
		        	// check if we had a guid -> docid mapping
615
		        	String docidNoRev = DocumentUtil.getDocIdFromAccessionNumber(docid);
616
		        	int rev = DocumentUtil.getRevisionFromAccessionNumber(docid);
617
		        	IdentifierManager.getInstance().getGUID(docid, rev);
618
		        	// no need to create the mapping if we have it
619
		        } catch (McdbDocNotFoundException mcdbe) {
620
		        	// create mapping if we don't
621
		        	IdentifierManager.getInstance().createMapping(docid, docid);
622
		        }
613 623
		        Vector<XMLAccessDAO> accessControlList = dih.getAccessControlList();
614 624
		        if (accessControlList != null) {
615 625
		        	AccessControlForSingleFile acfsf = new AccessControlForSingleFile(docid);
......
851 861
	        }
852 862
	        
853 863
	        // process the access control
864
	        try {
865
	        	// check if we had a guid -> docid mapping
866
	        	String docidNoRev = DocumentUtil.getDocIdFromAccessionNumber(docid);
867
	        	int rev = DocumentUtil.getRevisionFromAccessionNumber(docidNoRev);
868
	        	IdentifierManager.getInstance().getGUID(docid, rev);
869
	        	// no need to create the mapping if we have it
870
	        } catch (McdbDocNotFoundException mcdbe) {
871
	        	// create mapping if we don't
872
	        	IdentifierManager.getInstance().createMapping(docid, docid);
873
	        }
854 874
	        Vector<XMLAccessDAO> accessControlList = dih.getAccessControlList();
855 875
	        if (accessControlList != null) {
856 876
	        	AccessControlForSingleFile acfsf = new AccessControlForSingleFile(docid);

Also available in: Unified diff