Project

General

Profile

« Previous | Next » 

Revision 7370

use SchemaLocationResolver to fetch remote entries for the xml_catalog -- we want to be able to fetch included xsd files as well as use any error handling it provides for checking the schemas.

View differences:

src/edu/ucsb/nceas/metacat/replication/ReplicationHandler.java
64 64
import edu.ucsb.nceas.metacat.EventLog;
65 65
import edu.ucsb.nceas.metacat.IdentifierManager;
66 66
import edu.ucsb.nceas.metacat.McdbDocNotFoundException;
67
import edu.ucsb.nceas.metacat.SchemaLocationResolver;
67 68
import edu.ucsb.nceas.metacat.accesscontrol.AccessControlForSingleFile;
68 69
import edu.ucsb.nceas.metacat.accesscontrol.XMLAccessDAO;
69 70
import edu.ucsb.nceas.metacat.client.InsufficientKarmaException;
......
995 996
           if(!publicId.contains(v.elementAt(3)))
996 997
           { //so we don't have this public id in our local table so we need to
997 998
             //add it.
999
        	   
1000
        	   // check where it is pointing first, before adding
1001
        	   String entryType = (String)v.elementAt(0);
1002
        	   if (entryType.equals(DocumentImpl.SCHEMA)) {
1003
	        	   String nameSpace = (String)v.elementAt(3);
1004
	        	   String schemaLocation = (String)v.elementAt(4);
1005
	        	   SchemaLocationResolver slr = new SchemaLocationResolver(nameSpace, schemaLocation);
1006
	        	   try {
1007
	        		   slr.resolveNameSpace();
1008
	        	   } catch (Exception e) {
1009
	        		   String msg = "Could not save remote schema to xml catalog. " + "nameSpace: " + nameSpace + " location: " + schemaLocation;
1010
	        		   logMetacat.error(msg, e);
1011
	        		   logReplication.error(msg, e);
1012
	        	   }
1013
	        	   // skip whatever else we were going to do
1014
	        	   continue;
1015
        	   }
1016
        	   
998 1017
             //logMetacat.debug("in if");
999 1018
             StringBuffer sql = new StringBuffer();
1000 1019
             sql.append("insert into xml_catalog (entry_type, source_doctype, ");

Also available in: Unified diff