Project

General

Profile

« Previous | Next » 

Revision 9069

Added by Jing Tao almost 10 years ago

Add code to check if the sid equals pid for the method checkSidInRegisterSystemMetadata.

View differences:

src/edu/ucsb/nceas/metacat/dataone/CNodeService.java
2008 2008
	        if (!isValidIdentifier(sid)) {
2009 2009
	            throw new InvalidSystemMetadata(invalidSystemMetadataCode, "The series id "+sid.getValue()+"in the system metadata is invalid in the request.");
2010 2010
	        }
2011
	        Identifier pid = sysmeta.getIdentifier();
2012
	        if (!isValidIdentifier(pid)) {
2013
                throw new InvalidSystemMetadata(invalidSystemMetadataCode, "The pid in the system metadata is invalid in the request.");
2014
            }
2015
	        //the series id equals the pid (new pid hasn't been registered in the system, so IdentifierManager.getInstance().identifierExists method can't exclude this scenario )
2016
            if(sid.getValue().equals(pid.getValue())) {
2017
                throw new InvalidSystemMetadata(invalidSystemMetadataCode, "The series id "+sid.getValue()+" in the system metadata shouldn't have the same value of the pid.");
2018
            }
2011 2019
	        try {
2012 2020
	            if (IdentifierManager.getInstance().identifierExists(sid.getValue())) {
2013 2021
	                //the sid exists in system

Also available in: Unified diff