Project

General

Profile

« Previous | Next » 

Revision 9583

Added by Jing Tao about 8 years ago

If a format id in the system metadata is registered in the xml_catalog table, we will use the schema location for the format id to validate the xml instance;
otherwise, we will use our previous way.

View differences:

XMLSchema.java
39 39
	private String fileName = null;
40 40
	private String localFileUri = null;
41 41
	private String localFileDir = null;
42
	private String formatId = null;
42 43
	
43
	private Logger logMetacat = Logger.getLogger(XMLSchema.class);
44 44

  
45
    private Logger logMetacat = Logger.getLogger(XMLSchema.class);
46

  
45 47
	/**
46 48
	 * Constructor - the schema file name will be extracted from the external
47 49
	 * file uri. The local file uri and local file dir will be constructed using
......
52 54
	 * @param externalFileUri
53 55
	 *            the external uri where the schema is located
54 56
	 */
55
	public XMLSchema(String fileNamespace, String externalFileUri) {
57
	public XMLSchema(String fileNamespace, String externalFileUri, String formatId) {
56 58
		setFileNamespace(fileNamespace);
57 59
		setExternalFileUri(externalFileUri);
60
		setFormatId(formatId);
58 61
	}
59 62
	
60 63
	/**
......
64 67
	 * @param namespace
65 68
	 *            the file's name space
66 69
	 */
67
	public XMLSchema(String fileNamespace) {
70
	/*public XMLSchema(String fileNamespace) {
68 71
		setFileNamespace(fileNamespace);
69
	}
72
	}*/
70 73
	
71 74
	/**
72 75
	 * Set the file name. The local file uri and local file dir will also get
......
202 205
	public String getLocalFileDir() {
203 206
		return localFileDir;
204 207
	}
208
	
209
	
210
	/**
211
	 * Get the format id
212
	 * @return the format id
213
	 */
214
	public String getFormatId() {
215
        return formatId;
216
    }
217

  
218
	/**
219
	 * Set the format id. 
220
	 * @param formatId. 
221
	 */
222
    public void setFormatId(String formatId) {
223
            this.formatId = formatId;
224
    }
205 225
}

Also available in: Unified diff